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