(Format of ChangeLog): New node, split out from ChangeLog.
[bpt/emacs.git] / man / ebrowse.texi
CommitLineData
2d0600a3
GM
1\input texinfo @c -*-texinfo-*-
2
2d0600a3
GM
3@comment %**start of header
4@setfilename ../info/ebrowse
5@settitle A Class Browser for C++
6@setchapternewpage odd
60a96371 7@syncodeindex fn cp
2d0600a3
GM
8@comment %**end of header
9
18f952d5 10@copying
2d0600a3
GM
11This file documents Ebrowse, a C++ class browser for GNU Emacs.
12
b65d8176 13Copyright @copyright{} 2000, 2002, 2003, 2004,
8d99e09d 14 2005, 2006 Free Software Foundation, Inc.
308374ca 15
18f952d5 16@quotation
308374ca 17Permission is granted to copy, distribute and/or modify this document
678e7c71 18under the terms of the GNU Free Documentation License, Version 1.2 or
308374ca
DL
19any later version published by the Free Software Foundation; with no
20Invariant Sections, with the Front-Cover texts being ``A GNU
80d7cf55 21Manual,'' and with the Back-Cover Texts as in (a) below. A copy of the
308374ca
DL
22license is included in the section entitled ``GNU Free Documentation
23License'' in the Emacs manual.
24
25(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
26this GNU Manual, like GNU software. Copies published by the Free
27Software Foundation raise funds for GNU development.''
28
29This document is part of a collection distributed under the GNU Free
30Documentation License. If you want to distribute this document
31separately from the collection, you can do so by adding a copy of the
32license to the document, as described in section 6 of the license.
18f952d5
KB
33@end quotation
34@end copying
35
36@dircategory Emacs
177c0ea7 37@direntry
18f952d5
KB
38* Ebrowse: (ebrowse). A C++ class browser for Emacs.
39@end direntry
2d0600a3
GM
40
41@titlepage
60a96371
GM
42@title Ebrowse User's Manual
43@sp 4
44@subtitle Ebrowse/Emacs 21
45@sp 1
46@subtitle May 2000
47@sp 5
48@author Gerd Moellmann
49@page
60a96371 50@vskip 0pt plus 1filll
18f952d5 51@insertcopying
2d0600a3 52@end titlepage
2d0600a3
GM
53
54@node Top, Overview, (dir), (dir)
55
60a96371 56@ifnottex
2d0600a3
GM
57You can browse C++ class hierarchies from within Emacs by using
58Ebrowse.
60a96371 59@end ifnottex
2d0600a3
GM
60
61@menu
62* Overview:: What is it and now does it work?
63* Generating browser files:: How to process C++ source files
64* Loading a Tree:: How to start browsing
65* Tree Buffers:: Traversing class hierarchies
66* Member Buffers:: Looking at member information
67* Tags-like Functions:: Finding members from source files
68* Concept Index:: An entry for each concept defined
69@end menu
70
71
72
73
74@node Overview, Generating browser files, Top, Top
75@chapter Introduction
2d0600a3
GM
76
77When working in software projects using C++, I frequently missed
78software support for two things:
79
80@itemize @bullet
81@item
82When you get a new class library, or you have to work on source code you
83haven't written yourself (or written sufficiently long ago), you need a
91051870
DL
84tool to let you navigate class hierarchies and investigate
85features of the software. Without such a tool you often end up
86@command{grep}ing through dozens or even hundreds of files.
2d0600a3
GM
87
88@item
89Once you are productive, it would be nice to have a tool that knows your
90sources and can help you while you are editing source code. Imagine to
91be able to jump to the definition of an identifier while you are
92editing, or something that can complete long identifier names because it
93knows what identifiers are defined in your program@dots{}.
94@end itemize
95
96The design of Ebrowse reflects these two needs.
97
177c0ea7 98How does it work?
2d0600a3 99
60a96371 100@cindex parser for C++ sources
2d0600a3
GM
101A fast parser written in C is used to process C++ source files.
102The parser generates a data base containing information about classes,
91051870 103members, global functions, defines, types etc.@: found in the sources.
2d0600a3
GM
104
105The second part of Ebrowse is a Lisp program. This program reads
106the data base generated by the parser. It displays its contents in
107various forms and allows you to perform operations on it, or do
108something with the help of the knowledge contained in the data base.
109
60a96371 110@cindex major modes, of Ebrowse buffers
2d0600a3
GM
111@dfn{Navigational} use of Ebrowse is centered around two
112types of buffers which define their own major modes:
113
60a96371 114@cindex tree buffer
2d0600a3
GM
115@dfn{Tree buffers} are used to view class hierarchies in tree form.
116They allow you to quickly find classes, find or view class declarations,
117perform operations like query replace on sets of your source files, and
118finally tree buffers are used to produce the second buffer form---member
60a96371 119buffers. @xref{Tree Buffers}.
2d0600a3 120
60a96371 121@cindex member buffer
2d0600a3
GM
122Members are displayed in @dfn{member buffers}. Ebrowse
123distinguishes between six different types of members; each type is
124displayed as a member list of its own:
125
126@itemize @bullet
127@item
91051870 128Instance member variables;
2d0600a3
GM
129
130@item
91051870 131Instance member functions;
2d0600a3
GM
132
133@item
91051870 134Static member variables;
2d0600a3
GM
135
136@item
91051870 137Static member functions;
2d0600a3
GM
138
139@item
91051870
DL
140Friends/Defines. The list of defines is contained in the friends
141list of the pseudo-class @samp{*Globals*};
2d0600a3
GM
142
143@item
144Types (@code{enum}s, and @code{typedef}s defined with class
145scope).@refill
146@end itemize
147
148You can switch member buffers from one list to another, or to another
149class. You can include inherited members in the display, you can set
150filters that remove categories of members from the display, and most
151importantly you can find or view member declarations and definitions
60a96371 152with a keystroke. @xref{Member Buffers}.
2d0600a3
GM
153
154These two buffer types and the commands they provide support the
155navigational use of the browser. The second form resembles Emacs' Tags
156package for C and other procedural languages. Ebrowse's commands of
157this type are not confined to special buffers; they are most often used
158while you are editing your source code.
159
160To list just a subset of what you can use the Tags part of Ebrowse for:
161
162@itemize @bullet
163@item
164Jump to the definition or declaration of an identifier in your source
60a96371 165code, with an electric position stack that lets you easily navigate
2d0600a3
GM
166back and forth.
167
168@item
169Complete identifiers in your source with a completion list containing
170identifiers from your source code only.
171
172@item
173Perform search and query replace operations over some or all of your
174source files.
175
176@item
177Show all identifiers matching a regular expression---and jump to one of
178them, if you like.
179@end itemize
180
181
182
183
184@node Generating browser files, Loading a Tree, Overview, Top
185@comment node-name, next, previous, up
186@chapter Processing Source Files
2d0600a3 187
60a96371
GM
188@cindex @command{ebrowse}, the program
189@cindex class data base creation
2d0600a3 190Before you can start browsing a class hierarchy, you must run the parser
60a96371 191@command{ebrowse} on your source files in order to generate a Lisp data
2d0600a3
GM
192base describing your program.
193
60a96371
GM
194@cindex command line for @command{ebrowse}
195The operation of @command{ebrowse} can be tailored with command line
2d0600a3
GM
196options. Under normal circumstances it suffices to let the parser use
197its default settings. If you want to do that, call it with a command
198line like:
199
200@example
201ebrowse *.h *.cc
202@end example
203
204@noindent
60a96371 205or, if your shell doesn't allow all the file names to be specified on
2d0600a3
GM
206the command line,
207
208@example
209ebrowse --files=@var{file}
210@end example
211
212@noindent
213where @var{file} contains the names of the files to be parsed, one
214per line.
215
60a96371
GM
216@findex --help
217When invoked with option @samp{--help}, @command{ebrowse} prints a list of
2d0600a3
GM
218available command line options.@refill
219
220@menu
221* Input files:: Specifying which files to parse
222* Output file:: Changing the output file name
223* Structs and unions:: Omitting @code{struct}s and @code{union}s
224* Matching:: Setting regular expression lengths
225* Verbosity:: Getting feedback for lengthy operations
226@end menu
227
228
229
230
231@comment name, next, prev, up
232@node Input files, Output file, Generating browser files, Generating browser files
233@section Specifying Input Files
2d0600a3
GM
234
235@table @samp
60a96371 236@cindex input files, for @command{ebrowse}
2d0600a3 237@item file
60a96371 238Each file name on the command line tells @command{ebrowse} to parse
2d0600a3
GM
239that file.
240
60a96371
GM
241@cindex response files
242@findex --files
2d0600a3
GM
243@item --files=@var{file}
244This command line switch specifies that @var{file} contains a list of
245file names to parse. Each line in @var{file} must contain one file
246name. More than one option of this kind is allowed. You might, for
247instance, want to use one file for header files, and another for source
248files.
249
60a96371 250@cindex standard input, specifying input files
2d0600a3 251@item standard input
60a96371 252When @command{ebrowse} finds no file names on the command line, and no
2d0600a3 253@samp{--file} option is specified, it reads file names from standard
60a96371 254input. This is sometimes convenient when @command{ebrowse} is used as part
2d0600a3
GM
255of a command pipe.
256
60a96371 257@findex --search-path
2d0600a3 258@item --search-path=@var{paths}
91051870 259This option lets you specify search paths for your input files.
2d0600a3
GM
260@var{paths} is a list of directory names, separated from each other by a
261either a colon or a semicolon, depending on the operating system.
262@end table
263
60a96371
GM
264@cindex header files
265@cindex friend functions
2d0600a3
GM
266It is generally a good idea to specify input files so that header files
267are parsed before source files. This facilitates the parser's work of
268properly identifying friend functions of a class.
269
270
271
272@comment name, next, prev, up
273@node Output file, Structs and unions, Input files, Generating browser files
274@section Changing the Output File Name
2d0600a3
GM
275
276@table @samp
60a96371
GM
277@cindex output file name
278@findex --output-file
279@cindex @file{BROWSE} file
2d0600a3 280@item --output-file=@var{file}
60a96371 281This option instructs @command{ebrowse} to generate a Lisp data base with
2d0600a3 282name @var{file}. By default, the data base is named @file{BROWSE}, and
60a96371 283is written in the directory in which @command{ebrowse} is invoked.
2d0600a3
GM
284
285If you regularly use data base names different from the default, you
60a96371 286might want to add this to your init file:
2d0600a3
GM
287
288@lisp
289(add-to-list 'auto-mode-alist '(@var{NAME} . ebrowse-tree-mode))
290@end lisp
291
177c0ea7 292@noindent
2d0600a3
GM
293where @var{NAME} is the Lisp data base name you are using.
294
60a96371
GM
295@findex --append
296@cindex appending output to class data base
2d0600a3 297@item --append
60a96371
GM
298By default, each run of @command{ebrowse} erases the old contents of the
299output file when writing to it. You can instruct @command{ebrowse} to
3ddfb687 300append its output to an existing file produced by @command{ebrowse}
bfb01a95 301with this command line option.
2d0600a3
GM
302@end table
303
304
305
306
307@comment name, next, prev, up
308@node Structs and unions, Matching, Output file, Generating browser files
309@section Structs and Unions
310@cindex structs
311@cindex unions
2d0600a3
GM
312
313@table @samp
60a96371 314@findex --no-structs-or-unions
2d0600a3
GM
315@item --no-structs-or-unions
316This switch suppresses all classes in the data base declared as
317@code{struct} or @code{union} in the output.
318
91051870 319This is mainly useful when you are converting an existing
2d0600a3
GM
320C program to C++, and do not want to see the old C structs in a class
321tree.
322@end table
323
324
325
326
327@comment name, next, prev, up
328@node Matching, Verbosity, Structs and unions, Generating browser files
329@section Regular Expressions
2d0600a3 330
60a96371
GM
331@cindex regular expressions, recording
332The parser @command{ebrowse} normally writes regular expressions to its
333output file that help the Lisp part of Ebrowse to find functions,
91051870 334variables etc.@: in their source files.
2d0600a3 335
60a96371
GM
336You can instruct @command{ebrowse} to omit these regular expressions by
337calling it with the command line switch @samp{--no-regexps}.
2d0600a3
GM
338
339When you do this, the Lisp part of Ebrowse tries to guess, from member
340or class names, suitable regular expressions to locate that class or
341member in source files. This works fine in most cases, but the
342automatic generation of regular expressions can be too weak if unusual
343coding styles are used.
344
345@table @samp
60a96371 346@findex --no-regexps
2d0600a3 347@item --no-regexps
91051870 348This option turns off regular expression recording.
2d0600a3 349
60a96371
GM
350@findex --min-regexp-length
351@cindex minimum regexp length for recording
2d0600a3
GM
352@item --min-regexp-length=@var{n}
353The number @var{n} following this option specifies the minimum length of
354the regular expressions recorded to match class and member declarations
355and definitions. The default value is set at compilation time of
60a96371 356@command{ebrowse}.
2d0600a3 357
91051870 358The smaller the minimum length, the higher the probability that
2d0600a3
GM
359Ebrowse will find a wrong match. The larger the value, the
360larger the output file and therefore the memory consumption once the
361file is read from Emacs.
362
60a96371
GM
363@findex --max-regexp-length
364@cindex maximum regexp length for recording
2d0600a3
GM
365@item --max-regexp-length=@var{n}
366The number following this option specifies the maximum length of the
367regular expressions used to match class and member declarations and
368definitions. The default value is set at compilation time of
60a96371 369@command{ebrowse}.
2d0600a3 370
91051870 371The larger the maximum length, the higher the probability that the
2d0600a3
GM
372browser will find a correct match, but the larger the value the larger
373the output file and therefore the memory consumption once the data is
91051870 374read. As a second effect, the larger the regular expression, the higher
2d0600a3
GM
375the probability that it will no longer match after editing the file.
376@end table
377
378
379
380
381@node Verbosity, , Matching, Generating browser files
382@comment node-name, next, previous, up
383@section Verbose Mode
60a96371 384@cindex verbose operation
2d0600a3
GM
385
386@table @samp
60a96371 387@findex --verbose
2d0600a3 388@item --verbose
60a96371 389When this option is specified on the command line, @command{ebrowse} prints
2d0600a3
GM
390a period for each file parsed, and it displays a @samp{+} for each
391class written to the output file.
392
60a96371 393@findex --very-verbose
2d0600a3 394@item --very-verbose
60a96371 395This option makes @command{ebrowse} print out the names of the files and
2d0600a3
GM
396the names of the classes seen.
397@end table
398
399
400
401
402@node Loading a Tree, Tree Buffers, Generating browser files, Top
403@comment node-name, next, previous, up
404@chapter Starting to Browse
405@cindex loading
406@cindex browsing
407
60a96371 408You start browsing a class hierarchy parsed by @command{ebrowse} by just
2d0600a3
GM
409finding the @file{BROWSE} file with @kbd{C-x C-f}.
410
411An example of a tree buffer display is shown below.
412
413@example
414| Collection
415| IndexedCollection
416| Array
417| FixedArray
418| Set
419| Dictionary
420@end example
421
60a96371
GM
422@cindex mouse highlight in tree buffers
423When you run Emacs on a display which supports colors and the mouse, you
7cd0d847 424will notice that certain areas in the tree buffer are highlighted
60a96371
GM
425when you move the mouse over them. This highlight marks mouse-sensitive
426regions in the buffer. Please notice the help strings in the echo area
427when the mouse moves over a sensitive region.
2d0600a3 428
60a96371 429@cindex context menu
80d7cf55 430A click with @kbd{Mouse-3} on a mouse-sensitive region opens a context
2d0600a3 431menu. In addition to this, each buffer also has a buffer-specific menu
80d7cf55 432that is opened with a click with @kbd{Mouse-3} somewhere in the buffer
2d0600a3
GM
433where no highlight is displayed.
434
435
436
437@comment ****************************************************************
438@comment ***
439@comment *** TREE BUFFERS
440@comment ***
441@comment ****************************************************************
442
443@node Tree Buffers, Member Buffers, Loading a Tree, Top
444@comment node-name, next, previous, up
445@chapter Tree Buffers
2d0600a3
GM
446@cindex tree buffer mode
447@cindex class trees
448
449Class trees are displayed in @dfn{tree buffers} which install their own
450major mode. Most Emacs keys work in tree buffers in the usual way,
91051870 451e.g.@: you can move around in the buffer with the usual @kbd{C-f},
2d0600a3
GM
452@kbd{C-v} etc., or you can search with @kbd{C-s}.
453
454Tree-specific commands are bound to simple keystrokes, similar to
455@code{Gnus}. You can take a look at the key bindings by entering
456@kbd{?} which calls @code{M-x describe-mode} in both tree and member
457buffers.
458
459@menu
460* Source Display:: Viewing and finding a class declaration
461* Member Display:: Showing members, switching to member buffers
462* Go to Class:: Finding a class
463* Quitting:: Discarding and burying the tree buffer
464* File Name Display:: Showing file names in the tree
465* Expanding and Collapsing:: Expanding and collapsing branches
466* Tree Indentation:: Changing the tree indentation
467* Killing Classes:: Removing class from the tree
468* Saving a Tree:: Saving a modified tree
469* Statistics:: Displaying class tree statistics
470* Marking Classes:: Marking and unmarking classes
471@end menu
472
473
474
475@node Source Display, Member Display, Tree Buffers, Tree Buffers
476@comment node-name, next, previous, up
477@section Viewing and Finding Class Declarations
478@cindex viewing, class
60a96371 479@cindex finding a class
2d0600a3
GM
480@cindex class declaration
481
482You can view or find a class declaration when the cursor is on a class
483name.
484
485@table @kbd
486@item SPC
487This command views the class declaration if the database
488contains informations about it. If you don't parse the entire source
489you are working on, some classes will only be known to exist but the
490location of their declarations and definitions will not be known.@refill
491
492@item RET
493Works like @kbd{SPC}, except that it finds the class
494declaration rather than viewing it, so that it is ready for
495editing.@refill
496@end table
497
498The same functionality is available from the menu opened with
80d7cf55 499@kbd{Mouse-3} on the class name.
2d0600a3
GM
500
501
502
503
504@node Member Display, Go to Class, Source Display, Tree Buffers
505@comment node-name, next, previous, up
506@section Displaying Members
60a96371 507@cindex @samp{*Members*} buffer
2d0600a3 508@cindex @samp{*Globals*}
60a96371
GM
509@cindex freezing a member buffer
510@cindex member lists, in tree buffers
2d0600a3
GM
511
512Ebrowse distinguishes six different kinds of members, each of
513which is displayed as a separate @dfn{member list}: instance variables,
514instance functions, static variables, static functions, friend
515functions, and types.
516
517Each of these lists can be displayed in a member buffer with a command
518starting with @kbd{L} when the cursor is on a class name. By default,
519there is only one member buffer named @dfn{*Members*} that is reused
520each time you display a member list---this has proven to be more
521practical than to clutter up the buffer list with dozens of member
522buffers.
523
524If you want to display more than one member list at a time you can
525@dfn{freeze} its member buffer. Freezing a member buffer prevents it
526from being overwritten the next time you display a member list. You can
527toggle this buffer status at any time.
528
529Every member list display command in the tree buffer can be used with a
530prefix argument (@kbd{C-u}). Without a prefix argument, the command will
531pop to a member buffer displaying the member list. With prefix argument,
532the member buffer will additionally be @dfn{frozen}.
533
534@table @kbd
60a96371 535@cindex instance member variables, list
2d0600a3
GM
536@item L v
537This command displays the list of instance member variables.
538
60a96371 539@cindex static variables, list
2d0600a3
GM
540@item L V
541Display the list of static variables.
542
60a96371 543@cindex friend functions, list
2d0600a3
GM
544@item L d
545Display the list of friend functions. This list is used for defines if
546you are viewing the class @samp{*Globals*} which is a place holder for
547global symbols.
548
60a96371 549@cindex member functions, list
2d0600a3
GM
550@item L f
551Display the list of member functions.
552
60a96371 553@cindex static member functions, list
2d0600a3
GM
554@item L F
555Display the list of static member functions.
556
60a96371 557@cindex types, list
2d0600a3
GM
558@item L t
559Display a list of types.
560@end table
561
562These lists are also available from the class' context menu invoked with
80d7cf55 563@kbd{Mouse-3} on the class name.
2d0600a3
GM
564
565
566
567
568@node Go to Class, Quitting, Member Display, Tree Buffers
569@comment node-name, next, previous, up
570@section Finding a Class
571@cindex locate class
572@cindex expanding branches
60a96371 573@cindex class location
2d0600a3
GM
574
575@table @kbd
60a96371 576@cindex search for class
2d0600a3
GM
577@item /
578This command reads a class name from the minibuffer with completion and
579positions the cursor on the class in the class tree.
580
581If the branch of the class tree containing the class searched for is
582currently collapsed, the class itself and all its base classes are
60a96371 583recursively made visible. (See also @ref{Expanding and
2d0600a3
GM
584Collapsing}.)@refill
585
586This function is also available from the tree buffer's context menu.
587
588@item n
589Repeat the last search done with @kbd{/}. Each tree buffer has its own
590local copy of the regular expression last searched in it.
591@end table
592
593
594
595
596@node Quitting, File Name Display, Go to Class, Tree Buffers
597@comment node-name, next, previous, up
598@section Burying a Tree Buffer
60a96371 599@cindex burying tree buffer
2d0600a3
GM
600
601@table @kbd
602@item q
603Is a synonym for @kbd{M-x bury-buffer}.
604@end table
605
606
607
608
609@node File Name Display, Expanding and Collapsing, Quitting, Tree Buffers
610@comment node-name, next, previous, up
611@section Displaying File Names
2d0600a3
GM
612
613@table @kbd
60a96371 614@cindex file names in tree buffers
2d0600a3
GM
615@item T f
616This command toggles the display of file names in a tree buffer. If
617file name display is switched on, the names of the files containing the
618class declaration are shown to the right of the class names. If the
619file is not known, the string @samp{unknown} is displayed.
620
621This command is also provided in the tree buffer's context menu.
622
623@item s
624Display file names for the current line, or for the number of lines
177c0ea7 625given by a prefix argument.
2d0600a3
GM
626@end table
627
628Here is an example of a tree buffer with file names displayed.
629
630@example
631| Collection (unknown)
632| IndexedCollection (indexedcltn.h)
633| Array (array.h)
634| FixedArray (fixedarray.h)
635| Set (set.h)
636| Dictionary (dict.h)
637@end example
638
639
640
641
642@node Expanding and Collapsing, Tree Indentation, File Name Display, Tree Buffers
643@comment node-name, next, previous, up
644@section Expanding and Collapsing a Tree
60a96371
GM
645@cindex expand tree branch
646@cindex collapse tree branch
647@cindex branches of class tree
648@cindex class tree, collapse or expand
2d0600a3
GM
649
650You can expand and collapse parts of a tree to reduce the complexity of
651large class hierarchies. Expanding or collapsing branches of a tree has
652no impact on the functionality of other commands, like @kbd{/}. (See
60a96371 653also @ref{Go to Class}.)@refill
2d0600a3
GM
654
655Collapsed branches are indicated with an ellipsis following the class
656name like in the example below.
657
658@example
659| Collection
660| IndexedCollection...
661| Set
662| Dictionary
663@end example
664
665@table @kbd
666@item -
667This command collapses the branch of the tree starting at the class the
177c0ea7 668cursor is on.
2d0600a3
GM
669
670@item +
671This command expands the branch of the tree starting at the class the
91051870 672cursor is on. Both commands for collapsing and expanding branches are
2d0600a3
GM
673also available from the class' object menu.
674
675@item *
676This command expands all collapsed branches in the tree.
677@end table
678
679
680
681
682@node Tree Indentation, Killing Classes, Expanding and Collapsing, Tree Buffers
683@comment node-name, next, previous, up
684@section Changing the Tree Indentation
685@cindex tree indentation
60a96371 686@cindex indentation of the tree
2d0600a3
GM
687
688@table @kbd
689@item T w
690This command reads a new indentation width from the minibuffer and
91051870 691redisplays the tree buffer with the new indentation It is also
2d0600a3
GM
692available from the tree buffer's context menu.
693@end table
694
695
696
697
698@node Killing Classes, Saving a Tree, Tree Indentation, Tree Buffers
699@comment node-name, next, previous, up
700@section Removing Classes from the Tree
701@cindex killing classes
60a96371 702@cindex class, remove from tree
2d0600a3
GM
703
704@table @kbd
705@item C-k
706This command removes the class the cursor is on and all its derived
707classes from the tree. The user is asked for confirmation before the
708deletion is actually performed.
709@end table
710
711
712
713
714@node Saving a Tree, Statistics, Killing Classes, Tree Buffers
715@comment node-name, next, previous, up
716@comment node-name, next, previous, up
717@section Saving a Tree
60a96371
GM
718@cindex save tree to a file
719@cindex tree, save to a file
720@cindex class tree, save to a file
2d0600a3
GM
721
722@table @kbd
723@item C-x C-s
91051870
DL
724This command writes a class tree to the file from which it was read.
725This is useful after classes have been deleted from a tree.
2d0600a3
GM
726
727@item C-x C-w
728Writes the tree to a file whose name is read from the minibuffer.
729@end table
730
731
732
733
734@node Statistics, Marking Classes, Saving a Tree, Tree Buffers
735@comment node-name, next, previous, up
60a96371
GM
736@cindex statistics for a tree
737@cindex tree statistics
738@cindex class statistics
2d0600a3
GM
739
740@table @kbd
741@item x
742Display statistics for the tree, like number of classes in it, number of
743member functions, etc. This command can also be found in the buffer's
744context menu.
745@end table
746
747
748
749
750@node Marking Classes, , Statistics, Tree Buffers
751@comment node-name, next, previous, up
752@cindex marking classes
60a96371 753@cindex operations on marked classes
2d0600a3
GM
754
755Classes can be marked for operations similar to the standard Emacs
756commands @kbd{M-x tags-search} and @kbd{M-x tags-query-replace} (see
757also @xref{Tags-like Functions}.)@refill
758
759@table @kbd
60a96371 760@cindex toggle mark
2d0600a3
GM
761@item M t
762Toggle the mark of the line point is in or for as many lines as given by
763a prefix command. This command can also be found in the class' context
177c0ea7 764menu.
2d0600a3 765
60a96371 766@cindex unmark all
2d0600a3
GM
767@item M a
768Unmark all classes. With prefix argument @kbd{C-u}, mark all classes in
769the tree. Since this command operates on the whole buffer, it can also be
770found in the buffer's object menu.
771@end table
772
773Marked classes are displayed with an @code{>} in column one of the tree
774display, like in the following example
775
776@example
777|> Collection
778| IndexedCollection...
779|> Set
780| Dictionary
781@end example
782
783
784
785
786@c ****************************************************************
787@c ***
788@c *** MEMBER BUFFERS
789@c ***
790@c ****************************************************************
791
792@node Member Buffers, Tags-like Functions, Tree Buffers, Top
793@comment node-name, next, previous, up
794@chapter Member Buffers
2d0600a3
GM
795@cindex members
796@cindex member buffer mode
797
60a96371
GM
798@cindex class members, types
799@cindex types of class members
2d0600a3
GM
800@dfn{Member buffers} are used to operate on lists of members of a class.
801Ebrowse distinguishes six kinds of lists:
802
803@itemize @bullet
804@item
91051870 805Instance variables (normal member variables);
2d0600a3 806@item
91051870 807Instance functions (normal member functions);
2d0600a3 808@item
91051870 809Static variables;
2d0600a3 810@item
91051870 811Static member functions;
2d0600a3 812@item
91051870 813Friend functions;
2d0600a3
GM
814@item
815Types (@code{enum}s and @code{typedef}s defined with class scope.
816Nested classes will be shown in the class tree like normal classes.
817@end itemize
818
819Like tree buffers, member buffers install their own major mode. Also
820like in tree buffers, menus are provided for certain areas in the
821buffer: members, classes, and the buffer itself.
822
823@menu
824* Switching Member Lists:: Choosing which members to display
825* Finding/Viewing:: Modifying source code
826* Inherited Members:: Display of Inherited Members
827* Searching Members:: Finding members in member buffer
828* Switching to Tree:: Going back to the tree buffer
829* Filters:: Selective member display
830* Attributes:: Display of @code{virtual} etc.
831* Long and Short Display:: Comprehensive and verbose display
832* Regexp Display:: Showing matching regular expressions
833* Switching Classes:: Displaying another class
834* Killing/Burying:: Getting rid of the member buffer
835* Column Width:: Display style
836* Redisplay:: Redrawing the member list
837* Getting Help:: How to get help for key bindings
838@end menu
839
840
841
842
843@node Switching Member Lists, Finding/Viewing, Member Buffers, Member Buffers
844@comment node-name, next, previous, up
845@section Switching Member Lists
60a96371 846@cindex member lists, in member buffers
2d0600a3
GM
847@cindex static members
848@cindex friends
849@cindex types
850@cindex defines
851
852@table @kbd
60a96371 853@cindex next member list
2d0600a3
GM
854@item L n
855This command switches the member buffer display to the next member list.
856
60a96371 857@cindex previous member list
2d0600a3
GM
858@item L p
859This command switches the member buffer display to the previous member
860list.
861
862@item L f
863Switch to the list of member functions.
864
177c0ea7 865@cindex static
2d0600a3
GM
866@item L F
867Switch to the list of static member functions.
868
869@item L v
870Switch to the list of member variables.
871
872@item L V
873Switch to the list of static member variables.
874
875@item L d
876Switch to the list of friends or defines.
877
878@item L t
91051870 879Switch to the list of types.
2d0600a3
GM
880@end table
881
882Both commands cycle through the member list.
883
177c0ea7 884Most of the commands are also available from the member buffer's
2d0600a3
GM
885context menu.
886
887
888
889
890@node Finding/Viewing, Inherited Members, Switching Member Lists, Member Buffers
891@comment node-name, next, previous, up
892@section Finding and Viewing Member Source
60a96371
GM
893@cindex finding members, in member buffers
894@cindex viewing members, in member buffers
895@cindex member definitions, in member buffers
896@cindex member declarations, in member buffers
897@cindex definition of a member, in member buffers
898@cindex declaration of a member, in member buffers
2d0600a3
GM
899
900@table @kbd
901@item RET
902This command finds the definition of the member the cursor is on.
903Finding involves roughly the same as the standard Emacs tags facility
904does---loading the file and searching for a regular expression matching
905the member.
906
907@item f
908This command finds the declaration of the member the cursor is on.
909
910@item SPC
911This is the same command as @kbd{RET}, but views the member definition
912instead of finding the member's source file.
913
914@item v
915This is the same command as @kbd{f}, but views the member's declaration
916instead of finding the file the declaration is in.
917@end table
918
919You can install a hook function to perform actions after a member or
920class declaration or definition has been found, or when it is not found.
921
922All the commands described above can also be found in the context menu
80d7cf55 923displayed when clicking @kbd{Mouse-2} on a member name.
2d0600a3
GM
924
925
926
927
928@node Inherited Members, Searching Members, Finding/Viewing, Member Buffers
929@comment node-name, next, previous, up
930@section Display of Inherited Members
60a96371
GM
931@cindex superclasses, members
932@cindex base classes, members
2d0600a3
GM
933@cindex inherited members
934
935@table @kbd
936@item D b
937This command toggles the display of inherited members in the member
91051870 938buffer. This is also in the buffer's context menu.
2d0600a3
GM
939@end table
940
941
942
943
944@node Searching Members, Switching to Tree, Inherited Members, Member Buffers
945@comment node-name, next, previous, up
946@section Searching Members
947@cindex searching members
948
949@table @kbd
950@item G v
951Position the cursor on a member whose name is read from the minibuffer;
952only members shown in the current member buffer appear in the completion
953list.
954
955@item G m
956Like the above command, but all members for the current class appear in
91051870 957the completion list. If necessary, the current member list is switched
2d0600a3
GM
958to the one containing the member.
959
960With a prefix argument (@kbd{C-u}), all members in the class tree,
91051870
DL
961i.e.@: all members the browser knows about appear in the completion
962list. The member display will be switched to the class and member list
2d0600a3
GM
963containing the member.
964
965@item G n
966Repeat the last member search.
967@end table
968
969Look into the buffer's context menu for a convenient way to do this with
970a mouse.
971
972
973
974@node Switching to Tree, Filters, Searching Members, Member Buffers
975@comment node-name, next, previous, up
976@section Switching to Tree Buffer
60a96371 977@cindex tree buffer, switch to
2d0600a3
GM
978@cindex buffer switching
979@cindex switching buffers
980
981@table @kbd
ee6c21a7 982@item @key{TAB}
2d0600a3
GM
983Pop up the tree buffer to which the member buffer belongs.
984
985@item t
ee6c21a7 986Do the same as @key{TAB} but also position the cursor on the class
2d0600a3
GM
987displayed in the member buffer.
988@end table
989
990
991
992
993@node Filters, Attributes, Switching to Tree, Member Buffers
994@comment node-name, next, previous, up
995@section Filters
996@cindex filters
2d0600a3
GM
997
998@table @kbd
60a96371 999@cindex @code{public} members
177c0ea7 1000@item F a u
2d0600a3
GM
1001This command toggles the display of @code{public} members. The
1002@samp{a} stands for `access'.
1003
60a96371 1004@cindex @code{protected} members
2d0600a3
GM
1005@item F a o
1006This command toggles the display of @code{protected} members.
1007
60a96371 1008@cindex @code{private} members
2d0600a3
GM
1009@item F a i
1010This command toggles the display of @code{private} members.
1011
60a96371 1012@cindex @code{virtual} members
2d0600a3
GM
1013@item F v
1014This command toggles the display of @code{virtual} members.
1015
60a96371 1016@cindex @code{inline} members
2d0600a3
GM
1017@item F i
1018This command toggles the display of @code{inline} members.
1019
60a96371 1020@cindex @code{const} members
2d0600a3
GM
1021@item F c
1022This command toggles the display of @code{const} members.
1023
60a96371 1024@cindex pure virtual members
2d0600a3
GM
1025@item F p
1026This command toggles the display of pure virtual members.
1027
60a96371 1028@cindex remove filters
2d0600a3
GM
1029@item F r
1030This command removes all filters.
1031@end table
1032
1033These commands are also found in the buffer's context menu.
1034
1035
1036
1037
1038@node Attributes, Long and Short Display, Filters, Member Buffers
1039@comment node-name, next, previous, up
1040@section Displaying Member Attributes
1041@cindex attributes
60a96371 1042@cindex member attribute display
2d0600a3
GM
1043
1044@table @kbd
1045@item D a
1046Toggle the display of member attributes (default is on).
1047
7cd0d847 1048The nine member attributes Ebrowse knows about are displayed
2d0600a3
GM
1049as a list a single-characters flags enclosed in angle brackets in front
1050the of the member's name. A @samp{-} at a given position means that
1051the attribute is false. The list of attributes from left to right is
1052
1053@table @samp
60a96371 1054@cindex @code{template} attribute
2d0600a3
GM
1055@item T
1056The member is a template.
1057
60a96371 1058@cindex @code{extern "C"} attribute
2d0600a3
GM
1059@item C
1060The member is declared @code{extern "C"}.
1061
60a96371 1062@cindex @code{virtual} attribute
2d0600a3
GM
1063@item v
1064Means the member is declared @code{virtual}.
1065
60a96371 1066@cindex @code{inline}
2d0600a3
GM
1067@item i
1068The member is declared @code{inline}.
1069
60a96371 1070@cindex @code{const} attribute
2d0600a3
GM
1071@item c
1072The member is @code{const}.
1073
60a96371 1074@cindex pure virtual function attribute
2d0600a3
GM
1075@item 0
1076The member is a pure virtual function.
1077
60a96371 1078@cindex @code{mutable} attribute
2d0600a3
GM
1079@item m
1080The member is declared @code{mutable}.
1081
60a96371 1082@cindex @code{explicit} attribute
2d0600a3
GM
1083@item e
1084The member is declared @code{explicit}.
1085
1086@item t
1087The member is a function with a throw list.
1088@end table
1089@end table
1090
1091This command is also in the buffer's context menu.
1092
1093
1094
1095@node Long and Short Display, Regexp Display, Attributes, Member Buffers
1096@comment node-name, next, previous, up
1097@section Long and Short Member Display
1098@cindex display form
1099@cindex long display
1100@cindex short display
2d0600a3
GM
1101
1102@table @kbd
1103@item D l
1104This command toggles the member buffer between short and long display
1105form. The short display form displays member names, only:
1106
1107@example
1108| isEmpty contains hasMember create
1109| storeSize hash isEqual restoreGuts
1110| saveGuts
1111@end example
1112
1113The long display shows one member per line with member name and regular
1114expressions matching the member (if known):
1115
1116@example
1117| isEmpty Bool isEmpty () const...
1118| hash unsigned hash () const...
1119| isEqual int isEqual (...
1120@end example
1121
1122Regular expressions will only be displayed when the Lisp database has
60a96371
GM
1123not been produced with the @command{ebrowse} option @samp{--no-regexps}.
1124@xref{Matching, --no-regexps, Regular Expressions}.
2d0600a3
GM
1125@end table
1126
1127
1128
1129
1130@node Regexp Display, Switching Classes, Long and Short Display, Member Buffers
1131@comment node-name, next, previous, up
1132@section Display of Regular Expressions
1133@cindex regular expression display
1134
1135@table @kbd
1136@item D r
1137This command toggles the long display form from displaying the regular
1138expressions matching the member declarations to those expressions
1139matching member definitions.
1140@end table
1141
1142Regular expressions will only be displayed when the Lisp database has
60a96371
GM
1143not been produced with the @command{ebrowse} option @samp{--no-regexps},
1144see @ref{Matching, --no-regexps, Regular Expressions}.
2d0600a3
GM
1145
1146
1147
1148
1149@node Switching Classes, Killing/Burying, Regexp Display, Member Buffers
1150@comment node-name, next, previous, up
1151@section Displaying Another Class
60a96371
GM
1152@cindex base class, display
1153@cindex derived class, display
1154@cindex superclass, display
1155@cindex subclass, display
2d0600a3
GM
1156@cindex class display
1157
1158@table @kbd
1159@item C c
1160This command lets you switch the member buffer to another class. It
1161reads the name of the new class from the minibuffer with completion.
1162
1163@item C b
1164This is the same command as @kbd{C c} but restricts the classes shown in
1165the completion list to immediate base classes, only. If only one base
1166class exists, this one is immediately shown in the minibuffer.
1167
1168@item C d
1169Same as @kbd{C b}, but for derived classes.
1170
1171@item C p
1172Switch to the previous class in the class hierarchy on the same level as
1173the class currently displayed.
1174
1175@item C n
1176Switch to the next sibling of the class in the class tree.
1177@end table
1178
1179
1180
1181
1182@node Killing/Burying, Column Width, Switching Classes, Member Buffers
1183@comment node-name, next, previous, up
1184@section Burying a Member Buffer
1185@cindex burying member buffers
1186
1187@table @kbd
1188@item q
1189This command is a synonym for @kbd{M-x bury-buffer}.
1190@end table
1191
1192
1193
1194
1195@node Column Width, Redisplay, Killing/Burying, Member Buffers
1196@comment node-name, next, previous, up
1197@section Setting the Column Width
1198@cindex column width
1199@cindex member indentation
1200@cindex indentation, member
1201
1202@table @kbd
1203@item D w
1204This command sets the column width depending on the display form used
1205(long or short display).
1206@end table
1207
1208
1209
1210
1211@node Redisplay, Getting Help, Column Width, Member Buffers
1212@comment node-name, next, previous, up
1213@section Forced Redisplay
60a96371 1214@cindex redisplay of member buffers
2d0600a3
GM
1215
1216@table @kbd
1217@item C-l
1218This command forces a redisplay of the member buffer. If the width
1219of the window displaying the member buffer is changed this command
1220redraws the member list with the appropriate column widths and number of
177c0ea7 1221columns.
2d0600a3
GM
1222@end table
1223
1224
1225
1226
1227@node Getting Help, , Redisplay, Member Buffers
1228@comment node-name, next, previous, up
1229@cindex help
1230
1231@table @kbd
1232@item ?
1233This key is bound to @code{describe-mode}.
1234@end table
1235
1236
1237
1238
1239@comment **************************************************************
1240@comment *** TAGS LIKE FUNCTIONS
1241@comment **************************************************************
1242
1243@node Tags-like Functions, Concept Index, Member Buffers, Top
1244@comment node-name, next, previous, up
1245@chapter Tags-like Functions
1246
1247Ebrowse provides tags functions similar to those of the standard
1248Emacs Tags facility, but better suited to the needs of C++ programmers.
1249
1250@menu
1251* Finding and Viewing:: Going to a member declaration/definition
1252* Position Stack:: Moving to previous locations
1253* Search & Replace:: Searching and replacing over class tree files
1254* Members in Files:: Listing all members in a given file
1255* Apropos:: Listing members matching a regular expression
1256* Symbol Completion:: Completing names while editing
1257* Member Buffer Display:: Quickly display a member buffer for some
1258 identifier
1259@end menu
1260
1261
1262
1263@node Finding and Viewing, Position Stack, Tags-like Functions, Tags-like Functions
1264@comment node-name, next, previous, up
1265@section Finding and Viewing Members
60a96371
GM
1266@cindex finding class member, in C++ source
1267@cindex viewing class member, in C++ source
2d0600a3 1268@cindex tags
60a96371
GM
1269@cindex member definition, finding, in C++ source
1270@cindex member declaration, finding, in C++ source
1271
1272The functions in this section are similar to those described in
1273@ref{Source Display}, and also in @ref{Finding/Viewing}, except that
1274they work in a C++ source buffer, not in member and tree buffers created
1275by Ebrowse.
2d0600a3
GM
1276
1277@table @kbd
1278@item C-c b f
1279Find the definition of the member around point. If you invoke this
1280function with a prefix argument, the declaration is searched.
1281
1282If more than one class contains a member with the given name you can
1283select the class with completion. If there is a scope declaration in
1284front of the member name, this class name is used as initial input for
1285the completion.
1286
1287@item C-c b F
60a96371 1288Find the declaration of the member around point.
2d0600a3
GM
1289
1290@item C-c b v
1291View the definition of the member around point.
1292
1293@item C-c b V
1294View the declaration of the member around point.
1295
1296@item C-c b 4 f
1297Find a member's definition in another window.
1298
1299@item C-c b 4 F
1300Find a member's declaration in another window.
1301
1302@item C-c b 4 v
1303View a member's definition in another window.
1304
1305@item C-c b 4 V
1306View a member's declaration in another window.
1307
1308@item C-c b 5 f
1309Find a member's definition in another frame.
1310
1311@item C-c b 5 F
1312Find a member's declaration in another frame.
1313
1314@item C-c b 5 v
1315View a member's definition in another frame.
1316
1317@item C-c b 5 V
1318View a member's declaration in another frame.
1319@end table
1320
1321
1322
1323@node Position Stack, Search & Replace, Finding and Viewing, Tags-like Functions
1324@comment node-name, next, previous, up
1325@section The Position Stack
1326@cindex position stack
1327
1328When jumping to a member declaration or definition with one of
1329Ebrowse's commands, the position from where you performed the
1330jump and the position where you jumped to are recorded in a
1331@dfn{position stack}. There are several ways in which you can quickly
1332move to positions in the stack:@refill
1333
1334@table @kbd
60a96371 1335@cindex return to original position
2d0600a3
GM
1336@item C-c b -
1337This command sets point to the previous position in the position stack.
1338Directly after you performed a jump, this will put you back to the
1339position where you came from.
1340
91051870 1341The stack is not popped, i.e.@: you can always switch back and forth
2d0600a3
GM
1342between positions in the stack. To avoid letting the stack grow to
1343infinite size there is a maximum number of positions defined. When this
1344number is reached, older positions are discarded when new positions are
1345pushed on the stack.
1346
1347@item C-c b +
1348This command moves forward in the position stack, setting point to
1349the next position stored in the position stack.
1350
1351@item C-c b p
177c0ea7 1352Displays an electric buffer showing all positions saved in the stack.
91051870 1353You can select a position by pressing @kbd{SPC} in a line. You can
2d0600a3
GM
1354view a position with @kbd{v}.
1355@end table
1356
1357
1358
1359
60a96371 1360@node Search & Replace, Members in Files, Position Stack, Tags-like Functions
2d0600a3
GM
1361@comment node-name, next, previous, up
1362@section Searching and Replacing
60a96371
GM
1363@cindex searching multiple C++ files
1364@cindex replacing in multiple C++ files
2d0600a3
GM
1365@cindex restart tags-operation
1366
1367Ebrowse allows you to perform operations on all or a subset of the files
1368mentioned in a class tree. When you invoke one of the following
1369functions and more than one class tree is loaded, you must choose a
1370class tree to use from an electric tree menu. If the selected tree
1371contains marked classes, the following commands operate on the files
1372mentioned in the marked classes only. Otherwise all files in the class
1373tree are used.
1374
1375@table @kbd
1376@item C-c b s
1377This function performs a regular expression search in the chosen set of
1378files.
1379
1380@item C-c b u
1381This command performs a search for calls of a given member which is
1382selected in the usual way with completion.
1383
1384@item C-c b %
1385Perform a query replace over the set of files.
1386
1387@item C-c b ,
91051870 1388All three operations above stop when finding a match. You can restart
2d0600a3
GM
1389the operation with this command.
1390
1391@item C-c b n
177c0ea7 1392This restarts the last tags operation with the next file in the list.
2d0600a3
GM
1393@end table
1394
1395
1396
1397
1398@node Members in Files, Apropos, Search & Replace, Tags-like Functions
1399@comment node-name, next, previous, up
1400@section Members in Files
1401@cindex files
60a96371
GM
1402@cindex members in file, listing
1403@cindex list class members in a file
2d0600a3
GM
1404@cindex file, members
1405
1406The command @kbd{C-c b l}, lists all members in a given file. The file
1407name is read from the minibuffer with completion.
1408
1409
1410
1411
1412@node Apropos, Symbol Completion, Members in Files, Tags-like Functions
1413@comment node-name, next, previous, up
177c0ea7 1414@section Member Apropos
60a96371 1415@cindex apropos on class members
2d0600a3
GM
1416@cindex members, matching regexp
1417
1418The command @kbd{C-c b a} can be used to display all members matching a
1419given regular expression. This command can be very useful if you
1420remember only part of a member name, and not its beginning.
1421
1422A special buffer is popped up containing all identifiers matching the
91051870 1423regular expression, and what kind of symbol it is (e.g.@: a member
2d0600a3
GM
1424function, or a type). You can then switch to this buffer, and use the
1425command @kbd{C-c b f}, for example, to jump to a specific member.
1426
1427
1428
1429
1430@node Symbol Completion, Member Buffer Display, Apropos, Tags-like Functions
1431@comment node-name, next, previous, up
1432@section Symbol Completion
1433@cindex completion
1434@cindex symbol completion
1435
ee6c21a7 1436The command @kbd{C-c b @key{TAB}} completes the symbol in front of point.
2d0600a3
GM
1437
1438
1439
1440
1441@node Member Buffer Display, , Symbol Completion, Tags-like Functions
1442@section Quick Member Display
60a96371 1443@cindex member buffer, for member at point
2d0600a3
GM
1444
1445You can quickly display a member buffer containing the member the cursor
1446in on with the command @kbd{C-c b m}.
1447
1448
1449@node Concept Index, , Tags-like Functions, Top
1450@unnumbered Concept Index
1451@printindex cp
1452
1453@contents
1454@bye
ab5796a9
MB
1455
1456@ignore
1457 arch-tag: 52fe78ac-a1c4-48e7-815e-0a31acfad4bf
1458@end ignore