leoliu pushed a commit to branch master
in repository elpa.
commit 02823de20f18b8824d4876808290afc580d2a92b
Author: Leo Liu <[email protected]>
Date: Tue Apr 1 07:35:16 2014 +0800
New function ggtags-echo and use it
---
ggtags.el | 33 +++++++++++++++++----------------
1 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/ggtags.el b/ggtags.el
index 6f56829..d00cc08 100644
--- a/ggtags.el
+++ b/ggtags.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2013-2014 Free Software Foundation, Inc.
;; Author: Leo Liu <[email protected]>
-;; Version: 0.8.1
+;; Version: 0.8.2
;; Keywords: tools, convenience
;; Created: 2013-01-29
;; URL: https://github.com/leoliu/ggtags
@@ -309,6 +309,10 @@ properly update `ggtags-mode-map'."
"Return non-nil if XS is a list of strings."
(cl-every #'stringp xs))
+(defsubst ggtags-echo (format-string &rest args)
+ "Print formatted text to echo area."
+ (let (message-log-max) (apply #'message format-string args)))
+
(defun ggtags-forward-to-line (line)
"Move to line number LINE in current buffer."
(cl-check-type line (integer 1))
@@ -1062,15 +1066,14 @@ Use \\[jump-to-register] to restore the search session."
0))
(ring-length find-tag-marker-ring)))
(let ((m (ring-ref find-tag-marker-ring ggtags-tag-ring-index))
- (i (- (ring-length find-tag-marker-ring) ggtags-tag-ring-index))
- (message-log-max nil))
- (message "%d%s marker%s" i (pcase (mod i 10)
- ;; ` required for 24.1 and 24.2
- (`1 "st")
- (`2 "nd")
- (`3 "rd")
- (_ "th"))
- (if (marker-buffer m) "" " (dead)"))
+ (i (- (ring-length find-tag-marker-ring) ggtags-tag-ring-index)))
+ (ggtags-echo "%d%s marker%s" i (pcase (mod i 10)
+ ;; ` required for 24.1 and 24.2
+ (`1 "st")
+ (`2 "nd")
+ (`3 "rd")
+ (_ "th"))
+ (if (marker-buffer m) "" " (dead)"))
(if (not (marker-buffer m))
(ding)
(switch-to-buffer (marker-buffer m))
@@ -1323,9 +1326,8 @@ commands `next-error' and `previous-error'.
(make-local-variable 'ggtags-global-large-output)
(when (> ggtags-global-output-lines ggtags-global-large-output)
(cl-incf ggtags-global-large-output 500)
- (let ((message-log-max nil))
- (message "Output %d lines (Type `C-c C-k' to cancel)"
- ggtags-global-output-lines))))
+ (ggtags-echo "Output %d lines (Type `C-c C-k' to cancel)"
+ ggtags-global-output-lines)))
(defun ggtags-global-handle-exit (buf how)
"A function for `compilation-finish-functions' (which see)."
@@ -1655,9 +1657,8 @@ When finished invoke CALLBACK in BUFFER with process exit
status."
proc))
(defun ggtags-show-definition-default (defs)
- (let (message-log-max)
- (message "%s%s" (or (caar defs) "[definition not found]")
- (if (cdr defs) " [guess]" ""))))
+ (ggtags-echo "%s%s" (or (caar defs) "[definition not found]")
+ (if (cdr defs) " [guess]" "")))
(defun ggtags-show-definition (name)
(interactive (list (ggtags-read-tag 'definition current-prefix-arg)))