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