leoliu pushed a commit to branch master in repository elpa. commit 7b196dd8982326438def26a2886cb3822c37d969 Author: Leo Liu <sdl....@gmail.com> Date: Fri May 16 12:03:45 2014 +0800
New command ggtags-find-definition for #57 --- README.rst | 16 +++++++++++++--- ggtags.el | 7 ++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 794e1cc..1c316ee 100644 --- a/README.rst +++ b/README.rst @@ -118,14 +118,23 @@ ggtags-find-tag-dwim To force finding a definition tag, call it with a prefix (``C-u``). -ggtags-find-reference +ggtags-find-tag-mouse + + Like ``ggtags-find-tag-dwim`` but suitable for binding to mouse + events. + +ggtags-find-definition - Find references to a tag. With ``C-u`` ask for the tag name with + Find definition tags. With ``C-u`` ask for the tag name with completion. +ggtags-find-reference + + Find reference tags. With ``C-u`` ask for the tag name with completion. + ggtags-find-other-symbol - Find a tag that has no definition. With ``C-u`` ask for the tag + Find tags that have no definitions. With ``C-u`` ask for the tag name with completion. ggtags-find-tag-regexp @@ -289,6 +298,7 @@ NEWS +++++++++++++ #. New command ``ggtags-find-tag-mouse`` for mouse support. +#. New command ``ggtags-find-definition``. #. Variable ``ggtags-completing-read-function`` restored. [2014-05-06 Tue] 0.8.4 diff --git a/ggtags.el b/ggtags.el index 97ba132..b78384f 100644 --- a/ggtags.el +++ b/ggtags.el @@ -894,7 +894,7 @@ definition tags." (not buffer-file-name) (not (ggtags-project-has-refs (ggtags-find-project))) (not (ggtags-project-file-p buffer-file-name))) - (ggtags-find-tag 'definition (shell-quote-argument name))) + (ggtags-find-definition name)) (t (ggtags-find-tag (format "--from-here=%d:%s" (line-number-at-pos) (shell-quote-argument @@ -910,6 +910,11 @@ definition tags." (goto-char (posn-point (event-start event))) (call-interactively #'ggtags-find-tag-dwim)))) +;; Another option for `M-.'. +(defun ggtags-find-definition (name) + (interactive (list (ggtags-read-tag 'definition current-prefix-arg))) + (ggtags-find-tag 'definition (shell-quote-argument name))) + (defun ggtags-setup-libpath-search (type name) (pcase (and ggtags-global-search-libpath-for-reference (ggtags-get-libpath))