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

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

[elpa] 22/38: New command ggtags-navigation-isearch-forward


From: Leo Liu
Subject: [elpa] 22/38: New command ggtags-navigation-isearch-forward
Date: Mon, 24 Mar 2014 09:31:36 +0000

leoliu pushed a commit to branch master
in repository elpa.

commit 17e01b9f95baae9c31b0638c22d966e42dacef9a
Author: Leo Liu <address@hidden>
Date:   Tue Mar 18 11:20:47 2014 +0800

    New command ggtags-navigation-isearch-forward
---
 ggtags.el |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/ggtags.el b/ggtags.el
index e44a592..f588331 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -1213,6 +1213,9 @@ Use \\[jump-to-register] to restore the search session."
     (define-key map "\M-{" 'ggtags-navigation-previous-file)
     (define-key map "\M->" 'ggtags-navigation-last-error)
     (define-key map "\M-<" 'ggtags-navigation-first-error)
+    ;; Note: shadows `isearch-forward-regexp' but it can be invoked
+    ;; with C-u C-s instead.
+    (define-key map "\C-\M-s" 'ggtags-navigation-isearch-forward)
     (define-key map "\C-c\C-k"
       (lambda () (interactive)
         (ggtags-ensure-global-buffer (kill-compilation))))
@@ -1330,6 +1333,17 @@ Use \\[jump-to-register] to restore the search session."
     (compilation-previous-error 1)
     (compile-goto-error)))
 
+(defun ggtags-navigation-isearch-forward (&optional regexp-p)
+  (interactive "P")
+  (ggtags-ensure-global-buffer
+   (let ((saved (if visible-mode 1 -1)))
+     (visible-mode 1)
+     (with-selected-window (get-buffer-window (current-buffer))
+       (isearch-forward regexp-p)
+       (beginning-of-line)
+       (visible-mode saved)
+       (compile-goto-error)))))
+
 (defun ggtags-navigation-visible-mode (&optional arg)
   (interactive (list (or current-prefix-arg 'toggle)))
   (ggtags-ensure-global-buffer



reply via email to

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