[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 03/18: Fix #45: Change default value of ggtags-auto-jump-to-match
From: |
Leo Liu |
Subject: |
[elpa] 03/18: Fix #45: Change default value of ggtags-auto-jump-to-match |
Date: |
Sat, 05 Apr 2014 01:25:13 +0000 |
leoliu pushed a commit to branch master
in repository elpa.
commit a5b483a7e3ce830c14f1e119f7c7338eb7329ecb
Author: Leo Liu <address@hidden>
Date: Tue Apr 1 07:56:17 2014 +0800
Fix #45: Change default value of ggtags-auto-jump-to-match
Fix ggtags-global-filter not to show the point-max of *ggtags-global*
buffer or users will see the scrolling text.
Do not auto jump to history if users have manually jumped to an error
i.e. compilation-current-error is non-nil.
---
ggtags.el | 22 +++++++++++++---------
1 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/ggtags.el b/ggtags.el
index d00cc08..1668697 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -151,7 +151,7 @@ directory local variables is not enabled by default per
:type '(repeat string)
:group 'ggtags)
-(defcustom ggtags-auto-jump-to-match 'first
+(defcustom ggtags-auto-jump-to-match 'history
"Strategy on how to jump to match: nil, first or history.
nil: never automatically jump to any match;
@@ -1275,12 +1275,15 @@ commands `next-error' and `previous-error'.
(defvar-local ggtags-global-output-lines 0)
-(defun ggtags-global--display-buffer (&optional buffer)
- (let ((buffer (or buffer (current-buffer))))
- (unless (get-buffer-window buffer)
- (let* ((split-window-preferred-function ggtags-split-window-function)
- (w (display-buffer buffer '(nil (allow-no-window . t)))))
- (and w (compilation-set-window-height w))))))
+(defun ggtags-global--display-buffer (&optional buffer desired-point)
+ (pcase (let ((buffer (or buffer (current-buffer)))
+ (split-window-preferred-function ggtags-split-window-function))
+ (and (not (get-buffer-window buffer))
+ (display-buffer buffer '(nil (allow-no-window . t)))))
+ ((and (pred windowp) w)
+ (with-selected-window w
+ (compilation-set-window-height w)
+ (and desired-point (goto-char desired-point))))))
(defun ggtags-global-filter ()
"Called from `compilation-filter-hook' (which see)."
@@ -1303,10 +1306,11 @@ commands `next-error' and `previous-error'.
(point)))
;; If the number of output lines is small
;; `ggtags-global-handle-exit' takes care of displaying the buffer.
- (when (and (> ggtags-global-output-lines 20) ggtags-navigation-mode)
- (ggtags-global--display-buffer))
+ (when (and (> ggtags-global-output-lines 30) ggtags-navigation-mode)
+ (ggtags-global--display-buffer nil (or compilation-current-error
(point-min))))
(when (and (eq ggtags-auto-jump-to-match 'history)
(numberp ggtags-auto-jump-to-match-target)
+ (not compilation-current-error)
;; `ggtags-global-output-lines' is imprecise but is
;; greater than (line-number-at-pos (point-max)) so use
;; it as first approximation.
- [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 <=
- [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, 2014/04/04