[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 14/18: Don't reply on excution order of filter and sentinel funct
From: |
Leo Liu |
Subject: |
[elpa] 14/18: Don't reply on excution order of filter and sentinel functions |
Date: |
Sat, 05 Apr 2014 01:25:17 +0000 |
leoliu pushed a commit to branch master
in repository elpa.
commit 03345fb9a25bc2cf09bebc2b96bd867d1c979cc2
Author: Leo Liu <address@hidden>
Date: Thu Apr 3 16:06:56 2014 +0800
Don't reply on excution order of filter and sentinel functions
There is no guarantee ggtags-global-handle-exit will be called after
ggtags-global-filter. So don't rely on this.
For example compile-goto-error on remote file (via tramp) might call
accept-process-output which allows process sentinel functions to run
per (info "(elisp)Sentinels").
---
ggtags.el | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/ggtags.el b/ggtags.el
index 1bf994a..2710e5e 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -748,7 +748,7 @@ Do nothing if GTAGS exceeds the oversize limit unless
FORCE."
(ggtags-update-tags)
(ggtags-with-current-project
(with-current-buffer (with-display-buffer-no-window
- (compilation-start command 'ggtags-global-mode))
+ (compilation-start command 'ggtags-global-mode))
(setq-local ggtags-process-environment env)
(setq ggtags-global-last-buffer (current-buffer))))))
@@ -1313,6 +1313,12 @@ commands `next-error' and `previous-error'.
(compilation-set-window-height w)
(and desired-point (goto-char desired-point))))))
+(defun ggtags-auto-jump-to-match-target ()
+ (when (functionp ggtags-auto-jump-to-match-target)
+ (funcall (prog1 ggtags-auto-jump-to-match-target
+ (setq-local ggtags-auto-jump-to-match-target nil)))
+ t))
+
(defun ggtags-global-filter ()
"Called from `compilation-filter-hook' (which see)."
(let ((ansi-color-apply-face-function
@@ -1342,15 +1348,17 @@ commands `next-error' and `previous-error'.
(> (line-number-at-pos (point-max))
ggtags-auto-jump-to-match-target))
(ggtags-forward-to-line ggtags-auto-jump-to-match-target)
- (setq-local ggtags-auto-jump-to-match-target nil)
- ;;
;; Can't call `compile-goto-error' here becuase
;; `compilation-filter' restores point and as a result commands
;; dependent on point such as `ggtags-navigation-next-file' and
;; `ggtags-navigation-previous-file' fail to work.
- (with-display-buffer-no-window
- (with-demoted-errors (compile-goto-error)))
- (run-with-idle-timer 0 nil #'compilation-auto-jump (current-buffer)
(point)))
+ (setq-local ggtags-auto-jump-to-match-target
+ (apply-partially
+ (lambda (buf pt)
+ (let ((compilation-auto-jump-to-first-error t))
+ (with-display-buffer-no-window (compilation-auto-jump buf
pt))))
+ (current-buffer) (point)))
+ (run-with-idle-timer 0 nil #'ggtags-auto-jump-to-match-target))
(make-local-variable 'ggtags-global-large-output)
(when (> ggtags-global-output-lines ggtags-global-large-output)
(cl-incf ggtags-global-large-output 500)
@@ -1364,6 +1372,7 @@ commands `next-error' and `previous-error'.
;; If exit abnormally display the buffer for inspection.
(ggtags-global--display-buffer))
(ggtags-auto-jump-to-match
+ (ggtags-auto-jump-to-match-target)
(if (pcase (compilation-next-single-property-change
(point-min) 'compilation-message)
((and pt (guard pt))
- [elpa] 03/18: Fix #45: Change default value of ggtags-auto-jump-to-match, (continued)
- [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, 2014/04/04
- [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 <=
- [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