]> git.eshelyaron.com Git - emacs.git/commitdiff
Prefer keymap inheritance in shr-image-map
authorStefan Kangas <stefan@marxist.se>
Thu, 7 Jul 2022 15:25:39 +0000 (17:25 +0200)
committerStefan Kangas <stefan@marxist.se>
Thu, 7 Jul 2022 21:21:39 +0000 (23:21 +0200)
* lisp/net/shr.el (shr-image-map): Replace copy-keymap with
inheritance.

lisp/net/shr.el

index 63f313bbf44fccd1227f6f493d171294a46b71b8..c4f0d3b940439bef9bbc64148512a9ad70678621 100644 (file)
@@ -290,11 +290,10 @@ and other things:
   "O" #'shr-save-contents
   "RET" #'shr-browse-url)
 
-(defvar shr-image-map
-  (let ((map (copy-keymap shr-map)))
-    (when (boundp 'image-map)
-      (set-keymap-parent map image-map))
-    map))
+(defvar-keymap shr-image-map
+  :parent (if (boundp 'image-map)
+              (make-composed-keymap shr-map image-map)
+            shr-map))
 
 ;; Public functions and commands.
 (declare-function libxml-parse-html-region "xml.c"