Colorizing diff output and commit diffs

33 views
Skip to first unread message

John Shahid

unread,
Apr 30, 2016, 1:34:14 PM4/30/16
to magit
Hi all,

I just updated from a really old version of magit v1.4 to the latest version v2.6. I'm using the latest solarized-dark theme. *Note* I'm on latest git sha for magit-mode, color-theme-solarized, and all magit's dependencies.

After the update all the coloring that used to make it easy to read the diff (red for deletion, green for addition) is now gone. The diffs have no highlighting whatsoever. I went through the documentation but all I can find is this section (https://magit.vc/manual/magit/Theming-Faces.html#Theming-Faces) which makes me feel is intended for theme writers and not users.

Being desperate I checked the following faces and they all seem to be set properly but aren't taking effect

1. magit-diff-{added,removed}
2. diff-{added,removed}

Can someone give me pointers to the section of the docs that discuss enabling colors and setting them.

Thanks,

John

Noam Postavsky

unread,
Apr 30, 2016, 11:18:23 PM4/30/16
to John Shahid, magit
On Sat, Apr 30, 2016 at 1:34 PM, John Shahid <jvsh...@gmail.com> wrote:
> Hi all,
>
> I just updated from a really old version of magit v1.4 to the latest version v2.6. I'm using the latest solarized-dark theme. *Note* I'm on latest git sha for magit-mode, color-theme-solarized, and all magit's dependencies.
>
> After the update all the coloring that used to make it easy to read the diff (red for deletion, green for addition) is now gone. The diffs have no highlighting whatsoever.

Maybe it's a color-theme-solarized problem? cf
https://github.com/sellout/emacs-color-theme-solarized/pull/127

John Shahid

unread,
Apr 30, 2016, 11:55:16 PM4/30/16
to Noam Postavsky, magit

Thanks for the pointer I'll check it out.

Jonas Bernoulli

unread,
May 3, 2016, 7:51:20 AM5/3/16
to John Shahid, Noam Postavsky, magit
Also there is an alternative (and I believe more popular) solarized
implementation: https://github.com/bbatsov/solarized-emacs. I use
the light variant of that (and have contributed to it). Except for
the lack of colors in popups I like it. In my fork you can find a
commit which makes the popups more popular.

John Shahid

unread,
May 3, 2016, 6:15:25 PM5/3/16
to Jonas Bernoulli, Noam Postavsky, magit
Thanks Jonas for your suggestion. I tried the theme you pointed me to. I like the colors on that one over the one I'm using. That said, it doesn't seem to be working with `magit`. The diff is still displayed without any color. any thoughts ?

John Shahid

unread,
May 3, 2016, 6:16:15 PM5/3/16
to Jonas Bernoulli, Noam Postavsky, magit
this makes me think that my problem isn't related to the theme but something else, eg. a missing setting in magit

John Shahid

unread,
May 3, 2016, 10:05:29 PM5/3/16
to magit

I finally found the issue with coloring in magit modes. It looks like font-lock mode resets all the faces after magit sets them. The following seem to fix the problem but I’m not sure if this is something that should be fixed in magit or in my emacs setup:

(add-hook 'magit-mode-hook '(lambda ()
                              (font-lock-mode 0))

Thoughts ?

Noam Postavsky

unread,
May 4, 2016, 5:48:02 AM5/4/16
to John Shahid, magit
On Tue, May 3, 2016 at 10:05 PM, John Shahid <jvsh...@gmail.com> wrote:
> I finally found the issue with coloring in magit modes. It looks like
> font-lock mode resets all the faces after magit sets them. The following
> seem to fix the problem but I’m not sure if this is something that should be
> fixed in magit or in my emacs setup:
>
> (add-hook 'magit-mode-hook '(lambda ()
> (font-lock-mode 0))
>
> Thoughts ?

font-lock-mode is t in my magit buffers, so maybe it's some extra
font lock configuration you've added?
Reply all
Reply to author
Forward
0 new messages