From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#42300: Visual bug in diff-mode Date: Thu, 13 Aug 2020 09:23:52 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18828"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 42300@debbugs.gnu.org To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 13 18:25:10 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 1k6G2Q-0004nE-1B for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 13 Aug 2020 18:25:10 +0200 Original-Received: from localhost ([::1]:36770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k6G2P-0007b3-3g for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 13 Aug 2020 12:25:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54080) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6G2I-0007ap-84 for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2020 12:25:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39260) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k6G2H-0000gJ-UU for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2020 12:25:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k6G2H-0001kI-Qn for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2020 12:25:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 13 Aug 2020 16:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42300 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed patch Original-Received: via spool by 42300-submit@debbugs.gnu.org id=B42300.15973358446634 (code B ref 42300); Thu, 13 Aug 2020 16:25:01 +0000 Original-Received: (at 42300) by debbugs.gnu.org; 13 Aug 2020 16:24:04 +0000 Original-Received: from localhost ([127.0.0.1]:50804 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k6G1L-0001it-SX for submit@debbugs.gnu.org; Thu, 13 Aug 2020 12:24:04 -0400 Original-Received: from mail-ej1-f47.google.com ([209.85.218.47]:36424) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k6G1G-0001hl-Ts for 42300@debbugs.gnu.org; Thu, 13 Aug 2020 12:24:00 -0400 Original-Received: by mail-ej1-f47.google.com with SMTP id kq25so6832588ejb.3 for <42300@debbugs.gnu.org>; Thu, 13 Aug 2020 09:23:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:user-agent :mime-version:date:message-id:subject:to:cc; bh=QTCfBb6RjGhHlMAeRGFTDJLvcC97PCoPcvaVGP4YGIQ=; b=lI4pe3zMND6xqCc6xPKY5w3WqzX9qnFg/r9a5nV8ADEDUZGz6b7afFY62owBYPRIkp 7EDWicxGMiBHI4NHj8NCr0caCoWSIiQ/P2vClU2XaLRcFAjZjo9TThMSgaSjSUKsPxj0 wBQk/+6GW4I/Ix5V+Jy3wiqyjT6+RWIOauAVjhPmVAaIhhitkX7xowgshmShzS14rNiL Gj5h8KsQkAO0VBcqSFVn08W4CHx/rZVt7oIb26+mzAs7VlPYT5M+AlctG2jM97OUOvGv bulvL5ErmJvQ7VJv8nILin8FKN8QZCOGdljAeNo/rW5MfrGz/6RcNdwwmtZ/uP26NY8I 6Vew== X-Gm-Message-State: AOAM533luj//MkIVHxa3zhA86T9lRh0Y8wkwFdOftf4YbtDF3WNDzW7q crQ5iFguQ/A9SK45vMC3fW13/SKfRWB3c6W2Uyg= X-Google-Smtp-Source: ABdhPJznPQylsQf94PmgDCuuNz+PxccWSeVrUIU5Jh24zKoIc0jmpG9ooRnxuuz8beojl5fSzLclSywNDIXr9xR+LFo= X-Received: by 2002:a17:907:11dd:: with SMTP id va29mr5702972ejb.470.1597335833136; Thu, 13 Aug 2020 09:23:53 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 13 Aug 2020 09:23:52 -0700 In-Reply-To: (Gregory Heytings's message of "Thu, 9 Jul 2020 21:23:36 +0200 (CEST)") 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:185044 Archived-At: tags 42300 + confirmed found 42300 28.0.50 thanks Gregory Heytings writes: > Diff-mode was updated in Emacs 27, and it is now possible to use the fringe to > indicate whether the lines were added, deleted, or are common. The face is > omitted in the display property in the case common lines, which leads to the bug > described below. > > Steps to reproduce: > > 1. start emacs -Q > 2. (setq diff-font-lock-prettify t) > 3. to make the bug clearly visible: (set-face-attribute 'fringe nil :background "red" :foreground "yellow") > 4. open a diff file (with "common" lines, that is, lines starting with a space) > 5. observe that the fringe in front of the common lines is red > 6. press C-x C-+, the fringe in front of the common lines is now white > 7. press -, the fringe in front of the common lines is now red again I can reproduce this on current master, and verify that the below change fixes it. I'm not that familiar with diff-mode.ela nor font-locking so it's better that someone else takes a look and installs the fix. > --- diff-mode.el.orig 2020-06-29 17:39:26.000000000 +0000 > +++ diff-mode.el 2020-07-09 18:44:08.000000000 +0000 > @@ -2518,7 +2518,7 @@ > '((?+ . (left-fringe diff-fringe-add diff-indicator-added)) > (?- . (left-fringe diff-fringe-del diff-indicator-removed)) > (?! . (left-fringe diff-fringe-rep diff-indicator-changed)) > - (?\s . (left-fringe diff-fringe-nul)))))) > + (?\s . (left-fringe diff-fringe-nul fringe)))))) > (put-text-property (match-beginning 0) (match-end 0) 'display spec)))) > ;; Mimicks the output of Magit's diff. > ;; FIXME: This has only been tested with Git's diff output. Best regards, Stefan Kangas