tools/pdf: only prompt to build epdfinfo once
Fixes regression mentioned in #1788
This commit is contained in:
parent
d17616e835
commit
f11979ed76
1 changed files with 27 additions and 26 deletions
|
@ -33,8 +33,8 @@
|
||||||
;; Prevent "epdfinfo not an executable" error short-circuiting this advice
|
;; Prevent "epdfinfo not an executable" error short-circuiting this advice
|
||||||
(prog1 (with-demoted-errors "%s" (apply orig-fn args))
|
(prog1 (with-demoted-errors "%s" (apply orig-fn args))
|
||||||
;; ...so we can go ahead and install it afterwards.
|
;; ...so we can go ahead and install it afterwards.
|
||||||
(if (not (y-or-n-p "To read PDFs in Emacs the epdfinfo program must be built. Build it now?"))
|
(cond ((file-executable-p pdf-info-epdfinfo-program))
|
||||||
(message "Aborted")
|
((y-or-n-p "To read PDFs in Emacs the epdfinfo program must be built. Build it now?")
|
||||||
(message nil) ; flush lingering prompt in echo-area
|
(message nil) ; flush lingering prompt in echo-area
|
||||||
;; Make sure this doesn't run more than once
|
;; Make sure this doesn't run more than once
|
||||||
(advice-remove #'pdf-view-mode #'+pdf--install-epdfinfo-a)
|
(advice-remove #'pdf-view-mode #'+pdf--install-epdfinfo-a)
|
||||||
|
@ -58,7 +58,8 @@
|
||||||
(and (buffer-file-name)
|
(and (buffer-file-name)
|
||||||
(or (pdf-tools-pdf-buffer-p)
|
(or (pdf-tools-pdf-buffer-p)
|
||||||
(derived-mode-p 'pdf-view-mode))
|
(derived-mode-p 'pdf-view-mode))
|
||||||
(revert-buffer t t))))))))))))
|
(revert-buffer t t))))))))))
|
||||||
|
((message "Aborted")))))
|
||||||
|
|
||||||
;; For consistency with other special modes
|
;; For consistency with other special modes
|
||||||
(map! :map pdf-view-mode-map :gn "q" #'kill-current-buffer)
|
(map! :map pdf-view-mode-map :gn "q" #'kill-current-buffer)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue