[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 2b8d33f 05/14: Handle invalid history match in ggtags-glob
From: |
Leo Liu |
Subject: |
[elpa] master 2b8d33f 05/14: Handle invalid history match in ggtags-global-filter |
Date: |
Mon, 14 Dec 2015 21:52:41 +0000 |
branch: master
commit 2b8d33f3284c4af2011a9d30799cdb6be8fcf4f5
Author: Leo Liu <address@hidden>
Commit: Leo Liu <address@hidden>
Handle invalid history match in ggtags-global-filter
by jumping to first error instead.
For example when a history match is set on the second match of all
matches and the search later turns up only single match, ggtags will
fail to jump to match. To make things worse ggtags-global-handle-exit
will kill the *ggtags-global* buffer leaving users with no opportunity
to move to a valid match.
---
ggtags.el | 26 +++++++++++++++-----------
1 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/ggtags.el b/ggtags.el
index 09e3e63..7d53b86 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2013-2015 Free Software Foundation, Inc.
;; Author: Leo Liu <address@hidden>
-;; Version: 0.8.10
+;; Version: 0.8.11
;; Keywords: tools, convenience
;; Created: 2013-01-29
;; URL: https://github.com/leoliu/ggtags
@@ -1623,19 +1623,23 @@ commands `next-error' and `previous-error'.
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
+ (ggtags-delay-finish-functions
+ (with-display-buffer-no-window
+ (condition-case nil
+ (let ((compilation-auto-jump-to-first-error t))
+ (compilation-auto-jump (current-buffer) (point)))
+ (error (message "\
+ggtags: history match invalid, jump to first error instead")
+ (first-error)))))
;; `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.
- (run-with-idle-timer 0 nil (lambda (buf pt)
- (and (buffer-live-p buf)
- (with-current-buffer buf
- (ggtags-delay-finish-functions
- (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
+ (lambda (buf pt)
+ (and (buffer-live-p buf)
+ (with-current-buffer buf (goto-char pt))))
+ (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)
- [elpa] master 6153f5e 01/14: GNU Global 6.5 has renamed plugin-factory/README, (continued)
- [elpa] master 6153f5e 01/14: GNU Global 6.5 has renamed plugin-factory/README, Leo Liu, 2015/12/14
- [elpa] master 5eeb0a1 04/14: Correctly set ggtags-global-start-marker, Leo Liu, 2015/12/14
- [elpa] master ec3c6bb 09/14: Correct misspellings, Leo Liu, 2015/12/14
- [elpa] master 7e2a915 11/14: Merge pull request #117 from syohex/typo, Leo Liu, 2015/12/14
- [elpa] master d30ae7d 08/14: For #116: Provide a way to disable highlighting tag at point, Leo Liu, 2015/12/14
- [elpa] master d2a8892 12/14: Merge pull request #118 from syohex/update-url, Leo Liu, 2015/12/14
- [elpa] master d4fb6d4 13/14: Doc fix, Leo Liu, 2015/12/14
- [elpa] master ad3ae8d 07/14: Merge pull request #111 from kanru/patch-1, Leo Liu, 2015/12/14
- [elpa] master f155c3c 06/14: Avoid the jit-lock-mode to kick in when fontify code, Leo Liu, 2015/12/14
- [elpa] master 0cc4a4a 10/14: Update MELPA URL, Leo Liu, 2015/12/14
- [elpa] master 2b8d33f 05/14: Handle invalid history match in ggtags-global-filter,
Leo Liu <=
- [elpa] master 77d6482 14/14: Merge branch 'master' of github.com:leoliu/ggtags, Leo Liu, 2015/12/14