leoliu pushed a commit to branch master
in repository elpa.
commit bace0b0ba21f80a9b4bf1b958b67571183d046f4
Author: Leo Liu <[email protected]>
Date: Fri Mar 28 21:50:06 2014 +0800
Use compilation-auto-jump in ggtags-global-filter
to correctly set point in that window.
---
ggtags.el | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/ggtags.el b/ggtags.el
index 700d16b..3347c37 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -1292,13 +1292,20 @@ commands `next-error' and `previous-error'.
(count-lines compilation-filter-start (point)))
(when (and (> ggtags-global-output-lines 5) ggtags-navigation-mode)
(ggtags-global--display-buffer))
- (when (and (numberp ggtags-auto-jump-to-match-target)
+ (when (and (eq ggtags-auto-jump-to-match 'history)
+ (numberp ggtags-auto-jump-to-match-target)
;; `ggtags-global-output-lines' is imprecise.
(> (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)
- (with-demoted-errors (compile-goto-error)))
+ ;;
+ ;; 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.
+ (setq-local compilation-auto-jump-to-first-error t)
+ (run-with-idle-timer 0 nil #'compilation-auto-jump (current-buffer)
(point)))
(make-local-variable 'ggtags-global-large-output)
(when (> ggtags-global-output-lines ggtags-global-large-output)
(cl-incf ggtags-global-large-output 500)