1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-26 07:33:47 +00:00

* doc-view.el (doc-view-reset-zoom-level): New command.

(doc-view-mode-map): Remap text-scale-adjust bindings to doc-view
zoom commands (bug#15466).
This commit is contained in:
Tassilo Horn 2013-09-26 21:05:50 +02:00
parent 09f62a15c0
commit 0550c95a51
2 changed files with 24 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2013-09-26 Tassilo Horn <tsdh@gnu.org>
* doc-view.el (doc-view-reset-zoom-level): New command.
(doc-view-mode-map): Remap text-scale-adjust bindings to doc-view
zoom commands (bug#15466).
2013-09-26 Kenichi Handa <handa@gnu.org>
* international/quail.el (quail-help): Make it not a command.

View File

@ -405,7 +405,11 @@ Typically \"page-%s.png\".")
(define-key map (kbd "RET") 'image-next-line)
;; Zoom in/out.
(define-key map "+" 'doc-view-enlarge)
(define-key map "=" 'doc-view-enlarge)
(define-key map "-" 'doc-view-shrink)
(define-key map [remap text-scale-adjust] 'doc-view-enlarge)
(define-key map (kbd "C-x C--") 'doc-view-shrink)
(define-key map (kbd "C-x C-0") 'doc-view-reset-zoom-level)
;; Fit the image to the window
(define-key map "W" 'doc-view-fit-width-to-window)
(define-key map "H" 'doc-view-fit-height-to-window)
@ -753,6 +757,20 @@ OpenDocument format)."
(interactive (list doc-view-shrink-factor))
(doc-view-enlarge (/ 1.0 factor)))
(defun doc-view-reset-zoom-level ()
"Reset the document size/zoom level to the initial one."
(interactive)
(if (and doc-view-scale-internally
(eq (plist-get (cdr (doc-view-current-image)) :type)
'imagemagick))
(progn
(kill-local-variable 'doc-view-image-width)
(doc-view-insert-image
(plist-get (cdr (doc-view-current-image)) :file)
:width doc-view-image-width))
(kill-local-variable 'doc-view-resolution)
(doc-view-reconvert-doc)))
(defun doc-view-fit-width-to-window ()
"Fit the image width to the window width."
(interactive)