diff options
author | jao <jao@gnu.org> | 2021-04-16 13:28:30 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2021-04-16 13:28:55 +0100 |
commit | 99b692839d154cc49d77155c3fe82aa65ebe7d8e (patch) | |
tree | a1c42224e7f703875967c9089a057dec7a326c2c | |
parent | b7902ec1cd8263442baac5450d4153f6dd341ab3 (diff) | |
download | elibs-99b692839d154cc49d77155c3fe82aa65ebe7d8e.tar.gz elibs-99b692839d154cc49d77155c3fe82aa65ebe7d8e.tar.bz2 |
command to open new pdfs
-rw-r--r-- | exwm.org | 13 | ||||
-rw-r--r-- | init.org | 7 |
2 files changed, 17 insertions, 3 deletions
@@ -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") @@ -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) |