Change the image-save key binding in pdf-view-mode-map

This commit is contained in:
Gerard Vermeulen 2022-04-20 18:20:08 +02:00
parent a43fd777a8
commit be5a07892e
1 changed files with 11 additions and 4 deletions

View File

@ -1189,9 +1189,9 @@ In order to use [[https://github.com/vedang/pdf-tools][pdf-tools]], you have to
installation of [[https://github.com/vedang/pdf-tools][pdf-tools]] from [[https://melpa.org/][MELPA]] or after each update of [[https://github.com/freedesktop/poppler][poppler]] to build or
rebuild the =epdfinfo= executable that serves the [[https://en.wikipedia.org/wiki/PDF][PDF]] files to Emacs.
#+caption[Enable =pdf-tools=]:
#+caption: Enable =pdf-tools=.
#+name: lst:enable-pdf-tools
#+caption[Configure =pdf-tools=]:
#+caption: Configure =pdf-tools=.
#+name: lst:configure-pdf-tools
#+begin_src emacs-lisp
(when (fboundp 'pdf-loader-install)
;; `pdf-loader-install' is the lazy equivalent of `pdf-tools-install':
@ -1200,7 +1200,14 @@ rebuild the =epdfinfo= executable that serves the [[https://en.wikipedia.org/wik
(with-eval-after-load 'pdf-view
(custom-set-variables
'(pdf-view-display-size 'fit-page))
'(pdf-view-display-size 'fit-page)
`(pdf-view-use-scaling ,(eq system-type 'darwin)))
;; `image-mode-map' is a parent of `pdf-view-mode-map' and
;; `pdf-outline-buffer-mode-map' masks the `image-save' binding in
;; `image-mode-map'.
(define-key pdf-view-mode-map (kbd "o") nil)
(define-key pdf-view-mode-map (kbd "O") #'image-save)
(require 'saveplace-pdf-view nil 'noerror)))
#+end_src