[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 02/18: New function ggtags-echo and use it
From: |
Leo Liu |
Subject: |
[elpa] 02/18: New function ggtags-echo and use it |
Date: |
Sat, 05 Apr 2014 01:25:12 +0000 |
leoliu pushed a commit to branch master
in repository elpa.
commit 02823de20f18b8824d4876808290afc580d2a92b
Author: Leo Liu <address@hidden>
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 <address@hidden>
-;; 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)))
- [elpa] branch master updated (c5636ba -> 769f2f2), Leo Liu, 2014/04/04
- [elpa] 04/18: Add NEWS to README.rst for 0.8.0 and 0.8.1, Leo Liu, 2014/04/04
- [elpa] 02/18: New function ggtags-echo and use it,
Leo Liu <=
- [elpa] 01/18: For #45: Fix popping up/down window for search with single match, Leo Liu, 2014/04/04
- [elpa] 03/18: Fix #45: Change default value of ggtags-auto-jump-to-match, Leo Liu, 2014/04/04
- [elpa] 06/18: Fix error in approximation to (line-number-at-pos (point-max)), Leo Liu, 2014/04/04
- [elpa] 05/18: New function ggtags-eldoc-function for eldoc support, Leo Liu, 2014/04/04
- [elpa] 08/18: Don't activate eldoc support by default, Leo Liu, 2014/04/04
- [elpa] 09/18: Fix multiple calls of ggtags-show-definition, Leo Liu, 2014/04/04
- [elpa] 10/18: Make ggtags-eldoc-function work better when no project root, Leo Liu, 2014/04/04
- [elpa] 07/18: Refactor out ggtags-include-file from ggtags-find-tag-dwim, Leo Liu, 2014/04/04
- [elpa] 12/18: Make ggtags-use-project-gtagsconf work on remote projects, Leo Liu, 2014/04/04
- [elpa] 11/18: Revert "Fix ggtags-with-current-project to include GTAGSCONF", Leo Liu, 2014/04/04