branch: elpa/evil
commit ba04ab8ce5a11e103d7343582b266b2f83cc752b
Author: Tim Ruffing <[email protected]>
Commit: Tom Dalziel <[email protected]>

    Fix disabling the cursor
    
    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.
---
 evil-common.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/evil-common.el b/evil-common.el
index 5ffc1313fe..74c0d84b63 100644
--- a/evil-common.el
+++ b/evil-common.el
@@ -731,10 +731,12 @@ filename."
   "Change the cursor's apperance according to SPECS.
 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."
-  (unless (and (not (functionp specs))
-               (listp specs)
-               (null (cdr-safe (last specs))))
+function for changing the cursor, or a non-empty list of the above."
+  ;; if it's a single spec, wrap it in a list
+  (when (or (functionp specs)
+            (null specs)
+            (not (listp specs))
+            (cdr-safe (last specs)))
     (setq specs (list specs)))
   (dolist (spec specs)
     (cond

Reply via email to