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