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