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