From: Dmitry Gutov Date: Mon, 24 Sep 2012 22:06:43 +0000 (+0400) Subject: Use map-keymap X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/aeb05382b6d7a12f6263706207a1fe9bd868150f Use map-keymap --- diff --git a/diff-hl.el b/diff-hl.el index 11667c3c5..d237da454 100644 --- a/diff-hl.el +++ b/diff-hl.el @@ -326,10 +326,16 @@ in the source file, or the last line of the hunk above it." (when (require 'smartrep nil t) (let (smart-keys) - (dolist (c '("n" "[" "]")) - (let* ((cmd (lookup-key diff-hl-mode-map (kbd (concat "C-x v " c))))) - (push (cons c cmd) smart-keys))) - (smartrep-define-key diff-hl-mode-map "C-x v" smart-keys))) + (cl-labels ((scan (map) + (map-keymap + (lambda (event binding) + (if (consp binding) + (scan binding) + (when (characterp event) + (push (cons (string event) binding) smart-keys)))) + map))) + (scan diff-hl-mode-map) + (smartrep-define-key diff-hl-mode-map "C-x v" smart-keys)))) (defun diff-hl-dir-update () (dolist (pair (if (vc-dir-marked-files)