diff options
author | Stephen Leake <stephen_leake@stephe-leake.org> | 2019-04-11 13:58:36 -0700 |
---|---|---|
committer | Stephen Leake <stephen_leake@stephe-leake.org> | 2019-04-11 13:58:36 -0700 |
commit | 7768581172e11be52b1fcd8224f4594e126bbdb7 (patch) | |
tree | 7c488e50653a6b5294e2662524b84701df62f76d /lisp | |
parent | b29b79efd9752caf1e99273575a00b6769ddad56 (diff) | |
download | emacs-7768581172e11be52b1fcd8224f4594e126bbdb7.tar.gz |
Make `next-error' output fewer messages about locus
* lisp/simple.el (next-error-verbosity): New user variable.
(next-error, next-error-internal): Use it to control only outputting
locus message if locus changed.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/simple.el | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 306df967661..be84e48cf4a 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -110,6 +110,15 @@ If non-nil, the value is passed directly to `recenter'." :type 'hook :group 'next-error) +(defcustom next-error-verbosity nil + "If nil, `next-error' always outputs the current error buffer. +If non-nil, the message is output only when the error buffer +changes." + :group 'next-error + :type 'boolean + :safe #'booleanp + :version "27.1") + (defvar next-error-highlight-timer nil) (defvar next-error-overlay-arrow-position nil) @@ -312,21 +321,27 @@ To control which errors are matched, customize the variable ;; We know here that next-error-function is a valid symbol we can funcall (with-current-buffer buffer (funcall next-error-function (prefix-numeric-value arg) reset) - (next-error-found buffer (current-buffer)) - (message "%s locus from %s" - (cond (reset "First") - ((eq (prefix-numeric-value arg) 0) "Current") - ((< (prefix-numeric-value arg) 0) "Previous") - (t "Next")) - next-error-last-buffer))))) + (let ((prev next-error-last-buffer)) + (next-error-found buffer (current-buffer)) + (when (or (not next-error-verbosity) + (not (eq prev next-error-last-buffer))) + (message "%s locus from %s" + (cond (reset "First") + ((eq (prefix-numeric-value arg) 0) "Current") + ((< (prefix-numeric-value arg) 0) "Previous") + (t "Next")) + next-error-last-buffer))))))) (defun next-error-internal () "Visit the source code corresponding to the `next-error' message at point." (let ((buffer (current-buffer))) ;; We know here that next-error-function is a valid symbol we can funcall (funcall next-error-function 0 nil) - (next-error-found buffer (current-buffer)) - (message "Current locus from %s" next-error-last-buffer))) + (let ((prev next-error-last-buffer)) + (next-error-found buffer (current-buffer)) + (when (or (not next-error-verbosity) + (not (eq prev next-error-last-buffer))) + (message "Current locus from %s" next-error-last-buffer))))) (defun next-error-found (&optional from-buffer to-buffer) "Function to call when the next locus is found and displayed. |