mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-26 07:33:47 +00:00
* doc-view.el (doc-view-scale-reset): Rename from
`doc-view-reset-zoom-level'. (doc-view-scale-adjust): New command. (doc-view-mode-map): Remap `text-scale-adjust' bindings to `doc-view-scale-adjust'.
This commit is contained in:
parent
0550c95a51
commit
529fb53f7e
@ -1,3 +1,11 @@
|
||||
2013-09-27 Tassilo Horn <tsdh@gnu.org>
|
||||
|
||||
* doc-view.el (doc-view-scale-reset): Rename from
|
||||
`doc-view-reset-zoom-level'.
|
||||
(doc-view-scale-adjust): New command.
|
||||
(doc-view-mode-map): Remap `text-scale-adjust' bindings to
|
||||
`doc-view-scale-adjust'.
|
||||
|
||||
2013-09-26 Tassilo Horn <tsdh@gnu.org>
|
||||
|
||||
* doc-view.el (doc-view-reset-zoom-level): New command.
|
||||
|
@ -407,9 +407,8 @@ Typically \"page-%s.png\".")
|
||||
(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)
|
||||
(define-key map "0" 'doc-view-scale-reset)
|
||||
(define-key map [remap text-scale-adjust] 'doc-view-scale-adjust)
|
||||
;; 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)
|
||||
@ -757,7 +756,7 @@ OpenDocument format)."
|
||||
(interactive (list doc-view-shrink-factor))
|
||||
(doc-view-enlarge (/ 1.0 factor)))
|
||||
|
||||
(defun doc-view-reset-zoom-level ()
|
||||
(defun doc-view-scale-reset ()
|
||||
"Reset the document size/zoom level to the initial one."
|
||||
(interactive)
|
||||
(if (and doc-view-scale-internally
|
||||
@ -771,6 +770,24 @@ OpenDocument format)."
|
||||
(kill-local-variable 'doc-view-resolution)
|
||||
(doc-view-reconvert-doc)))
|
||||
|
||||
(defun doc-view-scale-adjust (factor)
|
||||
"Adjust the scale of the DocView page images by FACTOR.
|
||||
FACTOR defaults to `doc-view-shrink-factor'.
|
||||
|
||||
The actual adjustment made depends on the final component of the
|
||||
key-binding used to invoke the command, with all modifiers removed:
|
||||
|
||||
+, = Increase the image scale by FACTOR
|
||||
- Decrease the image scale by FACTOR
|
||||
0 Reset the image scale to the initial scale"
|
||||
(interactive (list doc-view-shrink-factor))
|
||||
(let ((ev last-command-event)
|
||||
(echo-keystrokes nil))
|
||||
(pcase (event-basic-type ev)
|
||||
((or ?+ ?=) (doc-view-enlarge factor))
|
||||
(?- (doc-view-shrink factor))
|
||||
(?0 (doc-view-scale-reset)))))
|
||||
|
||||
(defun doc-view-fit-width-to-window ()
|
||||
"Fit the image width to the window width."
|
||||
(interactive)
|
||||
|
Loading…
Reference in New Issue
Block a user