diff options
author | jao <jao@gnu.org> | 2021-07-05 00:35:06 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2021-07-05 00:35:06 +0100 |
commit | 5bfb044219160f0ac6520d2c88d9f0949d4e3aa8 (patch) | |
tree | f5366983195a733fd7ca631b76b2aaaba119deae | |
parent | 666d7d94655a3b9151504b9550411feb845c7b96 (diff) | |
download | elibs-5bfb044219160f0ac6520d2c88d9f0949d4e3aa8.tar.gz elibs-5bfb044219160f0ac6520d2c88d9f0949d4e3aa8.tar.bz2 |
navigating zathura and pdf buffers together
-rw-r--r-- | exwm.org | 23 |
1 files changed, 12 insertions, 11 deletions
@@ -290,11 +290,11 @@ #+END_SRC * Zathura support #+begin_src emacs-lisp + (defun jao-zathura--buffer-p (b) + (string= "Zathura" (or (buffer-local-value 'exwm-class-name b) ""))) + (defun jao-zathura--buffers () - (seq-filter (lambda (b) - (string= "Zathura" - (or (buffer-local-value 'exwm-class-name b) ""))) - (buffer-list))) + (seq-filter #'jao-zathura--buffer-p (buffer-list))) (defun jao-zathura--file-info (b) (with-current-buffer b @@ -396,13 +396,14 @@ (defun jao-exwm-select-pdf () (interactive) - (if jao-browse-doc-use-emacs-p - (jao-buffer-same-mode '(pdf-view-mode doc-view-mode) - #'jao-afio--goto-docs) - (when-let (bs (jao-zathura--buffers)) - (let ((infos (mapcar #'jao-zathura--file-info bs))) - (when-let (f (completing-read "Document: " (mapcar #'car infos))) - (jao-zathura-open-doc f)))))) + (let ((b (read-buffer "Document: " nil t + (lambda (b) + (let ((b (cdr b))) + (or (jao-zathura--buffer-p b) + (member (buffer-local-value 'major-mode b) + '(pdf-view-mode doc-view-mode)))))))) + (jao-afio--goto-docs) + (pop-to-buffer b))) #+end_src * Hydras |