summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--exwm.org13
-rw-r--r--init.org7
2 files changed, 17 insertions, 3 deletions
diff --git a/exwm.org b/exwm.org
index 96e3ecf..eb8e81e 100644
--- a/exwm.org
+++ b/exwm.org
@@ -394,6 +394,15 @@
(when (not jao-browse-doc-use-emacs-p)
(jao-exwm-pdf-enable-zathura))
+ (defun jao-exwm-select-pdf ()
+ (interactive)
+ (if jao-browse-doc-use-emacs-p
+ (jao-buffer-same-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))))))
+
#+end_src
* Hydras
#+begin_src emacs-lisp
@@ -442,8 +451,8 @@
("Notes"
(("n" jao-org-notes-open-or-create "capture note")
("N" jao-org-notes-open "go to note")
- ("d" (jao-buffer-same-mode 'doc-view-mode #'jao-afio--goto-docs)
- "go to doc"))
+ ("d" jao-exwm-select-pdf "go to doc")
+ ("D" jao-open-doc "open to doc"))
"Packages"
(("a" jao-vterm-aptitude "aptitude")
("l" jao-exwm-paradox "packages")
diff --git a/init.org b/init.org
index 09d07af..754ca30 100644
--- a/init.org
+++ b/init.org
@@ -2212,7 +2212,12 @@
(jao-afio--goto-docs)
(if b (pop-to-buffer b) (find-file file))))
- (defun jao-open-doc (file) (funcall jao-open-doc-fun file))
+ (defun jao-open-doc (&optional file)
+ (interactive)
+ (when-let (file (or file
+ (read-file-name "Document: "
+ (concat jao-org-dir "/doc/"))))
+ (funcall jao-open-doc-fun file)))
(defun jao-open-pdf-session ()
(interactive)