]> git.eshelyaron.com Git - emacs.git/commitdiff
Prefer defvar-keymap in url/*.el
authorStefan Kangas <stefan@marxist.se>
Wed, 25 May 2022 07:43:27 +0000 (09:43 +0200)
committerStefan Kangas <stefan@marxist.se>
Wed, 25 May 2022 07:43:27 +0000 (09:43 +0200)
* 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
lisp/url/url-dired.el

index 6b9ce5da93ecb37babccef30468bb9a15e7f309d..42e1fa22fac6ad4a8d7d12d9f5cb33797ddf342d 100644 (file)
@@ -494,12 +494,10 @@ Use \\<url-cookie-mode-map>\\[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
+  "<delete>" #'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.
index 1bbd741c1a7b9828265046b383ad99912d10976d..e2c23a8b6d9fe4318cef0f4ecfc5a516d8cb56e9 100644 (file)
 
 (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
+  "<mouse-2>" #'url-dired-find-file-mouse)
 
 (defun url-dired-find-file ()
   "In dired, visit the file or directory named on this line."