From f437ddf2e9d8b0e6e04d639343c717a0096f1090 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 25 May 2022 09:43:27 +0200 Subject: [PATCH] Prefer defvar-keymap in url/*.el * lisp/url/url-cookie.el (url-cookie-mode-map): * lisp/url/url-dired.el (url-dired-minor-mode-map): Prefer defvar-keymap. --- lisp/url/url-cookie.el | 10 ++++------ lisp/url/url-dired.el | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/lisp/url/url-cookie.el b/lisp/url/url-cookie.el index 6b9ce5da93e..42e1fa22fac 100644 --- a/lisp/url/url-cookie.el +++ b/lisp/url/url-cookie.el @@ -494,12 +494,10 @@ Use \\\\[url-cookie-delete] to remove cookies." (url-cookie--generate-buffer) (goto-char point)))) -(defvar url-cookie-mode-map - (let ((map (make-sparse-keymap))) - (define-key map [delete] 'url-cookie-delete) - (define-key map [(control k)] 'url-cookie-delete) - (define-key map [(control _)] 'url-cookie-undo) - map)) +(defvar-keymap url-cookie-mode-map + "" #'url-cookie-delete + "C-k" #'url-cookie-delete + "C-_" #'url-cookie-undo) (define-derived-mode url-cookie-mode special-mode "URL Cookie" "Mode for listing cookies. diff --git a/lisp/url/url-dired.el b/lisp/url/url-dired.el index 1bbd741c1a7..e2c23a8b6d9 100644 --- a/lisp/url/url-dired.el +++ b/lisp/url/url-dired.el @@ -25,12 +25,10 @@ (autoload 'dired-get-filename "dired") -(defvar url-dired-minor-mode-map - (let ((map (make-sparse-keymap))) - (define-key map "\C-m" 'url-dired-find-file) - (define-key map [mouse-2] 'url-dired-find-file-mouse) - map) - "Keymap used when browsing directories.") +(defvar-keymap url-dired-minor-mode-map + :doc "Keymap used when browsing directories." + "C-m" #'url-dired-find-file + "" #'url-dired-find-file-mouse) (defun url-dired-find-file () "In dired, visit the file or directory named on this line." -- 2.39.2