Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
patch for evil-register-list when there are non-numeric registers
# HG changeset patch
# User dancluna@dcl-notebook
# Date 1439007089 10800
# Sat Aug 08 01:11:29 2015 -0300
# Node ID 90103760c012a319827006b4957fcd1b370b2d7d
# Parent 565bb35acf785f28abd654eba4cc34ef96a1c6ac
Removing list-like entries from register-alist in calls to evil-register-list, to avoid errors with window/frame configuration objects saved in registers.
diff -r 565bb35acf78 -r 90103760c012 evil-common.el
--- a/evil-common.el Mon Jul 06 16:12:31 2015 +0200
+++ b/evil-common.el Sat Aug 08 01:11:29 2015 -0300
@@ -2144,7 +2144,8 @@
(cons reg (evil-get-register reg t)))
'(?\" ?* ?+ ?% ?# ?/ ?: ?. ?-
?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9))
- register-alist nil)
+ ;; remove the entries whose car is not a number
+ (delq nil (mapcar (lambda (reg) (and (number-or-marker-p (car reg)) reg)) register-alist)) nil
#'(lambda (reg1 reg2) (< (car reg1) (car reg2)))))
(defsubst evil-kbd-macro-suppress-motion-error ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment