]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/net/browse-url.el (browse-url-button-map): Prefer defvar-keymap.
authorStefan Kangas <stefan@marxist.se>
Tue, 10 May 2022 21:20:52 +0000 (23:20 +0200)
committerStefan Kangas <stefan@marxist.se>
Wed, 11 May 2022 14:12:01 +0000 (16:12 +0200)
lisp/net/browse-url.el

index c563a27ac85f41c23042fa38350eec95a880faa6..362dcf25b557782a6742a938eead687bacda5501 100644 (file)
@@ -1633,13 +1633,11 @@ from `browse-url-elinks-wrapper'."
 
 ;;; Adding buttons to a buffer to call `browse-url' when you hit them.
 
-(defvar browse-url-button-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map "\r" #'browse-url-button-open)
-    (define-key map [mouse-2] #'browse-url-button-open)
-    (define-key map "w" #'browse-url-button-copy)
-    map)
-  "The keymap used for `browse-url' buttons.")
+(defvar-keymap browse-url-button-map
+  :doc "The keymap used for `browse-url' buttons."
+  "RET"       #'browse-url-button-open
+  "<mouse-2>" #'browse-url-button-open
+  "w"         #'browse-url-button-copy)
 
 (defface browse-url-button
   '((t :inherit link))