leoliu pushed a commit to branch master in repository elpa. commit 22bca183cd838933690e7bc668886073036d63b9 Author: Leo Liu <sdl....@gmail.com> Date: Thu Mar 6 01:14:09 2014 +0800
Call ggtags-show-definition-function in the original buffer --- ggtags.el | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ggtags.el b/ggtags.el index fd0f195..1ed2846 100644 --- a/ggtags.el +++ b/ggtags.el @@ -1342,23 +1342,27 @@ When finished invoke CALLBACK in BUFFER with process exit status." (defun ggtags-show-definition-default (defs) (let (message-log-max) - (message "%s" (or (caar defs) "[definition not found]")))) + (message "%s%s" (or (caar defs) "[definition not found]") + (if (cdr defs) " [guess]" "")))) (defun ggtags-show-definition (name) (interactive (list (ggtags-read-tag 'definition current-prefix-arg))) (ggtags-check-project) (let* ((re (cadr (assq 'grep ggtags-global-error-regexp-alist-alist))) + (current (current-buffer)) (buffer (get-buffer-create " *ggtags-definition*")) (fn ggtags-show-definition-function) (show (lambda (_status) (goto-char (point-min)) - (funcall fn (loop while (re-search-forward re nil t) + (let ((defs (loop while (re-search-forward re nil t) collect (list (buffer-substring (1+ (match-end 2)) (line-end-position)) name (match-string 1) - (string-to-number (match-string 2))))) - (kill-buffer buffer)))) + (string-to-number (match-string 2)))))) + (kill-buffer buffer) + (with-current-buffer current + (funcall fn defs)))))) (ggtags-global-output buffer (list "global" "--result=grep" "--path-style=absolute" name)