[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master d30ae7d 08/14: For #116: Provide a way to disable highligh
From: |
Leo Liu |
Subject: |
[elpa] master d30ae7d 08/14: For #116: Provide a way to disable highlighting tag at point |
Date: |
Mon, 14 Dec 2015 21:52:42 +0000 |
branch: master
commit d30ae7d1384f84f93b7eb605634b6ec701bd433f
Author: Leo Liu <address@hidden>
Commit: Leo Liu <address@hidden>
For #116: Provide a way to disable highlighting tag at point
---
README.rst | 10 ++++++++++
ggtags.el | 39 +++++++++++++++++++++++++++------------
2 files changed, 37 insertions(+), 12 deletions(-)
diff --git a/README.rst b/README.rst
index 34c51aa..13b4140 100644
--- a/README.rst
+++ b/README.rst
@@ -313,6 +313,16 @@ Integration with other packages
NEWS
~~~~
+(devel) 0.8.11
+++++++++++++++
+
+#. ``ggtags-highlight-tag-delay`` is renamed to
+ ``ggtags-highlight-tag``.
+#. Tag highlighting can be disabled by setting
+ ``ggtags-highlight-tag`` to nil.
+
+ggtags-highlight-tag
+
[2015-06-12 Fri] 0.8.10
+++++++++++++++++++++++
diff --git a/ggtags.el b/ggtags.el
index b628763..d991ba4 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -331,13 +331,17 @@ Nil means using the value of `completing-read-function'."
function)
:group 'ggtags)
-(defcustom ggtags-highlight-tag-delay 0.25
- "Time in seconds before highlighting tag at point."
+(define-obsolete-variable-alias 'ggtags-highlight-tag-delay
'ggtags-highlight-tag
+ "0.8.11")
+
+(defcustom ggtags-highlight-tag 0.25
+ "If non-nil time in seconds before highlighting tag at point.
+Set to `nil' to disable tag highlighting."
:set (lambda (sym value)
- (when (bound-and-true-p ggtags-highlight-tag-timer)
- (timer-set-idle-time ggtags-highlight-tag-timer value t))
+ (when (fboundp 'ggtags-setup-highlight-tag-at-point)
+ (ggtags-setup-highlight-tag-at-point value))
(set-default sym value))
- :type 'number
+ :type '(choice (const :tag "Disable" nil) number)
:group 'ggtags)
(defcustom ggtags-bounds-of-tag-function (lambda ()
@@ -2204,10 +2208,7 @@ to nil disables displaying this information.")
;;;###autoload
(define-minor-mode ggtags-mode nil
:lighter (:eval (if ggtags-navigation-mode "" " GG"))
- (unless (timerp ggtags-highlight-tag-timer)
- (setq ggtags-highlight-tag-timer
- (run-with-idle-timer
- ggtags-highlight-tag-delay t #'ggtags-highlight-tag-at-point)))
+ (ggtags-setup-highlight-tag-at-point ggtags-highlight-tag)
(if ggtags-mode
(progn
(add-hook 'after-save-hook 'ggtags-after-save-function nil t)
@@ -2230,9 +2231,7 @@ to nil disables displaying this information.")
(remove-function (local 'eldoc-documentation-function)
'ggtags-eldoc-function)
(setq mode-line-buffer-identification
(delq 'ggtags-mode-line-project-name
mode-line-buffer-identification))
- (and (overlayp ggtags-highlight-tag-overlay)
- (delete-overlay ggtags-highlight-tag-overlay))
- (setq ggtags-highlight-tag-overlay nil)))
+ (ggtags-cancel-highlight-tag-at-point 'keep-timer)))
(defvar ggtags-highlight-tag-map
(let ((map (make-sparse-keymap)))
@@ -2252,6 +2251,22 @@ to nil disables displaying this information.")
(put 'ggtags-active-tag 'help-echo
"S-mouse-1 for definitions\nS-mouse-3 for references")
+(defun ggtags-setup-highlight-tag-at-point (flag)
+ (cond ((null flag) (ggtags-cancel-highlight-tag-at-point))
+ ((not (timerp ggtags-highlight-tag-timer))
+ (setq ggtags-highlight-tag-timer
+ (run-with-idle-timer flag t #'ggtags-highlight-tag-at-point)))
+ (t (timer-set-idle-time ggtags-highlight-tag-timer flag t))))
+
+(defun ggtags-cancel-highlight-tag-at-point (&optional keep-timer)
+ (when (and (not keep-timer)
+ (timerp ggtags-highlight-tag-timer))
+ (cancel-timer ggtags-highlight-tag-timer)
+ (setq ggtags-highlight-tag-timer nil))
+ (when ggtags-highlight-tag-overlay
+ (delete-overlay ggtags-highlight-tag-overlay)
+ (setq ggtags-highlight-tag-overlay nil)))
+
(defun ggtags-highlight-tag-at-point ()
(when (and ggtags-mode ggtags-project-root (ggtags-find-project))
(unless (overlayp ggtags-highlight-tag-overlay)
- [elpa] master updated (979b09b -> 77d6482), Leo Liu, 2015/12/14
- [elpa] master abeb3ef 02/14: `process-environment` must be copied, Leo Liu, 2015/12/14
- [elpa] master 7937129 03/14: Merge pull request #107 from egarrulo/patch-1, Leo Liu, 2015/12/14
- [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 <=
- [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, 2015/12/14
- [elpa] master 77d6482 14/14: Merge branch 'master' of github.com:leoliu/ggtags, Leo Liu, 2015/12/14