emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 08/09: New hook ggtags-global-next-error-hook


From: Leo Liu
Subject: [elpa] 08/09: New hook ggtags-global-next-error-hook
Date: Tue, 25 Feb 2014 08:45:58 +0000

leoliu pushed a commit to branch master
in repository elpa.

commit c0c0a7f306a4ccad121acfd48b60278d892c8b06
Author: Leo Liu <address@hidden>
Date:   Tue Feb 25 16:11:09 2014 +0800

    New hook ggtags-global-next-error-hook
    
    Reduce ggtags-project-duration to 600.
---
 ggtags.el |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/ggtags.el b/ggtags.el
index d25da17..4034978 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -105,7 +105,7 @@ automatically switches to 'global --single-update'."
                  number)
   :group 'ggtags)
 
-(defcustom ggtags-project-duration 3600
+(defcustom ggtags-project-duration 600
   "Seconds to keep information of a project in memory."
   :type 'number
   :group 'ggtags)
@@ -177,6 +177,12 @@ If an integer abbreviate only names longer than that 
number."
   :type 'number
   :group 'ggtags)
 
+(defcustom ggtags-global-next-error-hook nil
+  "Hook run immediately after finding a tag."
+  :options '(reposition-window recenter)
+  :type 'hook
+  :group 'ggtags)
+
 (defcustom ggtags-mode-prefix-key "\C-c"
   "Key binding used for `ggtags-mode-prefix-map'.
 Users should change the value using `customize-variable' to
@@ -1172,7 +1178,7 @@ Global and Emacs."
 
 (defvar ggtags-global-line-overlay nil)
 
-(defun ggtags-global-next-error-hook ()
+(defun ggtags-global-next-error-function ()
   (ggtags-move-to-tag)
   (ggtags-global-save-start-marker)
   (ignore-errors
@@ -1182,7 +1188,8 @@ Global and Emacs."
         (overlay-put ggtags-global-line-overlay 'face 'ggtags-global-line))
       (move-overlay ggtags-global-line-overlay
                     (line-beginning-position) (line-end-position)
-                    (current-buffer)))))
+                    (current-buffer))))
+  (run-hooks 'ggtags-global-next-error-hook))
 
 (define-minor-mode ggtags-navigation-mode nil
   :lighter
@@ -1206,9 +1213,9 @@ Global and Emacs."
   :global t
   (if ggtags-navigation-mode
       (progn
-        (add-hook 'next-error-hook 'ggtags-global-next-error-hook)
+        (add-hook 'next-error-hook 'ggtags-global-next-error-function)
         (add-hook 'minibuffer-setup-hook 'ggtags-minibuffer-setup-function))
-    (remove-hook 'next-error-hook 'ggtags-global-next-error-hook)
+    (remove-hook 'next-error-hook 'ggtags-global-next-error-function)
     (remove-hook 'minibuffer-setup-hook 'ggtags-minibuffer-setup-function)))
 
 (defun ggtags-minibuffer-setup-function ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]