The short answer is that powerline
and delight
are not directly compatible; but I've made a change to delight
(new version 1.04) to make such integration possible in general, and I've added a delight-powerline
library which builds on top of that to handle powerline specifically.
Original answer follows...
Well I tried your config. My first comment is that you seem to be specifying the default mode names in most of your :delight specs, which is kinda weird. e.g. org-mode already uses "Org" as its mode-name -- there's surely very little point in using :delight org-mode "Org"
.
However I can confirm that delight is still working for major modes with powerline enabled, because if I visit an org-mode buffer and check mode-name
it tells me (inhibit-mode-name-delight "Org" "Org")
(normally those two values wouldn't be identical, of course, but see above...)
This is delight's way of getting the mode line to show the delighted value without also showing that custom value in other contexts (e.g. M-x describe-mode
which also displays mode-name
).
This suggests to me that powerline is calling format-mode-line
explicitly, which is delight's trigger (via advice) to show the original version of the name. (n.b. It's slightly unintuitive, but format-mode-line
is not called by the normal mode-line display code, but provided so that other things can render mode line constructs.)
That's an incompatibility between the two libraries, I'm afraid.
You can disable delight's advice (after it has been loaded) like so:
(ad-disable-advice 'format-mode-line 'around 'delighted-modes-are-glum)
(ad-activate 'format-mode-line)
This will fix your powerline output, but also means that anything else which displays a major mode's mode-name will also show the delighted version. That's probably still preferable for you, though.
Better would be some advice to act only when powerline is being called. This wasn't an option for the standard mode line rendering, but could certainly be done for cases like this.
I've uploaded a delight-powerline.el
integration library to the EmacsWiki.
Note that it requires the equally-new version 1.04 of delight.el
.