From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: improve "next locus from " messages Date: Wed, 03 Apr 2019 09:50:20 -0800 Message-ID: <86sguzc71f.fsf@stephe-leake.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="46358"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (windows-nt) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 03 19:52:07 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hBk3T-000BvQ-8G for ged-emacs-devel@m.gmane.org; Wed, 03 Apr 2019 19:52:07 +0200 Original-Received: from localhost ([127.0.0.1]:48288 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hBk3S-0005SH-69 for ged-emacs-devel@m.gmane.org; Wed, 03 Apr 2019 13:52:06 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hBk2o-0005SC-Hm for emacs-devel@gnu.org; Wed, 03 Apr 2019 13:51:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hBk2n-0007KA-Fx for emacs-devel@gnu.org; Wed, 03 Apr 2019 13:51:26 -0400 Original-Received: from gproxy5-pub.mail.unifiedlayer.com ([67.222.38.55]:45408) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hBk2n-0007GL-3e for emacs-devel@gnu.org; Wed, 03 Apr 2019 13:51:25 -0400 Original-Received: from cmgw15.unifiedlayer.com (unknown [10.9.0.15]) by gproxy5.mail.unifiedlayer.com (Postfix) with ESMTP id E87D1143A04 for ; Wed, 3 Apr 2019 11:50:25 -0600 (MDT) Original-Received: from host114.hostmonster.com ([74.220.207.114]) by cmsmtp with ESMTP id Bk1phw2QsszDUBk1ph9JqY; Wed, 03 Apr 2019 11:50:25 -0600 X-Authority-Reason: nr=8 Original-Received: from [76.77.182.20] (port=61099 helo=Takver4) by host114.hostmonster.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1hBk1p-003zDf-Mr for emacs-devel@gnu.org; Wed, 03 Apr 2019 11:50:25 -0600 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host114.hostmonster.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stephe-leake.org X-BWhitelist: no X-Source-IP: 76.77.182.20 X-Source-L: No X-Exim-ID: 1hBk1p-003zDf-Mr X-Source-Sender: (Takver4) [76.77.182.20]:61099 X-Source-Auth: stephen_leake@stephe-leake.org X-Email-Count: 1 X-Source-Cap: c3RlcGhlbGU7c3RlcGhlbGU7aG9zdDExNC5ob3N0bW9uc3Rlci5jb20= X-Local-Domain: yes X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 67.222.38.55 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:234926 Archived-At: --=-=-= Content-Type: text/plain Currently, next-error always outputs a message "next locus from ". In the vast majority of cases, does not change from one message to the next, so this message is just annoying. The attached patch changes it so the message is only output when the locus changes. It also gets rid of the "first/current/previous" options; what matters is where the _next_ error will come from. Comments? -- -- Stephe --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=error_locus.diff diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 5bfb0bf901..1d5b932ba1 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1825,6 +1825,8 @@ compilation-start (goto-char (point-max)))) ;; Make it so the next C-x ` will use this buffer. + (when (not (eq outbuf next-error-last-buffer)) + (message "next locus from %s" outbuf)) (setq next-error-last-buffer outbuf))) (defun compilation-set-window-height (window) diff --git a/lisp/simple.el b/lisp/simple.el index 306df96766..832c62ffb3 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -312,34 +312,31 @@ next-error ;; 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))))) + (next-error-found buffer (current-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))) + (next-error-found buffer (current-buffer)))) (defun next-error-found (&optional from-buffer to-buffer) "Function to call when the next locus is found and displayed. FROM-BUFFER is a buffer from which next-error navigated, and TO-BUFFER is a target buffer." - (setq next-error-last-buffer (or from-buffer (current-buffer))) - (when to-buffer - (with-current-buffer to-buffer - (setq next-error-buffer from-buffer))) - (when next-error-recenter - (recenter next-error-recenter)) - (funcall next-error-found-function from-buffer to-buffer) - (run-hooks 'next-error-hook)) + (let ((prev next-error-last-buffer) + (next (or from-buffer (current-buffer)))) + (when (not (eq prev next)) + (message "next locus from %s" next)) + (setq next-error-last-buffer next) + (when to-buffer + (with-current-buffer to-buffer + (setq next-error-buffer from-buffer))) + (when next-error-recenter + (recenter next-error-recenter)) + (funcall next-error-found-function from-buffer to-buffer) + (run-hooks 'next-error-hook))) (defun next-error-select-buffer (buffer) "Select a `next-error' capable BUFFER and set it as the last used. --=-=-=--