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