diff options
author | jao <jao@gnu.org> | 2021-05-07 00:17:37 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2021-05-07 00:17:37 +0100 |
commit | 6f408bfaf9b3e83bdf553365f4c47c61421c9463 (patch) | |
tree | db3fd8a28a8905b3dff46863cf42c9c6f50f8db8 /init.org | |
parent | de36e74ca760f341506da00c8a1fef60939b66c9 (diff) | |
download | elibs-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.org | 28 |
1 files changed, 24 insertions, 4 deletions
@@ -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 |