doc-view: separate DPI up (C-c h) / down (C-c l)
This commit is contained in:
@@ -2898,16 +2898,26 @@ Same page navigation as PDF-Tools (C-j / C-k) for doc-view buffers (renders .doc
|
||||
:n "C-j" #'doc-view-next-page
|
||||
:n "C-k" #'doc-view-previous-page)
|
||||
|
||||
;; Cycle render DPI 100 -> 200 -> 300 -> 100, re-rasterize this buffer (C-c h)
|
||||
(defun gortium/docview-toggle-res ()
|
||||
;; Render DPI up (C-c h) / down (C-c l), re-rasterize this buffer on demand
|
||||
(defun gortium/docview-res-up ()
|
||||
(interactive)
|
||||
(let ((new (cond ((< doc-view-resolution 150) 200)
|
||||
((< doc-view-resolution 250) 300)
|
||||
(t 300))))
|
||||
(setq-local doc-view-resolution new)
|
||||
(doc-view-reconvert-doc)
|
||||
(message "doc-view @ %s dpi" new)))
|
||||
(defun gortium/docview-res-down ()
|
||||
(interactive)
|
||||
(let ((new (cond ((>= doc-view-resolution 250) 200)
|
||||
((>= doc-view-resolution 150) 100)
|
||||
(t 100))))
|
||||
(setq-local doc-view-resolution new)
|
||||
(doc-view-reconvert-doc)
|
||||
(message "doc-view @ %s dpi" new)))
|
||||
(map! :map doc-view-mode-map :n "C-c h" #'gortium/docview-toggle-res))
|
||||
(map! :map doc-view-mode-map
|
||||
:n "C-c h" #'gortium/docview-res-up
|
||||
:n "C-c l" #'gortium/docview-res-down))
|
||||
#+end_src
|
||||
|
||||
* Custom functions
|
||||
|
||||
@@ -1999,16 +1999,26 @@ only injects when the project's context-tag matches current mu4e context."
|
||||
:n "C-j" #'doc-view-next-page
|
||||
:n "C-k" #'doc-view-previous-page)
|
||||
|
||||
;; Cycle render DPI 100 -> 200 -> 300 -> 100, re-rasterize this buffer (C-c h)
|
||||
(defun gortium/docview-toggle-res ()
|
||||
;; Render DPI up (C-c h) / down (C-c l), re-rasterize this buffer on demand
|
||||
(defun gortium/docview-res-up ()
|
||||
(interactive)
|
||||
(let ((new (cond ((< doc-view-resolution 150) 200)
|
||||
((< doc-view-resolution 250) 300)
|
||||
(t 300))))
|
||||
(setq-local doc-view-resolution new)
|
||||
(doc-view-reconvert-doc)
|
||||
(message "doc-view @ %s dpi" new)))
|
||||
(defun gortium/docview-res-down ()
|
||||
(interactive)
|
||||
(let ((new (cond ((>= doc-view-resolution 250) 200)
|
||||
((>= doc-view-resolution 150) 100)
|
||||
(t 100))))
|
||||
(setq-local doc-view-resolution new)
|
||||
(doc-view-reconvert-doc)
|
||||
(message "doc-view @ %s dpi" new)))
|
||||
(map! :map doc-view-mode-map :n "C-c h" #'gortium/docview-toggle-res))
|
||||
(map! :map doc-view-mode-map
|
||||
:n "C-c h" #'gortium/docview-res-up
|
||||
:n "C-c l" #'gortium/docview-res-down))
|
||||
|
||||
;;Refile in datetree function
|
||||
(defun org-refile-to-datetree (&optional file)
|
||||
|
||||
Reference in New Issue
Block a user