summaryrefslogtreecommitdiffhomepage
path: root/attic/misc.org
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-01-24 01:02:46 +0000
committerjao <jao@gnu.org>2022-01-24 01:02:46 +0000
commit3f1ea614b89fd763d0f8cba2f23c3eb12ba49534 (patch)
tree52517701680fe03736b4bdc838e8049280e19690 /attic/misc.org
parent993c3ace44b4dd5753133bd0571eef3327e55e58 (diff)
downloadelibs-3f1ea614b89fd763d0f8cba2f23c3eb12ba49534.tar.gz
elibs-3f1ea614b89fd763d0f8cba2f23c3eb12ba49534.tar.bz2
attic
Diffstat (limited to 'attic/misc.org')
-rw-r--r--attic/misc.org49
1 files changed, 49 insertions, 0 deletions
diff --git a/attic/misc.org b/attic/misc.org
index a5bc802..b9fdbfb 100644
--- a/attic/misc.org
+++ b/attic/misc.org
@@ -965,3 +965,52 @@
(add-hook 'notmuch-show-hook #'jao-notmuch--show-hidden-html))
#+end_src
+* snippets
+ #+begin_src emacs-lisp
+ (defun jao-minibuffer--text-with-padding (text)
+ "Return TEXT with padding on the left."
+ (let* ((len (+ (string-pixel-width text)
+ (string-pixel-width jao-minibuffer-right-margin)
+ 10))
+ (padding (propertize
+ "-" 'display
+ `(space :align-to (- (+ right right-margin) (,len))))))
+ (concat padding text jao-minibuffer-right-margin)))
+ #+end_src
+
+ #+begin_src emacs-lisp
+ ;; 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-mode nil))
+ (other-window 1) (other-window -1)))
+
+ (dolist (f '(image-forward-hscroll
+ image-backward-hscroll
+ image-scroll-down
+ image-scroll-up
+ image-eol
+ image-bol))
+ (advice-add f :after #'jao--refresh))
+
+ ;; (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-forward-hscroll
+ ;; image-backward-hscroll
+ ;; image-scroll-down
+ ;; image-scroll-up
+ ;; image-eol
+ ;; image-bol))
+ ;; (advice-add f :after #'jao--refresh))
+
+ ;; (dolist (f '(pdf-view-scroll-up-or-next-page
+ ;; pdf-view-scroll-down-or-previous-page
+ ;; pdf-view-previous-line-or-previous-page
+ ;; pdf-view-next-line-or-next-page))
+ ;; (advice-add f :after #'jao--refresh))
+ #+end_src