diff --git a/doom/.config/doom/README.org b/doom/.config/doom/README.org index 3e97942..69d93ff 100644 --- a/doom/.config/doom/README.org +++ b/doom/.config/doom/README.org @@ -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 diff --git a/doom/.config/doom/config.el b/doom/.config/doom/config.el index 5c8dd98..3e342b4 100644 --- a/doom/.config/doom/config.el +++ b/doom/.config/doom/config.el @@ -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)