summaryrefslogtreecommitdiffhomepage
path: root/init.org
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-05-07 00:17:37 +0100
committerjao <jao@gnu.org>2021-05-07 00:17:37 +0100
commit6f408bfaf9b3e83bdf553365f4c47c61421c9463 (patch)
treedb3fd8a28a8905b3dff46863cf42c9c6f50f8db8 /init.org
parentde36e74ca760f341506da00c8a1fef60939b66c9 (diff)
downloadelibs-6f408bfaf9b3e83bdf553365f4c47c61421c9463.tar.gz
elibs-6f408bfaf9b3e83bdf553365f4c47c61421c9463.tar.bz2
that thing about docview not redisplaying with minibuffer active
Diffstat (limited to 'init.org')
-rw-r--r--init.org28
1 files changed, 24 insertions, 4 deletions
diff --git a/init.org b/init.org
index f56037b..b8c02cf 100644
--- a/init.org
+++ b/init.org
@@ -1610,12 +1610,32 @@
doc-view-resolution 110
doc-view-continuous t
doc-view-conversion-refresh-interval 1)
+
+ :config
+
+ ;; this is an ugly hack: when jao-minibuffer is active,
+ ;; somehow docview scrolling is not triggering a refresh,
+ ;; specially for scroll down movements, so we advice the
+ ;; scrolling functions to force a redisplay by going to
+ ;; another window.
+
+ (defun jao--refresh (&rest _rest)
+ (let ((jao-minibuffer-enabled-p nil))
+ (other-window 1) (other-window -1)))
+
+ (dolist (f '(doc-view-scroll-up-or-next-page
+ doc-view-scroll-down-or-previous-page
+ doc-view-previous-line-or-previous-page
+ doc-view-next-line-or-next-page
+ image-eol
+ image-bol))
+ (advice-add f :after #'jao--refresh))
+
:bind (:map doc-view-mode-map
("j" . doc-view-next-line-or-next-page)
- ("k" . doc-view-previous-line-or-previous-page))
- :custom ((mailcap-user-mime-data
- '((doc-view-mode "application/pdf" jao-browse-doc-use-emacs-p)
- ("zathura %s" "application/pdf")))))
+ ("J" . doc-view-scroll-up-or-next-page)
+ ("k" . doc-view-previous-line-or-previous-page)
+ ("K" . doc-view-scroll-down-or-previous-page)))
(use-package jao-doc-view
:bind (:map doc-view-mode-map