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

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

[ELPA-diffs] /srv/bzr/emacs/elpa r405: * ggtags.el: A few minor fixes


From: Leo Liu
Subject: [ELPA-diffs] /srv/bzr/emacs/elpa r405: * ggtags.el: A few minor fixes
Date: Mon, 03 Jun 2013 15:02:58 +0800
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 405
committer: Leo Liu <address@hidden>
branch nick: elpa
timestamp: Mon 2013-06-03 15:02:58 +0800
message:
  * ggtags.el: A few minor fixes
  
    1. Quote path in ggtags-find-tag
    2. Do not close the window if exit abnormally
    3. Tweak ggtags-global-mode-font-lock-keywords
modified:
  packages/ggtags/ggtags.el
=== modified file 'packages/ggtags/ggtags.el'
--- a/packages/ggtags/ggtags.el 2013-06-03 04:25:39 +0000
+++ b/packages/ggtags/ggtags.el 2013-06-03 07:02:58 +0000
@@ -258,7 +258,7 @@
                  (if (y-or-n-p "Find definition (n for reference)? ")
                      "" "-r")
                  name)
-       (format "global %s --from-here=%d:%s \"%s\""
+       (format "global %s --from-here=%d:'%s' \"%s\""
                (ggtags-global-options)
                (line-number-at-pos)
                (expand-file-name (file-truename buffer-file-name))
@@ -272,7 +272,10 @@
     (let ((split-window-preferred-function ggtags-split-window-function))
       (compile-goto-error))))
 
+(defvar-local ggtags-global-exit-status nil)
+
 (defun ggtags-global-exit-message-function (_process-status exit-status msg)
+  (setq ggtags-global-exit-status exit-status)
   (let ((count (save-excursion
                  (goto-char (point-max))
                  (if (re-search-backward "^\\([0-9]+\\) \\w+ located" nil t)
@@ -338,29 +341,27 @@
           (ggtags-abbreviate-file (match-beginning sub) (match-end sub)))))))
 
 (defun ggtags-handle-single-match (buf _how)
-  (unless (or (not ggtags-auto-jump-to-first-match)
-              (save-excursion
-                (goto-char (point-min))
-                (ignore-errors
-                  (goto-char (compilation-next-single-property-change
-                              (point) 'compilation-message))
-                  (end-of-line)
-                  (compilation-next-single-property-change
-                   (point) 'compilation-message))))
+  (when (and ggtags-auto-jump-to-first-match
+             ;; If exit abnormally keep the window for inspection.
+             (zerop ggtags-global-exit-status)
+             (save-excursion
+               (goto-char (point-min))
+               (not (ignore-errors
+                      (goto-char (compilation-next-single-property-change
+                                  (point) 'compilation-message))
+                      (end-of-line)
+                      (compilation-next-single-property-change
+                       (point) 'compilation-message)))))
     (ggtags-navigation-mode -1)
     ;; 0.5s delay for `ggtags-auto-jump-to-first-match'
     (sit-for 0)                    ; See: http://debbugs.gnu.org/13829
     (ggtags-navigation-mode-cleanup buf 0.5)))
 
 (defvar ggtags-global-mode-font-lock-keywords
-  '(("^-[*]-.*-[*]-$"
-     (0 '(face nil compilation-message nil help-echo nil mouse-face nil) t))
-    ("^\\w+ not found.*\\|^[0-9]+ \\w+ located.*"
-     (0 '(face nil compilation-message nil help-echo nil mouse-face nil) t))
-    ("^Global \\(exited 
abnormally\\|interrupt\\|killed\\|terminated\\)\\(?:.*with code 
\\([0-9]+\\)\\)?.*"
-     (0 '(face nil compilation-message nil help-echo nil mouse-face nil) t)
-     (1 compilation-error-face)
-     (2 compilation-error-face nil t))))
+  '(("^Global \\(exited 
abnormally\\|interrupt\\|killed\\|terminated\\)\\(?:.*with code 
\\([0-9]+\\)\\)?.*"
+     (1 'compilation-error)
+     (2 'compilation-error nil t))
+    ("^Global found \\([0-9]+\\)" (1 compilation-info-face))))
 
 (define-compilation-mode ggtags-global-mode "Global"
   "A mode for showing outputs from gnu global."


reply via email to

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