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