Skip to content

Fix disabling the cursor - #2016

Merged
tomdl89 merged 1 commit into
emacs-evil:masterfrom
real-or-random:202604-nil-cursor-type
Jun 2, 2026
Merged

tomdl89 merged 1 commit into
emacs-evil:masterfrom
real-or-random:202604-nil-cursor-type

Conversation

@real-or-random

Copy link
Copy Markdown
Contributor

Without this, evil-set-cursor treats nil as an empty list of specs (i.e., a noop). But nil is a valid single spec; namely it's a valid value of the cursor-type variable, which means "don't show a cursor".

This also inverts rewrites the logic to use (when (or ...)) instead of (unless (and ...)) because that's much more readable, at least to me.

Fixes #592.

Comment thread evil-common.el Outdated
@@ -732,9 +732,11 @@ filename."
SPECS may be a cursor type as per `cursor-type', a color
string as passed to `set-cursor-color', a zero-argument
function for changing the cursor, or a list of the above."

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the doc should be updated too.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to do that once some maintainer shows interest in this PR

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, update the docstring and I'll merge

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I force-pushed to make it clear that only non-empty lists are interpreted as lists. Let me know if you're happy with that change.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you!

Without this, evil-set-cursor treats nil as an empty list of specs
(i.e., a noop). But nil is a valid single spec; namely it's a valid
value of the cursor-type variable, which means "don't show a cursor".

This also inverts rewrites the logic to use (when (or ...)) instead
of (unless (and ...)) because that's much more readable, at least to me.

Fixes emacs-evil#592.
@real-or-random
real-or-random force-pushed the 202604-nil-cursor-type branch from 006dc3e to df13e78 Compare June 2, 2026 06:47
@tomdl89
tomdl89 merged commit ba04ab8 into emacs-evil:master Jun 2, 2026
12 checks passed
@real-or-random

Copy link
Copy Markdown
Contributor Author

For posterity: This was reverted in 30c8894; see the discussion in #592.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Evil makes hidden cursor reappear on window configuration changes

3 participants