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