doc-view: cycle render DPI 100/200/300 on C-c h

This commit is contained in:
2026-09-10 12:48:34 -04:00
parent 9e8cee187f
commit edb61931ee
2 changed files with 8 additions and 4 deletions

View File

@@ -2898,10 +2898,12 @@ 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)
;; Toggle low/high render DPI, re-rasterize this buffer on demand (C-c h)
;; Cycle render DPI 100 -> 200 -> 300 -> 100, re-rasterize this buffer (C-c h)
(defun gortium/docview-toggle-res ()
(interactive)
(let ((new (if (< doc-view-resolution 150) 200 100)))
(let ((new (cond ((< doc-view-resolution 150) 200)
((< doc-view-resolution 250) 300)
(t 100))))
(setq-local doc-view-resolution new)
(doc-view-reconvert-doc)
(message "doc-view @ %s dpi" new)))

View File

@@ -1999,10 +1999,12 @@ 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)
;; Toggle low/high render DPI, re-rasterize this buffer on demand (C-c h)
;; Cycle render DPI 100 -> 200 -> 300 -> 100, re-rasterize this buffer (C-c h)
(defun gortium/docview-toggle-res ()
(interactive)
(let ((new (if (< doc-view-resolution 150) 200 100)))
(let ((new (cond ((< doc-view-resolution 150) 200)
((< doc-view-resolution 250) 300)
(t 100))))
(setq-local doc-view-resolution new)
(doc-view-reconvert-doc)
(message "doc-view @ %s dpi" new)))