GNU bug report logs - #33567
Syntactic fontification of diff hunks

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Sat, 1 Dec 2018 22:13:02 UTC

Severity: wishlist

Tags: patch

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 33567 <at> debbugs.gnu.org
Subject: bug#33567: Syntactic fontification of diff hunks
Date: Fri, 21 Dec 2018 00:17:04 +0200
>> Neither GitHub nor GitLab have foreground green/red colors, only background
>> green/red colors.
>
> Speaking of GitHub and GitLab, I wonder if we should take another cue from
> them and tone down our background colors as well.
>
> This makes the new diffs more readable for me:
>
> (eval-after-load 'diff-mode
>   '(progn
>      (set-face-background 'diff-added "#eeffee")
>      (set-face-background 'diff-removed "#ffeeee")
>      (set-face-background 'diff-refine-added "#d0ffd0")
>      (set-face-background 'diff-refine-removed "#ffd0d0")
>      ))

Good idea.

But please see in https://debbugs.gnu.org/10181#68
why red and green colors are not symmetrical and
how is was wrong on GitHub.

After my post GitHub realized their mistake and
now they use #fbb instead of #faa.

So instead of #cfc a better color for refine-added is #bfb.

Here's a table with additional columns labeled "appr" (approximated)
where colors are rounded to the closest shorthand hex triplet:

               GitHub  appr  GitLab  appr  current new     better
       removed #ffeef0 #fee  #fbe9eb #fee  #ffdddd #ffeeee
         added #e6ffed #efe  #ecfdf0 #efe  #ddffdd #eeffee
refine-removed #fdb8c0 #fbb  #fac5cd #fcc  #ffbbbb #ffd0d0 #ffcccc
  refine-added #acf2bd #aeb  #c7f0d2 #cec  #aaffaa #d0ffd0 #bbffbb

Your proposed new colors for added/removed are the same that are used
GitHub/GitLab, so this should be a good change.  For refine-removed
better to use GitLab's color #ffcccc that is very close to the
color you proposed.  But for refine-added GitLab made the same mistake
that GitHub already fixed.  So the best color for refine-added is #bbffbb.

While at it, please also tone down file/hunk header colors:
diff-header from grey80 to grey90 and
diff-file-header from grey70 to grey80

This will produce nice-looking colors.




This bug report was last modified 6 years and 146 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.