[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 09/18: Fix multiple calls of ggtags-show-definition
From: |
Leo Liu |
Subject: |
[elpa] 09/18: Fix multiple calls of ggtags-show-definition |
Date: |
Sat, 05 Apr 2014 01:25:16 +0000 |
leoliu pushed a commit to branch master
in repository elpa.
commit c091f9971116f53c104c2b251d421e114b471c2d
Author: Leo Liu <address@hidden>
Date: Wed Apr 2 11:10:10 2014 +0800
Fix multiple calls of ggtags-show-definition
and misuse of pcase equality in ggtags-eldoc-function.
Fix ggtags-global-output to notice the problem of running multiple
processes.
---
ggtags.el | 28 +++++++++++++++++-----------
1 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/ggtags.el b/ggtags.el
index 39f0ff6..8c97c49 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -1647,6 +1647,12 @@ commands `next-error' and `previous-error'.
"Asynchronously pipe the output of running CMDS to BUFFER.
When finished invoke CALLBACK in BUFFER with process exit status."
(or buffer (error "Output buffer required"))
+ (when (get-buffer-process (get-buffer buffer))
+ ;; Notice running multiple processes in the same buffer so that we
+ ;; can fix the caller. See for example `ggtags-eldoc-function'.
+ (message "Warning: detected %S already running in %S; interrupting..."
+ (get-buffer-process buffer) buffer)
+ (interrupt-process (get-buffer-process buffer)))
(let* ((program (car cmds))
(args (cdr cmds))
(cutoff (and cutoff (+ cutoff (if (get-buffer buffer)
@@ -1910,17 +1916,17 @@ to nil disables displaying this information.")
(declare-function eldoc-message "eldoc")
(defun ggtags-eldoc-function ()
"A function suitable for `eldoc-documentation-function' (which see)."
- (pcase (cons (ggtags-tag-at-point) ggtags-eldoc-cache)
- (`(nil . ,_) nil)
- (`(,_x ,_x) nil)
- (`(,_x ,_x ,def) def)
- (`(,tag . ,_)
- (let* ((ggtags-print-definition-function
- (lambda (s)
- (setq ggtags-eldoc-cache (list tag s))
- (eldoc-message s))))
- (ggtags-show-definition tag)
- nil))))
+ (pcase (ggtags-tag-at-point)
+ (`nil nil)
+ (tag (if (equal tag (car ggtags-eldoc-cache))
+ (cadr ggtags-eldoc-cache)
+ (setq ggtags-eldoc-cache (list tag)) ;don't come back until done
+ (let* ((ggtags-print-definition-function
+ (lambda (s)
+ (setq ggtags-eldoc-cache (list tag s))
+ (eldoc-message s))))
+ (ggtags-show-definition tag)
+ nil)))))
;;; imenu
- [elpa] branch master updated (c5636ba -> 769f2f2), Leo Liu, 2014/04/04
- [elpa] 04/18: Add NEWS to README.rst for 0.8.0 and 0.8.1, Leo Liu, 2014/04/04
- [elpa] 02/18: New function ggtags-echo and use it, Leo Liu, 2014/04/04
- [elpa] 01/18: For #45: Fix popping up/down window for search with single match, Leo Liu, 2014/04/04
- [elpa] 03/18: Fix #45: Change default value of ggtags-auto-jump-to-match, Leo Liu, 2014/04/04
- [elpa] 06/18: Fix error in approximation to (line-number-at-pos (point-max)), Leo Liu, 2014/04/04
- [elpa] 05/18: New function ggtags-eldoc-function for eldoc support, Leo Liu, 2014/04/04
- [elpa] 08/18: Don't activate eldoc support by default, Leo Liu, 2014/04/04
- [elpa] 09/18: Fix multiple calls of ggtags-show-definition,
Leo Liu <=
- [elpa] 10/18: Make ggtags-eldoc-function work better when no project root, Leo Liu, 2014/04/04
- [elpa] 07/18: Refactor out ggtags-include-file from ggtags-find-tag-dwim, Leo Liu, 2014/04/04
- [elpa] 12/18: Make ggtags-use-project-gtagsconf work on remote projects, Leo Liu, 2014/04/04
- [elpa] 11/18: Revert "Fix ggtags-with-current-project to include GTAGSCONF", Leo Liu, 2014/04/04
- [elpa] 13/18: New macro ggtags-with-temp-message that reports execution time, Leo Liu, 2014/04/04
- [elpa] 14/18: Don't reply on excution order of filter and sentinel functions, Leo Liu, 2014/04/04
- [elpa] 15/18: Revert "Don't reply on excution order of filter and sentinel functions", Leo Liu, 2014/04/04
- [elpa] 16/18: Properly fix the bug by delaying compilation finish functions, Leo Liu, 2014/04/04
- [elpa] 17/18: Doc fixes and add NEWS for 0.8.2, Leo Liu, 2014/04/04
- [elpa] 18/18: Merge branch 'master' of github.com:leoliu/ggtags, Leo Liu, 2014/04/04