src/xdisp.c (single_display_spec_string): Correct a FIXME comment.
[emacs.git] / doc / misc / ebrowse.texi
blob19ee9705484463f54452b0ce384fd7eb8c015990
1 \input texinfo   @c -*-texinfo-*-
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
10 @copying
11 This file documents Ebrowse, a C++ class browser for GNU Emacs.
13 Copyright @copyright{} 2000-2011  Free Software Foundation, Inc.
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''.
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
29 @dircategory Emacs misc features
30 @direntry
31 * Ebrowse: (ebrowse).           A C++ class browser for Emacs.
32 @end direntry
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
45 @contents
47 @ifnottex
48 @node Top, Overview, (dir), (dir)
49 @top Ebrowse
51 You can browse C++ class hierarchies from within Emacs by using
52 Ebrowse.
54 @insertcopying
55 @end ifnottex
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
71 @node Overview, Generating browser files, Top, Top
72 @chapter Introduction
74 When working in software projects using C++, I frequently missed
75 software support for two things:
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.
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
93 The design of Ebrowse reflects these two needs.
95 How does it work?
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.
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.
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:
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}.
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:
123 @itemize @bullet
124 @item
125 Instance member variables;
127 @item
128 Instance member functions;
130 @item
131 Static member variables;
133 @item
134 Static member functions;
136 @item
137 Friends/Defines.  The list of defines is contained in the friends
138 list of the pseudo-class @samp{*Globals*};
140 @item
141 Types (@code{enum}s, and @code{typedef}s defined with class
142 scope).@refill
143 @end itemize
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}.
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.
157 To list just a subset of what you can use the Tags part of Ebrowse for:
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.
165 @item
166 Complete identifiers in your source with a completion list containing
167 identifiers from your source code only.
169 @item
170 Perform search and query replace operations over some or all of your
171 source files.
173 @item
174 Show all identifiers matching a regular expression---and jump to one of
175 them, if you like.
176 @end itemize
181 @node Generating browser files, Loading a Tree, Overview, Top
182 @comment node-name,  next,  previous,  up
183 @chapter Processing Source Files
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.
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:
197 @example
198 ebrowse *.h *.cc
199 @end example
201 @noindent
202 or, if your shell doesn't allow all the file names to be specified on
203 the command line,
205 @example
206 ebrowse --files=@var{file}
207 @end example
209 @noindent
210 where @var{file} contains the names of the files to be parsed, one
211 per line.
213 @findex --help
214 When invoked with option @samp{--help}, @command{ebrowse} prints a list of
215 available command line options.@refill
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
228 @comment name,     next,        prev,                     up
229 @node Input files, Output file, Generating browser files, Generating browser files
230 @section Specifying Input Files
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.
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.
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.
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
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.
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
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.
282 If you regularly use data base names different from the default, you
283 might want to add this to your init file:
285 @lisp
286 (add-to-list 'auto-mode-alist '(@var{NAME} . ebrowse-tree-mode))
287 @end lisp
289 @noindent
290 where @var{NAME} is the Lisp data base name you are using.
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
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
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.
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
324 @comment name,  next,      prev,               up
325 @node Matching, Verbosity, Structs and unions, Generating browser files
326 @section Regular Expressions
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.
333 You can instruct @command{ebrowse} to omit these regular expressions by
334 calling it with the command line switch @samp{--no-regexps}.
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.
342 @table @samp
343 @findex --no-regexps
344 @item --no-regexps
345 This option turns off regular expression recording.
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}.
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.
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}.
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
378 @node Verbosity, , Matching, Generating browser files
379 @comment  node-name,  next,  previous,  up
380 @section Verbose Mode
381 @cindex verbose operation
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.
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
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
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}.
408 An example of a tree buffer display is shown below.
410 @example
411 |  Collection
412 |    IndexedCollection
413 |      Array
414 |        FixedArray
415 |    Set
416 |    Dictionary
417 @end example
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.
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.
434 @comment ****************************************************************
435 @comment ***
436 @comment ***                 TREE BUFFERS
437 @comment ***
438 @comment ****************************************************************
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
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}.
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.
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
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
479 You can view or find a class declaration when the cursor is on a class
480 name.
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
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
495 The same functionality is available from the menu opened with
496 @kbd{Mouse-3} on the class name.
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
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.
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.
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.
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}.
531 @table @kbd
532 @cindex instance member variables, list
533 @item L v
534 This command displays the list of instance member variables.
536 @cindex static variables, list
537 @item L V
538 Display the list of static variables.
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.
546 @cindex member functions, list
547 @item L f
548 Display the list of member functions.
550 @cindex static member functions, list
551 @item L F
552 Display the list of static member functions.
554 @cindex types, list
555 @item L t
556 Display a list of types.
557 @end table
559 These lists are also available from the class' context menu invoked with
560 @kbd{Mouse-3} on the class name.
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
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.
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
583 This function is also available from the tree buffer's context menu.
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
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
598 @table @kbd
599 @item q
600 Is a synonym for @kbd{M-x bury-buffer}.
601 @end table
606 @node File Name Display, Expanding and Collapsing, Quitting, Tree Buffers
607 @comment  node-name,  next,  previous,  up
608 @section Displaying File Names
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.
618 This command is also provided in the tree buffer's context menu.
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
625 Here is an example of a tree buffer with file names displayed.
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
637 @node Expanding and Collapsing, Tree Indentation, File Name Display, Tree Buffers
638 @comment  node-name,  next,  previous,  up
639 @section Expanding and Collapsing a Tree
640 @cindex expand tree branch
641 @cindex collapse tree branch
642 @cindex branches of class tree
643 @cindex class tree, collapse or expand
645 You can expand and collapse parts of a tree to reduce the complexity of
646 large class hierarchies.  Expanding or collapsing branches of a tree has
647 no impact on the functionality of other commands, like @kbd{/}.  (See
648 also @ref{Go to Class}.)@refill
650 Collapsed branches are indicated with an ellipsis following the class
651 name like in the example below.
653 @example
654 |  Collection
655 |    IndexedCollection...
656 |    Set
657 |    Dictionary
658 @end example
660 @table @kbd
661 @item -
662 This command collapses the branch of the tree starting at the class the
663 cursor is on.
665 @item +
666 This command expands the branch of the tree starting at the class the
667 cursor is on.  Both commands for collapsing and expanding branches are
668 also available from the class' object menu.
670 @item *
671 This command expands all collapsed branches in the tree.
672 @end table
677 @node Tree Indentation, Killing Classes, Expanding and Collapsing, Tree Buffers
678 @comment  node-name,  next,  previous,  up
679 @section Changing the Tree Indentation
680 @cindex tree indentation
681 @cindex indentation of the tree
683 @table @kbd
684 @item T w
685 This command reads a new indentation width from the minibuffer and
686 redisplays the tree buffer with the new indentation  It is also
687 available from the tree buffer's context menu.
688 @end table
693 @node Killing Classes, Saving a Tree, Tree Indentation, Tree Buffers
694 @comment  node-name,  next,  previous,  up
695 @section Removing Classes from the Tree
696 @cindex killing classes
697 @cindex class, remove from tree
699 @table @kbd
700 @item C-k
701 This command removes the class the cursor is on and all its derived
702 classes from the tree.  The user is asked for confirmation before the
703 deletion is actually performed.
704 @end table
709 @node Saving a Tree, Statistics, Killing Classes, Tree Buffers
710 @comment  node-name,  next,  previous,  up
711 @comment node-name, next, previous, up
712 @section Saving a Tree
713 @cindex save tree to a file
714 @cindex tree, save to a file
715 @cindex class tree, save to a file
717 @table @kbd
718 @item C-x C-s
719 This command writes a class tree to the file from which it was read.
720 This is useful after classes have been deleted from a tree.
722 @item  C-x C-w
723 Writes the tree to a file whose name is read from the minibuffer.
724 @end table
729 @node     Statistics, Marking Classes, Saving a Tree, Tree Buffers
730 @comment  node-name,  next,        previous, up
731 @cindex statistics for a tree
732 @cindex tree statistics
733 @cindex class statistics
735 @table @kbd
736 @item x
737 Display statistics for the tree, like number of classes in it, number of
738 member functions, etc.  This command can also be found in the buffer's
739 context menu.
740 @end table
745 @node     Marking Classes, , Statistics, Tree Buffers
746 @comment  node-name,       next,       previous,      up
747 @cindex marking classes
748 @cindex operations on marked classes
750 Classes can be marked for operations similar to the standard Emacs
751 commands @kbd{M-x tags-search} and @kbd{M-x tags-query-replace} (see
752 also @xref{Tags-like Functions}.)@refill
754 @table @kbd
755 @cindex toggle mark
756 @item M t
757 Toggle the mark of the line point is in or for as many lines as given by
758 a prefix command.  This command can also be found in the class' context
759 menu.
761 @cindex unmark all
762 @item M a
763 Unmark all classes.  With prefix argument @kbd{C-u}, mark all classes in
764 the tree. Since this command operates on the whole buffer, it can also be
765 found in the buffer's object menu.
766 @end table
768 Marked classes are displayed with an @code{>} in column one of the tree
769 display, like in the following example
771 @example
772 |> Collection
773 |    IndexedCollection...
774 |>   Set
775 |    Dictionary
776 @end example
781 @c ****************************************************************
782 @c ***
783 @c ***                 MEMBER BUFFERS
784 @c ***
785 @c ****************************************************************
787 @node Member Buffers, Tags-like Functions, Tree Buffers, Top
788 @comment  node-name,       next,       previous,      up
789 @chapter Member Buffers
790 @cindex members
791 @cindex member buffer mode
793 @cindex class members, types
794 @cindex types of class members
795 @dfn{Member buffers} are used to operate on lists of members of a class.
796 Ebrowse distinguishes six kinds of lists:
798 @itemize @bullet
799 @item
800 Instance variables (normal member variables);
801 @item
802 Instance functions (normal member functions);
803 @item
804 Static variables;
805 @item
806 Static member functions;
807 @item
808 Friend functions;
809 @item
810 Types (@code{enum}s and @code{typedef}s defined with class scope.
811 Nested classes will be shown in the class tree like normal classes.
812 @end itemize
814 Like tree buffers, member buffers install their own major mode.  Also
815 like in tree buffers, menus are provided for certain areas in the
816 buffer: members, classes, and the buffer itself.
818 @menu
819 * Switching Member Lists::      Choosing which members to display
820 * Finding/Viewing::             Modifying source code
821 * Inherited Members::           Display of Inherited Members
822 * Searching Members::           Finding members in member buffer
823 * Switching to Tree::           Going back to the tree buffer
824 * Filters::                     Selective member display
825 * Attributes::                  Display of @code{virtual} etc.
826 * Long and Short Display::      Comprehensive and verbose display
827 * Regexp Display::              Showing matching regular expressions
828 * Switching Classes::           Displaying another class
829 * Killing/Burying::             Getting rid of the member buffer
830 * Column Width::                Display style
831 * Redisplay::                   Redrawing the member list
832 * Getting Help::                How to get help for key bindings
833 @end menu
838 @node Switching Member Lists, Finding/Viewing, Member Buffers, Member Buffers
839 @comment  node-name,       next,       previous,      up
840 @section Switching Member Lists
841 @cindex member lists, in member buffers
842 @cindex static members
843 @cindex friends
844 @cindex types
845 @cindex defines
847 @table @kbd
848 @cindex next member list
849 @item L n
850 This command switches the member buffer display to the next member list.
852 @cindex previous member list
853 @item L p
854 This command switches the member buffer display to the previous member
855 list.
857 @item L f
858 Switch to the list of member functions.
860 @cindex static
861 @item L F
862 Switch to the list of static member functions.
864 @item L v
865 Switch to the list of member variables.
867 @item L V
868 Switch to the list of static member variables.
870 @item L d
871 Switch to the list of friends or defines.
873 @item L t
874 Switch to the list of types.
875 @end table
877 Both commands cycle through the member list.
879 Most of the commands are also available from the member buffer's
880 context menu.
885 @node Finding/Viewing, Inherited Members, Switching Member Lists, Member Buffers
886 @comment  node-name,       next,       previous,      up
887 @section Finding and Viewing Member Source
888 @cindex finding members, in member buffers
889 @cindex viewing members, in member buffers
890 @cindex member definitions, in member buffers
891 @cindex member declarations, in member buffers
892 @cindex definition of a member, in member buffers
893 @cindex declaration of a member, in member buffers
895 @table @kbd
896 @item RET
897 This command finds the definition of the member the cursor is on.
898 Finding involves roughly the same as the standard Emacs tags facility
899 does---loading the file and searching for a regular expression matching
900 the member.
902 @item f
903 This command finds the declaration of the member the cursor is on.
905 @item SPC
906 This is the same command as @kbd{RET}, but views the member definition
907 instead of finding the member's source file.
909 @item v
910 This is the same command as @kbd{f}, but views the member's declaration
911 instead of finding the file the declaration is in.
912 @end table
914 You can install a hook function to perform actions after a member or
915 class declaration or definition has been found, or when it is not found.
917 All the commands described above can also be found in the context menu
918 displayed when clicking @kbd{Mouse-2} on a member name.
923 @node Inherited Members, Searching Members, Finding/Viewing, Member Buffers
924 @comment  node-name,       next,       previous,      up
925 @section Display of Inherited Members
926 @cindex superclasses, members
927 @cindex base classes, members
928 @cindex inherited members
930 @table @kbd
931 @item D b
932 This command toggles the display of inherited members in the member
933 buffer.  This is also in the buffer's context menu.
934 @end table
939 @node Searching Members, Switching to Tree, Inherited Members, Member Buffers
940 @comment  node-name,       next,       previous,      up
941 @section Searching Members
942 @cindex searching members
944 @table @kbd
945 @item G v
946 Position the cursor on a member whose name is read from the minibuffer;
947 only members shown in the current member buffer appear in the completion
948 list.
950 @item G m
951 Like the above command, but all members for the current class appear in
952 the completion list.  If necessary, the current member list is switched
953 to the one containing the member.
955 With a prefix argument (@kbd{C-u}), all members in the class tree,
956 i.e.@: all members the browser knows about appear in the completion
957 list.  The member display will be switched to the class and member list
958 containing the member.
960 @item G n
961 Repeat the last member search.
962 @end table
964 Look into the buffer's context menu for a convenient way to do this with
965 a mouse.
969 @node Switching to Tree, Filters, Searching Members, Member Buffers
970 @comment  node-name,       next,       previous,      up
971 @section Switching to Tree Buffer
972 @cindex tree buffer, switch to
973 @cindex buffer switching
974 @cindex switching buffers
976 @table @kbd
977 @item @key{TAB}
978 Pop up the tree buffer to which the member buffer belongs.
980 @item t
981 Do the same as @key{TAB} but also position the cursor on the class
982 displayed in the member buffer.
983 @end table
988 @node Filters, Attributes, Switching to Tree, Member Buffers
989 @comment  node-name,       next,       previous,      up
990 @section Filters
991 @cindex filters
993 @table @kbd
994 @cindex @code{public} members
995 @item F a u
996 This command toggles the display of @code{public} members.  The
997 @samp{a} stands for `access'.
999 @cindex @code{protected} members
1000 @item F a o
1001 This command toggles the display of @code{protected} members.
1003 @cindex @code{private} members
1004 @item F a i
1005 This command toggles the display of @code{private} members.
1007 @cindex @code{virtual} members
1008 @item F v
1009 This command toggles the display of @code{virtual} members.
1011 @cindex @code{inline} members
1012 @item F i
1013 This command toggles the display of @code{inline} members.
1015 @cindex @code{const} members
1016 @item F c
1017 This command toggles the display of @code{const} members.
1019 @cindex pure virtual members
1020 @item F p
1021 This command toggles the display of pure virtual members.
1023 @cindex remove filters
1024 @item F r
1025 This command removes all filters.
1026 @end table
1028 These commands are also found in the buffer's context menu.
1033 @node Attributes, Long and Short Display, Filters, Member Buffers
1034 @comment  node-name,       next,       previous,      up
1035 @section Displaying Member Attributes
1036 @cindex attributes
1037 @cindex member attribute display
1039 @table @kbd
1040 @item D a
1041 Toggle the display of member attributes (default is on).
1043 The nine member attributes Ebrowse knows about are displayed
1044 as a list a single-characters flags enclosed in angle brackets in front
1045 the of the member's name.  A @samp{-} at a given position means that
1046 the attribute is false.  The list of attributes from left to right is
1048 @table @samp
1049 @cindex @code{template} attribute
1050 @item T
1051 The member is a template.
1053 @cindex @code{extern "C"} attribute
1054 @item C
1055 The member is declared @code{extern "C"}.
1057 @cindex @code{virtual} attribute
1058 @item v
1059 Means the member is declared @code{virtual}.
1061 @cindex @code{inline}
1062 @item i
1063 The member is declared @code{inline}.
1065 @cindex @code{const} attribute
1066 @item c
1067 The member is @code{const}.
1069 @cindex pure virtual function attribute
1070 @item 0
1071 The member is a pure virtual function.
1073 @cindex @code{mutable} attribute
1074 @item m
1075 The member is declared @code{mutable}.
1077 @cindex @code{explicit} attribute
1078 @item e
1079 The member is declared @code{explicit}.
1081 @item t
1082 The member is a function with a throw list.
1083 @end table
1084 @end table
1086 This command is also in the buffer's context menu.
1090 @node Long and Short Display, Regexp Display, Attributes, Member Buffers
1091 @comment  node-name,       next,       previous,      up
1092 @section Long and Short Member Display
1093 @cindex display form
1094 @cindex long display
1095 @cindex short display
1097 @table @kbd
1098 @item D l
1099 This command toggles the member buffer between short and long display
1100 form.  The short display form displays member names, only:
1102 @example
1103 | isEmpty        contains       hasMember      create
1104 | storeSize      hash           isEqual        restoreGuts
1105 | saveGuts
1106 @end example
1108 The long display shows one member per line with member name and regular
1109 expressions matching the member (if known):
1111 @example
1112 | isEmpty               Bool isEmpty () const...
1113 | hash                  unsigned hash () const...
1114 | isEqual               int isEqual (...
1115 @end example
1117 Regular expressions will only be displayed when the Lisp database has
1118 not been produced with the @command{ebrowse} option @samp{--no-regexps}.
1119 @xref{Matching, --no-regexps, Regular Expressions}.
1120 @end table
1125 @node Regexp Display, Switching Classes, Long and Short Display, Member Buffers
1126 @comment  node-name,       next,       previous,      up
1127 @section Display of Regular Expressions
1128 @cindex regular expression display
1130 @table @kbd
1131 @item D r
1132 This command toggles the long display form from displaying the regular
1133 expressions matching the member declarations to those expressions
1134 matching member definitions.
1135 @end table
1137 Regular expressions will only be displayed when the Lisp database has
1138 not been produced with the @command{ebrowse} option @samp{--no-regexps},
1139 see @ref{Matching, --no-regexps, Regular Expressions}.
1144 @node Switching Classes, Killing/Burying, Regexp Display, Member Buffers
1145 @comment  node-name,       next,       previous,      up
1146 @section Displaying Another Class
1147 @cindex base class, display
1148 @cindex derived class, display
1149 @cindex superclass, display
1150 @cindex subclass, display
1151 @cindex class display
1153 @table @kbd
1154 @item C c
1155 This command lets you switch the member buffer to another class.  It
1156 reads the name of the new class from the minibuffer with completion.
1158 @item C b
1159 This is the same command as @kbd{C c} but restricts the classes shown in
1160 the completion list to immediate base classes, only.  If only one base
1161 class exists, this one is immediately shown in the minibuffer.
1163 @item C d
1164 Same as @kbd{C b}, but for derived classes.
1166 @item C p
1167 Switch to the previous class in the class hierarchy on the same level as
1168 the class currently displayed.
1170 @item C n
1171 Switch to the next sibling of the class in the class tree.
1172 @end table
1177 @node Killing/Burying, Column Width, Switching Classes, Member Buffers
1178 @comment  node-name,       next,       previous,      up
1179 @section Burying a Member Buffer
1180 @cindex burying member buffers
1182 @table @kbd
1183 @item q
1184 This command is a synonym for @kbd{M-x bury-buffer}.
1185 @end table
1190 @node Column Width, Redisplay, Killing/Burying, Member Buffers
1191 @comment  node-name,       next,       previous,      up
1192 @section Setting the Column Width
1193 @cindex column width
1194 @cindex member indentation
1195 @cindex indentation, member
1197 @table @kbd
1198 @item D w
1199 This command sets the column width depending on the display form used
1200 (long or short display).
1201 @end table
1206 @node Redisplay, Getting Help, Column Width, Member Buffers
1207 @comment  node-name,       next,       previous,      up
1208 @section Forced Redisplay
1209 @cindex redisplay of member buffers
1211 @table @kbd
1212 @item C-l
1213 This command forces a redisplay of the member buffer.  If the width
1214 of the window displaying the member buffer is changed this command
1215 redraws the member list with the appropriate column widths and number of
1216 columns.
1217 @end table
1222 @node Getting Help, , Redisplay, Member Buffers
1223 @comment  node-name,  next,  previous,  up
1224 @cindex help
1226 @table @kbd
1227 @item ?
1228 This key is bound to @code{describe-mode}.
1229 @end table
1234 @comment **************************************************************
1235 @comment ***                TAGS LIKE FUNCTIONS
1236 @comment **************************************************************
1238 @node Tags-like Functions, GNU Free Documentation License, Member Buffers, Top
1239 @comment  node-name,       next,       previous,      up
1240 @chapter Tags-like Functions
1242 Ebrowse provides tags functions similar to those of the standard
1243 Emacs Tags facility, but better suited to the needs of C++ programmers.
1245 @menu
1246 * Finding and Viewing::   Going to a member declaration/definition
1247 * Position Stack::        Moving to previous locations
1248 * Search & Replace::      Searching and replacing over class tree files
1249 * Members in Files::      Listing all members in a given file
1250 * Apropos::               Listing members matching a regular expression
1251 * Symbol Completion::     Completing names while editing
1252 * Member Buffer Display:: Quickly display a member buffer for some
1253                             identifier
1254 @end menu
1258 @node Finding and Viewing, Position Stack, Tags-like Functions, Tags-like Functions
1259 @comment  node-name,       next,       previous,      up
1260 @section Finding and Viewing Members
1261 @cindex finding class member, in C++ source
1262 @cindex viewing class member, in C++ source
1263 @cindex tags
1264 @cindex member definition, finding, in C++ source
1265 @cindex member declaration, finding, in C++ source
1267 The functions in this section are similar to those described in
1268 @ref{Source Display}, and also in @ref{Finding/Viewing}, except that
1269 they work in a C++ source buffer, not in member and tree buffers created
1270 by Ebrowse.
1272 @table @kbd
1273 @item C-c C-m f
1274 Find the definition of the member around point.  If you invoke this
1275 function with a prefix argument, the declaration is searched.
1277 If more than one class contains a member with the given name you can
1278 select the class with completion.  If there is a scope declaration in
1279 front of the member name, this class name is used as initial input for
1280 the completion.
1282 @item C-c C-m F
1283 Find the declaration of the member around point.
1285 @item C-c C-m v
1286 View the definition of the member around point.
1288 @item C-c C-m V
1289 View the declaration of the member around point.
1291 @item C-c C-m 4 f
1292 Find a member's definition in another window.
1294 @item C-c C-m 4 F
1295 Find a member's declaration in another window.
1297 @item C-c C-m 4 v
1298 View a member's definition in another window.
1300 @item C-c C-m 4 V
1301 View a member's declaration in another window.
1303 @item C-c C-m 5 f
1304 Find a member's definition in another frame.
1306 @item C-c C-m 5 F
1307 Find a member's declaration in another frame.
1309 @item C-c C-m 5 v
1310 View a member's definition in another frame.
1312 @item C-c C-m 5 V
1313 View a member's declaration in another frame.
1314 @end table
1318 @node Position Stack, Search & Replace, Finding and Viewing, Tags-like Functions
1319 @comment  node-name,       next,       previous,      up
1320 @section The Position Stack
1321 @cindex position stack
1323 When jumping to a member declaration or definition with one of
1324 Ebrowse's commands, the position from where you performed the
1325 jump and the position where you jumped to are recorded in a
1326 @dfn{position stack}.  There are several ways in which you can quickly
1327 move to positions in the stack:@refill
1329 @table @kbd
1330 @cindex return to original position
1331 @item C-c C-m -
1332 This command sets point to the previous position in the position stack.
1333 Directly after you performed a jump, this will put you back to the
1334 position where you came from.
1336 The stack is not popped, i.e.@: you can always switch back and forth
1337 between positions in the stack.  To avoid letting the stack grow to
1338 infinite size there is a maximum number of positions defined.  When this
1339 number is reached, older positions are discarded when new positions are
1340 pushed on the stack.
1342 @item C-c C-m +
1343 This command moves forward in the position stack, setting point to
1344 the next position stored in the position stack.
1346 @item C-c C-m p
1347 Displays an electric buffer showing all positions saved in the stack.
1348 You can select a position by pressing @kbd{SPC} in a line.  You can
1349 view a position with @kbd{v}.
1350 @end table
1355 @node Search & Replace, Members in Files, Position Stack, Tags-like Functions
1356 @comment  node-name,       next,       previous,      up
1357 @section Searching and Replacing
1358 @cindex searching multiple C++ files
1359 @cindex replacing in multiple C++ files
1360 @cindex restart tags-operation
1362 Ebrowse allows you to perform operations on all or a subset of the files
1363 mentioned in a class tree.  When you invoke one of the following
1364 functions and more than one class tree is loaded, you must choose a
1365 class tree to use from an electric tree menu.  If the selected tree
1366 contains marked classes, the following commands operate on the files
1367 mentioned in the marked classes only.  Otherwise all files in the class
1368 tree are used.
1370 @table @kbd
1371 @item C-c C-m s
1372 This function performs a regular expression search in the chosen set of
1373 files.
1375 @item C-c C-m u
1376 This command performs a search for calls of a given member which is
1377 selected in the usual way with completion.
1379 @item C-c C-m %
1380 Perform a query replace over the set of files.
1382 @item C-c C-m ,
1383 All three operations above stop when finding a match.  You can restart
1384 the operation with this command.
1386 @item C-c C-m n
1387 This restarts the last tags operation with the next file in the list.
1388 @end table
1393 @node Members in Files, Apropos, Search & Replace, Tags-like Functions
1394 @comment  node-name,       next,       previous,      up
1395 @section Members in Files
1396 @cindex files
1397 @cindex members in file, listing
1398 @cindex list class members in a file
1399 @cindex file, members
1401 The command @kbd{C-c C-m l}, lists all members in a given file.  The file
1402 name is read from the minibuffer with completion.
1407 @node Apropos, Symbol Completion, Members in Files, Tags-like Functions
1408 @comment  node-name,       next,       previous,      up
1409 @section Member Apropos
1410 @cindex apropos on class members
1411 @cindex members, matching regexp
1413 The command @kbd{C-c C-m a} can be used to display all members matching a
1414 given regular expression.  This command can be very useful if you
1415 remember only part of a member name, and not its beginning.
1417 A special buffer is popped up containing all identifiers matching the
1418 regular expression, and what kind of symbol it is (e.g.@: a member
1419 function, or a type).  You can then switch to this buffer, and use the
1420 command @kbd{C-c C-m f}, for example, to jump to a specific member.
1425 @node Symbol Completion, Member Buffer Display, Apropos, Tags-like Functions
1426 @comment  node-name,       next,       previous,      up
1427 @section Symbol Completion
1428 @cindex completion
1429 @cindex symbol completion
1431 The command @kbd{C-c C-m @key{TAB}} completes the symbol in front of point.
1436 @node Member Buffer Display, , Symbol Completion, Tags-like Functions
1437 @section Quick Member Display
1438 @cindex member buffer, for member at point
1440 You can quickly display a member buffer containing the member the cursor
1441 in on with the command @kbd{C-c C-m m}.
1444 @node GNU Free Documentation License, Concept Index, Tags-like Functions, Top
1445 @appendix GNU Free Documentation License
1446 @include doclicense.texi
1449 @node Concept Index, , GNU Free Documentation License, Top
1450 @unnumbered Concept Index
1451 @printindex cp
1453 @bye