From 068339e7e6af525d6b94ebd74870828f7372981e Mon Sep 17 00:00:00 2001 From: Steve Purcell and Cornelius Mika Date: Mon, 1 Apr 2013 14:18:54 +0100 Subject: [PATCH] [Refactor] parse-keymap Use `push'. Explicitly pass the output variable `commands'. --- smex.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/smex.el b/smex.el index 9892fde..0895ca6 100644 --- a/smex.el +++ b/smex.el @@ -436,16 +436,16 @@ Returns nil when reaching the end of the list." (defun smex-extract-commands-from-keymap (map) (let (commands) - (smex-parse-keymap map) + (smex-parse-keymap map commands) commands)) -(defun smex-parse-keymap (map) +(defun smex-parse-keymap (map commands) (map-keymap (lambda (binding element) (if (and (listp element) (eq 'keymap (car element))) - (smex-parse-keymap element) + (smex-parse-keymap element commands) ; Strings are commands, too. Reject them. (if (and (symbolp element) (commandp element)) - (setq commands (cons element commands))))) + (push element commands)))) map)) (defun smex-extract-commands-from-features (mode)