[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master cf17576 4/7: Fix #89: Make sure compilation-auto-jump run
From: |
Leo Liu |
Subject: |
[elpa] master cf17576 4/7: Fix #89: Make sure compilation-auto-jump run before cleanup |
Date: |
Sun, 2 Oct 2016 01:47:27 +0000 (UTC) |
branch: master
commit cf17576ef095af77e17e959b8289be3d0a878a5e
Author: Leo Liu <address@hidden>
Commit: Leo Liu <address@hidden>
Fix #89: Make sure compilation-auto-jump run before cleanup
---
ggtags.el | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/ggtags.el b/ggtags.el
index 98addc2..c16f99d 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -1687,11 +1687,18 @@ ggtags: history match invalid, jump to first match
instead")
'compilation-message)))
;; There are multiple matches so pop up the buffer.
(and ggtags-navigation-mode (ggtags-global--display-buffer))
- ;; For the `compilation-auto-jump' in idle timer to run.
- ;; See also: http://debbugs.gnu.org/13829
- (sit-for 0)
+ ;; Manually run the `compilation-auto-jump' timer. Hackish but
+ ;; everything else seems unreliable. See:
+ ;;
+ ;; - http://debbugs.gnu.org/13829
+ ;; - http://debbugs.gnu.org/23987
+ ;; - https://github.com/leoliu/ggtags/issues/89
+ ;;
+ (pcase (cl-find 'compilation-auto-jump timer-list :key #'timer--function)
+ (`nil )
+ (timer (timer-event-handler timer)))
(ggtags-navigation-mode -1)
- (ggtags-navigation-mode-cleanup buf 0)))))
+ (ggtags-navigation-mode-cleanup buf t)))))
(defvar ggtags-global-mode-font-lock-keywords
'(("^Global \\(exited
abnormally\\|interrupt\\|killed\\|terminated\\)\\(?:.*with code
\\([0-9]+\\)\\)?.*"
@@ -1815,7 +1822,7 @@ ggtags: history match invalid, jump to first match
instead")
(goto-char (match-beginning 0))
(goto-char orig))))))
-(defun ggtags-navigation-mode-cleanup (&optional buf time)
+(defun ggtags-navigation-mode-cleanup (&optional buf kill)
(let ((buf (or buf ggtags-global-last-buffer)))
(and (buffer-live-p buf)
(with-current-buffer buf
@@ -1824,7 +1831,7 @@ ggtags: history match invalid, jump to first match
instead")
(when (and (derived-mode-p 'ggtags-global-mode)
(get-buffer-window))
(quit-windows-on (current-buffer)))
- (and time (run-with-idle-timer time nil #'kill-buffer buf))))))
+ (and kill (kill-buffer buf))))))
(defun ggtags-navigation-mode-done ()
(interactive)
@@ -1837,7 +1844,7 @@ ggtags: history match invalid, jump to first match
instead")
"Abort navigation and return to where the search was started."
(interactive)
(ggtags-navigation-mode -1)
- (ggtags-navigation-mode-cleanup nil 0)
+ (ggtags-navigation-mode-cleanup nil t)
;; Run after (ggtags-navigation-mode -1) or
;; ggtags-global-start-marker might not have been saved.
(when (and ggtags-global-start-marker
- [elpa] master updated (3d0eb58 -> 378f13a), Leo Liu, 2016/10/01
- [elpa] master 08ed052 5/7: Apply changes from GNU ELPA, Leo Liu, 2016/10/01
- [elpa] master 7a7ee76 6/7: Doc fix, Leo Liu, 2016/10/01
- [elpa] master cf17576 4/7: Fix #89: Make sure compilation-auto-jump run before cleanup,
Leo Liu <=
- [elpa] master c697c1d 2/7: Fix #127: Improve ggtags-make-project in finding tag files, Leo Liu, 2016/10/01
- [elpa] master b4ee572 1/7: Fix #124: Fix lighter for ggtags-navigation-mode, Leo Liu, 2016/10/01
- [elpa] master 378f13a 7/7: Merge branch 'master' of github.com:leoliu/ggtags, Leo Liu, 2016/10/01
- [elpa] master 811f2e1 3/7: Fix #88 and #130: Adapt to changes in Emacs 25.1, Leo Liu, 2016/10/01