From: Gustav Hållberg Date: Mon, 8 Dec 2008 20:24:37 +0000 (+0100) Subject: stgit.el: Compact code for populating stgit-mode-map X-Git-Tag: v0.15-rc1~89 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/022a3664de84fc5cb6b94abb7ae1f27276c88ccf?ds=inline stgit.el: Compact code for populating stgit-mode-map Signed-off-by: Gustav Hållberg Signed-off-by: Karl Hasselström --- diff --git a/contrib/stgit.el b/contrib/stgit.el index fb25a17..9cf909f 100644 --- a/contrib/stgit.el +++ b/contrib/stgit.el @@ -153,29 +153,30 @@ (defvar stgit-mode-map nil (unless stgit-mode-map (setq stgit-mode-map (make-keymap)) (suppress-keymap stgit-mode-map) - (define-key stgit-mode-map " " 'stgit-mark) - (define-key stgit-mode-map "\d" 'stgit-unmark) - (define-key stgit-mode-map "?" 'stgit-help) - (define-key stgit-mode-map "h" 'stgit-help) - (define-key stgit-mode-map "p" 'previous-line) - (define-key stgit-mode-map "n" 'next-line) - (define-key stgit-mode-map "g" 'stgit-reload) - (define-key stgit-mode-map "r" 'stgit-refresh) - (define-key stgit-mode-map "\C-c\C-r" 'stgit-rename) - (define-key stgit-mode-map "e" 'stgit-edit) - (define-key stgit-mode-map "c" 'stgit-coalesce) - (define-key stgit-mode-map "N" 'stgit-new) - (define-key stgit-mode-map "R" 'stgit-repair) - (define-key stgit-mode-map "C" 'stgit-commit) - (define-key stgit-mode-map "U" 'stgit-uncommit) - (define-key stgit-mode-map ">" 'stgit-push-next) - (define-key stgit-mode-map "<" 'stgit-pop-next) - (define-key stgit-mode-map "P" 'stgit-push-or-pop) - (define-key stgit-mode-map "G" 'stgit-goto) - (define-key stgit-mode-map "=" 'stgit-show) - (define-key stgit-mode-map "D" 'stgit-delete) - (define-key stgit-mode-map [(control ?/)] 'stgit-undo) - (define-key stgit-mode-map "\C-_" 'stgit-undo)) + (mapc (lambda (arg) (define-key stgit-mode-map (car arg) (cdr arg))) + '((" " . stgit-mark) + ("\d" . stgit-unmark) + ("?" . stgit-help) + ("h" . stgit-help) + ("p" . previous-line) + ("n" . next-line) + ("g" . stgit-reload) + ("r" . stgit-refresh) + ("\C-c\C-r" . stgit-rename) + ("e" . stgit-edit) + ("c" . stgit-coalesce) + ("N" . stgit-new) + ("R" . stgit-repair) + ("C" . stgit-commit) + ("U" . stgit-uncommit) + (">" . stgit-push-next) + ("<" . stgit-pop-next) + ("P" . stgit-push-or-pop) + ("G" . stgit-goto) + ("=" . stgit-show) + ("D" . stgit-delete) + ([(control ?/)] . stgit-undo) + ("\C-_" . stgit-undo)))) (defun stgit-mode () "Major mode for interacting with StGit.