(setq mode-name "DocView"
buffer-read-only t
major-mode 'doc-view-mode)
- (doc-view-imenu-setup)
+ (condition-case imenu-error
+ (doc-view-imenu-setup)
+ (imenu-unavailable (message "imenu support unavailable: %s"
+ (cadr imenu-error))))
(doc-view-initiate-display)
+ ;; Replace the tool bar map with `doc-view-tool-bar-map'.
+ (setq-local tool-bar-map doc-view-tool-bar-map)
;; Switch off view-mode explicitly, because doc-view-mode is the
;; canonical view mode for PDF/PS/DVI files. This could be
;; switched on automatically depending on the value of