diff options
| author | Tassilo Horn | 2013-09-26 21:05:50 +0200 |
|---|---|---|
| committer | Tassilo Horn | 2013-09-26 21:05:50 +0200 |
| commit | 0550c95a51cc2861c33980b87c21edbb3415a58c (patch) | |
| tree | a971bb004423a8a72e13d754261c98bf9360163c | |
| parent | 09f62a15c0429d4cc5dd62290d354ea1d282b976 (diff) | |
| download | emacs-0550c95a51cc2861c33980b87c21edbb3415a58c.tar.gz emacs-0550c95a51cc2861c33980b87c21edbb3415a58c.zip | |
* 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).
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/doc-view.el | 18 |
2 files changed, 24 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 73d3cd973b6..512fff9988e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2013-09-26 Tassilo Horn <tsdh@gnu.org> | ||
| 2 | |||
| 3 | * doc-view.el (doc-view-reset-zoom-level): New command. | ||
| 4 | (doc-view-mode-map): Remap text-scale-adjust bindings to doc-view | ||
| 5 | zoom commands (bug#15466). | ||
| 6 | |||
| 1 | 2013-09-26 Kenichi Handa <handa@gnu.org> | 7 | 2013-09-26 Kenichi Handa <handa@gnu.org> |
| 2 | 8 | ||
| 3 | * international/quail.el (quail-help): Make it not a command. | 9 | * international/quail.el (quail-help): Make it not a command. |
diff --git a/lisp/doc-view.el b/lisp/doc-view.el index cbf4d0bda31..9f3ac3293bc 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el | |||
| @@ -405,7 +405,11 @@ Typically \"page-%s.png\".") | |||
| 405 | (define-key map (kbd "RET") 'image-next-line) | 405 | (define-key map (kbd "RET") 'image-next-line) |
| 406 | ;; Zoom in/out. | 406 | ;; Zoom in/out. |
| 407 | (define-key map "+" 'doc-view-enlarge) | 407 | (define-key map "+" 'doc-view-enlarge) |
| 408 | (define-key map "=" 'doc-view-enlarge) | ||
| 408 | (define-key map "-" 'doc-view-shrink) | 409 | (define-key map "-" 'doc-view-shrink) |
| 410 | (define-key map [remap text-scale-adjust] 'doc-view-enlarge) | ||
| 411 | (define-key map (kbd "C-x C--") 'doc-view-shrink) | ||
| 412 | (define-key map (kbd "C-x C-0") 'doc-view-reset-zoom-level) | ||
| 409 | ;; Fit the image to the window | 413 | ;; Fit the image to the window |
| 410 | (define-key map "W" 'doc-view-fit-width-to-window) | 414 | (define-key map "W" 'doc-view-fit-width-to-window) |
| 411 | (define-key map "H" 'doc-view-fit-height-to-window) | 415 | (define-key map "H" 'doc-view-fit-height-to-window) |
| @@ -753,6 +757,20 @@ OpenDocument format)." | |||
| 753 | (interactive (list doc-view-shrink-factor)) | 757 | (interactive (list doc-view-shrink-factor)) |
| 754 | (doc-view-enlarge (/ 1.0 factor))) | 758 | (doc-view-enlarge (/ 1.0 factor))) |
| 755 | 759 | ||
| 760 | (defun doc-view-reset-zoom-level () | ||
| 761 | "Reset the document size/zoom level to the initial one." | ||
| 762 | (interactive) | ||
| 763 | (if (and doc-view-scale-internally | ||
| 764 | (eq (plist-get (cdr (doc-view-current-image)) :type) | ||
| 765 | 'imagemagick)) | ||
| 766 | (progn | ||
| 767 | (kill-local-variable 'doc-view-image-width) | ||
| 768 | (doc-view-insert-image | ||
| 769 | (plist-get (cdr (doc-view-current-image)) :file) | ||
| 770 | :width doc-view-image-width)) | ||
| 771 | (kill-local-variable 'doc-view-resolution) | ||
| 772 | (doc-view-reconvert-doc))) | ||
| 773 | |||
| 756 | (defun doc-view-fit-width-to-window () | 774 | (defun doc-view-fit-width-to-window () |
| 757 | "Fit the image width to the window width." | 775 | "Fit the image width to the window width." |
| 758 | (interactive) | 776 | (interactive) |