Use cl-mapcan rather than apply 'nconc; thanks wasamasa

This commit is contained in:
John Wiegley 2015-12-20 14:39:33 -08:00
parent 189c8b5422
commit ed2e85e4a7

View file

@ -220,17 +220,15 @@ function symbol (unquoted)."
#'(lambda (m) #'(lambda (m)
`(bind-key ,prefix ',prefix-map ,m)) maps) `(bind-key ,prefix ',prefix-map ,m)) maps)
`((bind-key ,prefix ',prefix-map))))) `((bind-key ,prefix ',prefix-map)))))
(apply (cl-mapcan (lambda (form)
#'nconc (if prefix-map
(mapcar (lambda (form) `((bind-key ,(car form) ',(cdr form) ,prefix-map))
(if prefix-map (if maps
`((bind-key ,(car form) ',(cdr form) ,prefix-map)) (mapcar
(if maps #'(lambda (m)
(mapcar `(bind-key ,(car form) ',(cdr form) ,m)) maps)
#'(lambda (m) `((bind-key ,(car form) ',(cdr form))))))
`(bind-key ,(car form) ',(cdr form) ,m)) maps) key-bindings)))))
`((bind-key ,(car form) ',(cdr form))))))
key-bindings))))))
;;;###autoload ;;;###autoload
(defmacro bind-keys* (&rest args) (defmacro bind-keys* (&rest args)