1 =========================
2 Use GNU Global in Emacs
3 =========================
5 A package for working with `GNU Global
6 <http://www.gnu.org/software/global>`_ source tagging system in Emacs.
8 This package is part of `GNU ELPA <http://elpa.gnu.org>`_
9 (``M-x list-packages``).
11 Patches, feature requests and bug reports are welcome. Thanks.
16 #. Automatically run ``global -u`` when needed
17 #. Highlight valid tag at point
18 #. Built on top of ``compile.el`` (asynchonrous and other nice
20 #. Support `exuberant ctags <http://ctags.sourceforge.net/>`_ backend.
21 #. Support all output formats of ``global``: ``grep``, ``ctags-x``,
23 #. Abbreviated display of file names
28 The opengrok project composed a feature comparison `table
29 <https://github.com/OpenGrok/OpenGrok/wiki/Comparison-with-Similar-Tools>`_
35 .. figure:: http://i.imgur.com/d430rmm.png
37 :target: http://i.imgur.com/d430rmm.png
43 Enable ``ggtags-mode`` for C/C++/Java modes::
45 (add-hook 'c-mode-common-hook
47 (when (derived-mode-p 'c-mode 'c++-mode 'java-mode)
50 More languages/modes are supported if `GNU Global
51 <http://www.gnu.org/software/global>`_ is compiled with
52 ``--with-exuberant-ctags`` to support `exuberant ctags
53 <http://ctags.sourceforge.net/>`_. Also set the environment variable
54 ``GTAGSCONF`` to the correct location of ``gtags.conf``. For example::
56 export GTAGSCONF=/usr/local/share/gtags/gtags.conf
58 See ``plugin-factory/README`` in GNU Global source for further
64 Type ``M-x ggtags-mode`` to enable the minor mode, or as usual enable
65 it in your desired major mode hooks. When the mode is on the symbol at
66 point is underlined if it is a valid (definition) tag.
68 ``M-.`` finds definitions or references according to the tag at point,
69 i.e. if point is at a definition tag find references and vice versa.
70 ``M-]`` finds references.
72 If multiple matches are found, navigation mode is entered, the
73 mode-line lighter changed, and a navigation menu-bar entry
74 presented. In this mode, ``M-n`` and ``M-p`` moves to next and
75 previous match, ``M-}`` and ``M-{`` to next and previous file
76 respectively. ``M-o`` toggles between full and abbreviated displays of
77 file names in the auxiliary popup window. When you locate the right
78 match, press RET to finish which hides the auxiliary window and exits
79 navigation mode. You can resume the search using ``M-,``. To abort the
82 Normally after a few searches a dozen buffers are created visiting
83 files tracked by GNU Global. ``C-c M-k`` helps clean them up.
85 Check the menu-bar entry ``Ggtags`` for other useful commands.
90 The goal is to make working with GNU Global in Emacs as effortlessly
91 and intuitively as possible.
96 https://github.com/leoliu/ggtags/issues
101 When there is only one match a window is still popped up to be closed
102 immediately due to a `bug <http://debbugs.gnu.org/13594>`_ in