Don't use image-map if it isn't defined

* lisp/net/shr.el (shr-image-map): Only use image-map as a
parent if it's defined (bug#22614).
This commit is contained in:
Lars Ingebrigtsen 2016-02-11 14:51:49 +11:00
parent 980836d80e
commit 395f2ad689

View file

@ -189,11 +189,10 @@ and other things:
(define-key map "\r" 'shr-browse-url)
map))
(defvar image-map nil) ;in case image.el is not pre-loaded
(defvar shr-image-map
(let ((map (copy-keymap shr-map)))
(set-keymap-parent map image-map)
(when (boundp 'image-map)
(set-keymap-parent map image-map))
map))
;; Public functions and commands.