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: Fri, 16 Oct 2020 11:13:51 +0300 Organization: LINKOV.NET Message-ID: <875z7avb9c.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> 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="16664"; 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 Fri Oct 16 10:27:33 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 1kTL5J-0004Dz-2I for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Oct 2020 10:27:33 +0200 Original-Received: from localhost ([::1]:51886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kTL5I-0000dC-4j for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 16 Oct 2020 04:27:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54416) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kTL4o-0008Q3-H5 for bug-gnu-emacs@gnu.org; Fri, 16 Oct 2020 04:27:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46041) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kTL4o-0001aV-8A for bug-gnu-emacs@gnu.org; Fri, 16 Oct 2020 04:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kTL4o-0005Wg-5Q for bug-gnu-emacs@gnu.org; Fri, 16 Oct 2020 04:27: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: Fri, 16 Oct 2020 08:27: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.160283676321148 (code B ref 32676); Fri, 16 Oct 2020 08:27:02 +0000 Original-Received: (at 32676) by debbugs.gnu.org; 16 Oct 2020 08:26:03 +0000 Original-Received: from localhost ([127.0.0.1]:57582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kTL3r-0005V2-C6 for submit@debbugs.gnu.org; Fri, 16 Oct 2020 04:26:03 -0400 Original-Received: from relay10.mail.gandi.net ([217.70.178.230]:38321) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kTL3p-0005UB-71 for 32676@debbugs.gnu.org; Fri, 16 Oct 2020 04:26:01 -0400 Original-Received: from mail.gandi.net (m91-129-102-160.cust.tele2.ee [91.129.102.160]) (Authenticated sender: juri@linkov.net) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 2ADCC240010; Fri, 16 Oct 2020 08:25:52 +0000 (UTC) In-Reply-To: <878sc8yn0i.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 15 Oct 2020 09:19:25 +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:190669 Archived-At: --=-=-= Content-Type: text/plain >>> Is there a different variable that should be used instead? >> >> I can't find another variable. Maybe a new variable should be created, >> with a name like next-error-current. > > Re-reading the code, we don't really need the variable at all. The call > to the highlighting function has been moved into the C-x ` command, > after all, so we already know what buffer to use, and where point is. > > So I've now changed this to just highlight the current line in the > "error buffer", which seems to work fine in the couple of use cases I > tried. Simplicity is the hallmark of truth :-) Surprisingly, this feature works everywhere, even in diff-mode. But when using next-error on an empty line in diff-mode, its highlighting is too short to notice - only 1 character wide. Maybe the next-error-message face should extend to the end of the window like hl-line-mode face does? 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: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=next-error-message-extend.patch diff --git a/lisp/simple.el b/lisp/simple.el index bd19969341..97f6d4837e 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -125,7 +125,7 @@ next-error-message-highlight :version "28.1") (defface next-error-message - '((t (:inherit highlight))) + '((t (:inherit highlight :extend t))) "Face used to highlight the current error message in the `next-error' buffer." :group 'next-error :version "28.1") @@ -484,7 +484,7 @@ next-error-message-highlight (with-current-buffer error-buffer (when next-error--message-highlight-overlay (delete-overlay next-error--message-highlight-overlay)) - (let ((ol (make-overlay (line-beginning-position) (line-end-position)))) + (let ((ol (make-overlay (line-beginning-position) (1+ (line-end-position))))) ;; do not override region highlighting (overlay-put ol 'priority -50) (overlay-put ol 'face 'next-error-message) --=-=-=--