doc-view: C-c h toggle render DPI 100<->200, re-raster on demand

This commit is contained in:
2026-09-10 12:44:38 -04:00
parent 9001c45e8b
commit 9e8cee187f
2 changed files with 20 additions and 2 deletions

View File

@@ -2896,7 +2896,16 @@ Same page navigation as PDF-Tools (C-j / C-k) for doc-view buffers (renders .doc
:config
(map! :map doc-view-mode-map
:n "C-j" #'doc-view-next-page
:n "C-k" #'doc-view-previous-page))
:n "C-k" #'doc-view-previous-page)
;; Toggle low/high render DPI, re-rasterize this buffer on demand (C-c h)
(defun gortium/docview-toggle-res ()
(interactive)
(let ((new (if (< doc-view-resolution 150) 200 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))
#+end_src
* Custom functions

View File

@@ -1997,7 +1997,16 @@ only injects when the project's context-tag matches current mu4e context."
:config
(map! :map doc-view-mode-map
:n "C-j" #'doc-view-next-page
:n "C-k" #'doc-view-previous-page))
:n "C-k" #'doc-view-previous-page)
;; Toggle low/high render DPI, re-rasterize this buffer on demand (C-c h)
(defun gortium/docview-toggle-res ()
(interactive)
(let ((new (if (< doc-view-resolution 150) 200 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))
;;Refile in datetree function
(defun org-refile-to-datetree (&optional file)