From: Stefan Kangas Date: Fri, 13 Dec 2024 03:40:02 +0000 (+0100) Subject: Prefer defvar-keymap in dired.el X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=37e144598404a9c6542bf1482295adf066bea9d1;p=emacs.git Prefer defvar-keymap in dired.el * lisp/dired.el (dired-mouse-drag-files-map) (dired-click-to-select-map): Convert to defvar-keymap. (cherry picked from commit 65aa5608f2c02bb90742d4d176c61182915f7755) --- diff --git a/lisp/dired.el b/lisp/dired.el index 8999c55004b..18a2c375923 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -1955,13 +1955,12 @@ other marked file as well. Otherwise, unmark all files." ;; a remote file. (user-error (cadr error))))))))))) -(defvar dired-mouse-drag-files-map (let ((keymap (make-sparse-keymap))) - (define-key keymap [down-mouse-1] #'dired-mouse-drag) - (define-key keymap [C-down-mouse-1] #'dired-mouse-drag) - (define-key keymap [S-down-mouse-1] #'dired-mouse-drag) - (define-key keymap [M-down-mouse-1] #'dired-mouse-drag) - keymap) - "Keymap applied to file names when `dired-mouse-drag-files' is enabled.") +(defvar-keymap dired-mouse-drag-files-map + :doc "Keymap applied to file names when `dired-mouse-drag-files' is enabled." + "" #'dired-mouse-drag + "C-" #'dired-mouse-drag + "S-" #'dired-mouse-drag + "M-" #'dired-mouse-drag) (defvar dired-click-to-select-mode) (defvar dired-click-to-select-map) @@ -5282,8 +5281,8 @@ Interactively with prefix argument, read FILE-NAME." ;;; Click-To-Select mode -(defvar dired-click-to-select-map (make-sparse-keymap) - "Keymap placed on files under `dired-click-to-select' mode.") +(defvar-keymap dired-click-to-select-map + :doc "Keymap placed on files under `dired-click-to-select' mode.") (define-key dired-click-to-select-map [mouse-2] #'dired-mark-for-click)