]> code.delx.au - gnu-emacs-elpa/commitdiff
* ggtags.el: Release v0.6.3
authorLeo Liu <sdl.web@gmail.com>
Thu, 28 Mar 2013 02:53:02 +0000 (10:53 +0800)
committerLeo Liu <sdl.web@gmail.com>
Thu, 28 Mar 2013 02:53:02 +0000 (10:53 +0800)
- handle buffers not visiting files more gracefully
- give higher priority to ggtags-navigation-mode
  or modes such as view-mode may shadow its key bindings.

packages/ggtags/README [deleted file]
packages/ggtags/ggtags.el

diff --git a/packages/ggtags/README b/packages/ggtags/README
deleted file mode 100644 (file)
index 04347c0..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-Type `M-x ggtags-mode' to enable the minor mode, or as usual enable it
-in your desired major mode hooks. When the mode is on the symbol at
-point is underlined if it is a valid tag.
-
-`M-.' finds definitions or references according to the tag at point,
-i.e. if point is at a definition tag find references and vice versa.
-`C-u M-.' is verbose and will ask you the name - with completion - and
-the type of tag to search.
-
-If multiple matches are found, navigation mode is entered. In this
-mode, `M-n' and `M-p' moves to next and previous match, `M-}' and
-`M-{' to next and previous file respectively. `M-o' toggles between
-full and abbreviated displays of file names in the auxiliary popup
-window. When you locate the right match, press RET to finish which
-hides the auxiliary window and exits navigation mode. You can resume
-the search using `M-,'. To abort the search press `M-*'.
-
-Normally after a few searches a dozen buffers are created visiting
-files tracked by GNU Global. `C-c M-k' helps clean them up.
-
-Bugs:
-https://github.com/leoliu/ggtags/issues
index a646edf34f738f9fbb66a132a47d92f2d8c67014..4d8671b6bd763050bd4ac4814e0c2477641083d0 100644 (file)
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2013  Free Software Foundation, Inc.
 
 ;; Author: Leo Liu <sdl.web@gmail.com>
-;; Version: 0.6.2
+;; Version: 0.6.3
 ;; Keywords: tools, convenience
 ;; Created: 2013-01-29
 ;; URL: https://github.com/leoliu/ggtags
 
 ;;; Commentary:
 
-;; Use GNU Global source code tagging system in Emacs.
-;; http://www.gnu.org/software/global
+;; A package to integrate GNU Global source code tagging system
+;; (http://www.gnu.org/software/global) with Emacs.
+;;
+;; Usage:
+;;
+;; Type `M-x ggtags-mode' to enable the minor mode, or as usual enable
+;; it in your desired major mode hooks. When the mode is on the symbol
+;; at point is underlined if it is a valid (definition) tag.
+;;
+;; `M-.' finds definition or references according to the context at
+;; point, i.e. if point is at a definition tag find references and
+;; vice versa. `C-u M-.' is verbose and will ask you the name - with
+;; completion - and the type of tag to search.
+;;
+;; If multiple matches are found, navigation mode is entered. In this
+;; mode, `M-n' and `M-p' moves to next and previous match, `M-}' and
+;; `M-{' to next and previous file respectively. `M-o' toggles between
+;; full and abbreviated displays of file names in the auxiliary popup
+;; window. When you locate the right match, press RET to finish which
+;; hides the auxiliary window and exits navigation mode. You can
+;; resume the search using `M-,'. To abort the search press `M-*'.
+;;
+;; Normally after a few searches a dozen buffers are created visiting
+;; files tracked by GNU Global. `C-c M-k' helps clean them up.
 
 ;;; Code:
 
@@ -217,10 +239,10 @@ When called with prefix, ask the name and kind of tag."
          (lambda (w) (split-window (frame-root-window w))))
         (default-directory (ggtags-root-directory)))
     (compilation-start
-     (if verbose
+     (if (or verbose (not buffer-file-name))
          (format "global %s %s \"%s\""
                  ggtags-global-options
-                 (if (y-or-n-p "Kind (y for definition n for reference)? ")
+                 (if (y-or-n-p "Find definition (n for reference)? ")
                      "" "-r")
                  name)
        (format "global %s --from-here=%d:%s \"%s\""
@@ -457,8 +479,9 @@ When called with prefix, ask the name and kind of tag."
   (if ggtags-mode
       (progn
         (add-hook 'after-save-hook 'ggtags-after-save-function nil t)
-        (when (executable-find "global")
-          (add-hook 'post-command-hook 'ggtags-post-command-function nil t)))
+        (if (executable-find "global")
+            (add-hook 'post-command-hook 'ggtags-post-command-function nil t)
+          (message "Failed to find GNU Global")))
     (remove-hook 'after-save-hook 'ggtags-after-save-function t)
     (remove-hook 'post-command-hook 'ggtags-post-command-function t)
     (and (overlayp ggtags-tag-overlay)
@@ -514,5 +537,14 @@ When called with prefix, ask the name and kind of tag."
       (setq he-expand-list (cdr he-expand-list))
       t)))
 
+;;; Finish up
+
+;; Higher priority for `ggtags-navigation-mode' to avoid being
+;; hijacked by modes such as `view-mode'.
+(defvar ggtags-mode-map-alist
+  `((ggtags-navigation-mode . ,ggtags-navigation-mode-map)))
+
+(add-to-list 'emulation-mode-map-alists 'ggtags-mode-map-alist)
+
 (provide 'ggtags)
 ;;; ggtags.el ends here