Created
September 7, 2010 10:22
-
-
Save snikulov/568133 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; from here http://www.emacswiki.org/emacs/CyclingGTagsResult | |
(require 'gtags) | |
(defun ww-next-gtag () | |
"Find next matching tag, for GTAGS." | |
(interactive) | |
(let ((latest-gtags-buffer | |
(car (delq nil (mapcar (lambda (x) (and (string-match "GTAGS SELECT" (buffer-name x)) (buffer-name x)) ) | |
(buffer-list)) )))) | |
(cond (latest-gtags-buffer | |
(switch-to-buffer latest-gtags-buffer) | |
(next-line) | |
(gtags-select-it nil)) | |
) )) | |
;;; Here’s my key binding for using GNU Global. | |
(global-set-key "\M-;" 'ww-next-gtag) ;; M-; cycles to next result, after doing M-. C-M-. or C-M-, | |
(global-set-key "\M-." 'gtags-find-tag) ;; M-. finds tag | |
(global-set-key [(control meta .)] 'gtags-find-rtag) ;; C-M-. find all references of tag | |
(global-set-key [(control meta ,)] 'gtags-find-symbol) ;; C-M-, find all usages of symbol. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment