evil-mode has led my cursor to the dark side!

Michael Markert markert.michael at googlemail.com
Mon Jul 16 20:34:13 CEST 2012


Hi Keshav,

On Mon, Jul 16 2012 (04:12), Keshav Kini <keshav.kini at gmail.com> wrote: 

> evil-mode is so evil that it has stained my cursor black, as black as
> the soul of evil-mode!

[...]

> Then I suspected that the theme was just badly designed. But on a hunch,
> I tried commenting out the line "(evil-mode 1)", and restarted
> Emacs. The cursor was white! And running "M-x evil-mode" made it black
> again.

Yes, Evil is the culprit in a way. Here is the relevant code:

    (defcustom evil-default-cursor
      (list (or (frame-parameter nil 'cursor-color) "black") t)
      ...

Which is correct (and keep in mind black is also emacs' default color),
but is only evaluated once.

> How can I fix this? Is it a bug in evil-mode, or am I just doing
> something wrong?

As a workaround: 

   Load the theme before you load evil (not just before enabling!).
   
or

   Set `evil-default-cursor' yourself (Here[1] is a truly evil cursor function).
   
For a less makeshift version I'd suggest either

1) change the default value of `evil-default-cursor' to nil and evaluate
   the code above instead always if `evil-default-cursor' is nil
   
2) advise load-theme and update `evil-default-cursor'

But 2. would only fix color themes.

What do you think? Frank? Vegard?

Michael

Footnotes:

[1] https://github.com/cofi/dotfiles/blob/master/emacs.d/config/cofi-evil.el#L259
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
Url : https://lists.ourproject.org/pipermail/implementations-list/attachments/20120716/5c908a4b/attachment-0001.pgp 


More information about the implementations-list mailing list