From: Stefan Kangas Date: Mon, 11 Jul 2022 15:59:25 +0000 (+0200) Subject: Prefer defvar-keymap in thumbs.el X-Git-Tag: emacs-29.0.90~1447^2~1000 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9fe663530c56d3c952e5f3c709d57301c3c076e9;p=emacs.git Prefer defvar-keymap in thumbs.el * lisp/thumbs.el (thumbs-mode-map, thumbs-view-image-mode-map): Prefer defvar-keymap. --- diff --git a/lisp/thumbs.el b/lisp/thumbs.el index 158597d7c8c..3b31f1d8090 100644 --- a/lisp/thumbs.el +++ b/lisp/thumbs.el @@ -704,27 +704,25 @@ ACTION and ARG should be a valid convert command." ;; thumbs-mode -(defvar thumbs-mode-map - (let ((map (make-sparse-keymap))) - (define-key map [return] 'thumbs-find-image-at-point) - (define-key map [mouse-2] 'thumbs-mouse-find-image) - (define-key map [(meta return)] 'thumbs-find-image-at-point-other-window) - (define-key map [(control return)] 'thumbs-set-image-at-point-to-root-window) - (define-key map [delete] 'thumbs-delete-images) - (define-key map [right] 'thumbs-forward-char) - (define-key map [left] 'thumbs-backward-char) - (define-key map [up] 'thumbs-backward-line) - (define-key map [down] 'thumbs-forward-line) - (define-key map "+" 'thumbs-show-more-images) - (define-key map "d" 'thumbs-dired) - (define-key map "m" 'thumbs-mark) - (define-key map "u" 'thumbs-unmark) - (define-key map "R" 'thumbs-rename-images) - (define-key map "x" 'thumbs-delete-images) - (define-key map "s" 'thumbs-show-name) - (define-key map "q" 'thumbs-kill-buffer) - map) - "Keymap for `thumbs-mode'.") +(defvar-keymap thumbs-mode-map + :doc "Keymap for `thumbs-mode'." + "" #'thumbs-find-image-at-point + "" #'thumbs-mouse-find-image + "M-" #'thumbs-find-image-at-point-other-window + "C-" #'thumbs-set-image-at-point-to-root-window + "" #'thumbs-delete-images + "" #'thumbs-forward-char + "" #'thumbs-backward-char + "" #'thumbs-backward-line + "" #'thumbs-forward-line + "+" #'thumbs-show-more-images + "d" #'thumbs-dired + "m" #'thumbs-mark + "u" #'thumbs-unmark + "R" #'thumbs-rename-images + "x" #'thumbs-delete-images + "s" #'thumbs-show-name + "q" #'thumbs-kill-buffer) (put 'thumbs-mode 'mode-class 'special) (define-derived-mode thumbs-mode @@ -732,22 +730,20 @@ ACTION and ARG should be a valid convert command." "Preview images in a thumbnails buffer." (setq buffer-read-only t)) -(defvar thumbs-view-image-mode-map - (let ((map (make-sparse-keymap))) - (define-key map [prior] 'thumbs-previous-image) - (define-key map [next] 'thumbs-next-image) - (define-key map "^" 'thumbs-display-thumbs-buffer) - (define-key map "-" 'thumbs-shrink-image) - (define-key map "+" 'thumbs-enlarge-image) - (define-key map "<" 'thumbs-rotate-left) - (define-key map ">" 'thumbs-rotate-right) - (define-key map "e" 'thumbs-emboss-image) - (define-key map "r" 'thumbs-resize-image) - (define-key map "s" 'thumbs-save-current-image) - (define-key map "q" 'thumbs-kill-buffer) - (define-key map "w" 'thumbs-set-root) - map) - "Keymap for `thumbs-view-image-mode'.") +(defvar-keymap thumbs-view-image-mode-map + :doc "Keymap for `thumbs-view-image-mode'." + "" #'thumbs-previous-image + "" #'thumbs-next-image + "^" #'thumbs-display-thumbs-buffer + "-" #'thumbs-shrink-image + "+" #'thumbs-enlarge-image + "<" #'thumbs-rotate-left + ">" #'thumbs-rotate-right + "e" #'thumbs-emboss-image + "r" #'thumbs-resize-image + "s" #'thumbs-save-current-image + "q" #'thumbs-kill-buffer + "w" #'thumbs-set-root) ;; thumbs-view-image-mode (put 'thumbs-view-image-mode 'mode-class 'special)