ebrowse.texi 39 KB

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