From: Gregory Heytings via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 42300@debbugs.gnu.org
Subject: bug#42300: Visual bug in diff-mode
Date: Thu, 9 Jul 2020 21:23:36 +0200 (CEST) [thread overview]
Message-ID: <alpine.NEB.2.21.2007092107000394.24274@sdf.lonestar.org> (raw)
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
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.
next reply other threads:[~2020-07-09 19:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-09 19:23 Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2020-08-13 16:23 ` bug#42300: Visual bug in diff-mode Stefan Kangas
2020-08-14 15:33 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.NEB.2.21.2007092107000394.24274@sdf.lonestar.org \
--to=bug-gnu-emacs@gnu.org \
--cc=42300@debbugs.gnu.org \
--cc=ghe@sdf.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.