From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#32676: [PATCH] Add option to highlight the 'next-error' error message Date: Sat, 17 Oct 2020 23:24:14 +0300 Organization: LINKOV.NET Message-ID: <87k0voha8h.fsf@mail.linkov.net> References: <20180910050802.25922-1-erjoalgo@gmail.com> <83a7ollcq2.fsf@gnu.org> <874let1o3k.fsf@gmail.com> <831s9xl54b.fsf@gnu.org> <874leq1hw4.fsf@mail.linkov.net> <87worlgh0k.fsf@mail.linkov.net> <878swkxqo1.fsf_-_@mail.linkov.net> <874kmxz7e0.fsf@gnus.org> <874kmwy7k8.fsf@mail.linkov.net> <878sc8yn0i.fsf@gnus.org> <875z7avb9c.fsf@mail.linkov.net> <87mu0m446f.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2823"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: Ernesto Alfonso , Robert Pluim , 32676@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 17 22:30:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kTsqB-0000dN-VT for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Oct 2020 22:30:11 +0200 Original-Received: from localhost ([::1]:40036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kTsqA-00074t-TP for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Oct 2020 16:30:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33362) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kTsq3-00074k-4D for bug-gnu-emacs@gnu.org; Sat, 17 Oct 2020 16:30:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52302) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kTsq2-0003uq-L8 for bug-gnu-emacs@gnu.org; Sat, 17 Oct 2020 16:30:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kTsq2-0005u5-Dj for bug-gnu-emacs@gnu.org; Sat, 17 Oct 2020 16:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Oct 2020 20:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32676 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed patch Original-Received: via spool by 32676-submit@debbugs.gnu.org id=B32676.160296655322612 (code B ref 32676); Sat, 17 Oct 2020 20:30:02 +0000 Original-Received: (at 32676) by debbugs.gnu.org; 17 Oct 2020 20:29:13 +0000 Original-Received: from localhost ([127.0.0.1]:35615 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kTspF-0005se-5J for submit@debbugs.gnu.org; Sat, 17 Oct 2020 16:29:13 -0400 Original-Received: from relay4-d.mail.gandi.net ([217.70.183.196]:52151) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kTspD-0005sR-Cl for 32676@debbugs.gnu.org; Sat, 17 Oct 2020 16:29:11 -0400 X-Originating-IP: 91.129.102.160 Original-Received: from mail.gandi.net (m91-129-102-160.cust.tele2.ee [91.129.102.160]) (Authenticated sender: juri@linkov.net) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 6D76DE0005; Sat, 17 Oct 2020 20:29:02 +0000 (UTC) In-Reply-To: <87mu0m446f.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 16 Oct 2020 16:48:56 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:190834 Archived-At: --=-=-= Content-Type: text/plain >> I tried to add the attribute ':extend t' to the next-error-message face, >> but it has no effect. Maybe because currently highlighting is not added >> to the trailing newline. Indeed, with this patch it works: > > Makes sense; go ahead and apply. Now pushed. After a day of using it, I realized this feature paved the way to another very useful feature: when the highlighting overlay is not removed after going to the next occurrence, and leaves the highlighting on all visited lines, this provides an overview what lines were already visited, and what lines not yet visited - like visited links are highlighted differently in browsers. This patch builds this feature on the top of the initial patch: --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=next-error-message-highlight-keep.patch Content-Transfer-Encoding: 8bit diff --git a/lisp/simple.el b/lisp/simple.el index 97f6d4837e..c2e5ff4c5a 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -119,8 +119,12 @@ next-error-recenter :version "23.1") (defcustom next-error-message-highlight nil - "If non-nil, highlight the current error message in the `next-error' buffer." - :type 'boolean + "If non-nil, highlight the current error message in the `next-error' buffer. +If the value is `keep', highlighting is permanent, so all visited error +messages are highlighted; this helps to see what messages were visited." + :type '(choice (const :tag "Highlight the current error" t) + (const :tag "Highlight all visited errors" keep) + (const :tag "No highlighting" nil)) :group 'next-error :version "28.1") @@ -482,7 +486,8 @@ next-error-message-highlight "Highlight the current error message in the ‘next-error’ buffer." (when next-error-message-highlight (with-current-buffer error-buffer - (when next-error--message-highlight-overlay + (when (and next-error--message-highlight-overlay + (not (eq next-error-message-highlight 'keep))) (delete-overlay next-error--message-highlight-overlay)) (let ((ol (make-overlay (line-beginning-position) (1+ (line-end-position))))) ;; do not override region highlighting --=-=-=--