diff options
author | jao <jao@gnu.org> | 2022-05-20 23:16:49 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-05-20 23:16:49 +0100 |
commit | 536bfb591b5302c624f65fc524591a5625d33623 (patch) | |
tree | 034f9248b09bff41e3938e7a955ee911eb9a6903 | |
parent | 87bde37d0fff93729813d722ac4db68c15455122 (diff) | |
download | elibs-536bfb591b5302c624f65fc524591a5625d33623.tar.gz elibs-536bfb591b5302c624f65fc524591a5625d33623.tar.bz2 |
wee refactoring
-rw-r--r-- | exwm.org | 2 | ||||
-rw-r--r-- | init.org | 19 |
2 files changed, 10 insertions, 11 deletions
@@ -403,7 +403,7 @@ (interactive) (define-key org-mode-map (kbd "C-c o") #'jao-org-org-goto-pdf) (remove-hook 'kill-emacs-query-functions #'jao-exwm-pdf-zathura-close-all) - (setq jao-org-open-pdf-fun #'jao-afio-open-pdf) + (setq jao-org-open-pdf-fun #'jao-find-or-open) (setq jao-org-links-pdf-store-fun nil) (setq jao-open-doc-fun #'jao-find-or-open)) @@ -1796,7 +1796,7 @@ (defun jao-rss--feeds-dirs () (mapcar (lambda (d) (cadr (split-string d "\\."))) - (directory-files (jao-gnus-dir "Mail/") nil "^feeds"))) + (directory-files "~/.emacs.d/gnus/Mail/" nil "^feeds"))) (defun jao-rss-subscribe (url) "Subscribe to a given RSS URL. If URL not given, look for it." @@ -1883,8 +1883,11 @@ (string-to-number (match-string 4 title)) (match-string 2 title)))) - (defun jao-zathura-goto-org (title) - (when-let* ((info (jao-zathura-file-info title)) + (defun jao-zathura-goto-org (&optional title) + (when-let* ((title (or title (jao-shell-string "xdotool" + "getactivewindow" + "getwindowname"))) + (info (jao-zathura-file-info title)) (file (jao-org-pdf-to-org-file (car info))) (page (cadr info)) (pageno (or (car (last info)) page))) @@ -1917,6 +1920,7 @@ :after doc-view) (setq jao-open-doc-fun 'jao-find-or-open) + (setq jao-org-open-pdf-fun 'jao-find-or-open) (defun jao-find-or-open (file &optional page height) (if (and jao-browse-doc-use-emacs-p window-system) @@ -1927,7 +1931,8 @@ (throw 'done (car buffs))) (setq buffs (cdr buffs)))))) (jao-afio--goto-docs) - (if b (pop-to-buffer b) (find-file file))) + (if b (pop-to-buffer b) (find-file file)) + (when page (jao-doc-view-goto-page page height))) (jao-zathura-open file page))) (defun jao-open-doc (&optional file page height) @@ -1937,12 +1942,6 @@ (concat jao-org-dir "/doc/")))) (funcall jao-open-doc-fun file page height))) - (defun jao-afio-open-pdf (file page &optional height) - (jao-open-doc file page height) - (when page (jao-doc-view-goto-page page height))) - - (setq jao-org-open-pdf-fun #'jao-afio-open-pdf) - (defun jao-select-pdf () (interactive) (jao-buffer-same-mode '(pdf-view-mode doc-view-mode) |