]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix tests on Emacs 26 or older
authorStefan Kangas <stefankangas@gmail.com>
Sun, 13 Nov 2022 22:16:05 +0000 (23:16 +0100)
committerStefan Kangas <stefankangas@gmail.com>
Sun, 13 Nov 2022 22:26:44 +0000 (23:26 +0100)
This fixes the following error in Emacs 25.3:

In toplevel form:
bind-key.el:549:1:Error: the function ‘mapcan’ is not known to be defined.

lisp/use-package/bind-key.el

index cca5ad861870a0991522af1d8c36dabb55359769..567ef9e4e855c9631337782a0ababb2416d12f3e 100644 (file)
@@ -223,11 +223,11 @@ See `bind-key' for more details."
 In contrast to `define-key', this function removes the binding from the keymap."
   (define-key keymap key nil)
   ;; Split M-key in ESC key
-  (setq key (mapcan (lambda (k)
-                      (if (and (integerp k) (/= (logand k ?\M-\0) 0))
-                          (list ?\e (logxor k ?\M-\0))
-                        (list k)))
-                    key))
+  (setq key (cl-mapcan (lambda (k)
+                         (if (and (integerp k) (/= (logand k ?\M-\0) 0))
+                             (list ?\e (logxor k ?\M-\0))
+                           (list k)))
+                       key))
   ;; Delete single keys directly
   (if (= (length key) 1)
       (delete key keymap)
@@ -241,7 +241,7 @@ In contrast to `define-key', this function removes the binding from the keymap."
       (delete (last key) submap)
       ;; Delete submap if it is empty
       (when (= 1 (length submap))
-          (bind-key--remove prefix keymap)))))
+        (bind-key--remove prefix keymap)))))
 
 ;;;###autoload
 (defmacro bind-key* (key-name command &optional predicate)