summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/wm/jao-exwm-zathura.el12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/wm/jao-exwm-zathura.el b/lib/wm/jao-exwm-zathura.el
index 9da0a25..f26f0f9 100644
--- a/lib/wm/jao-exwm-zathura.el
+++ b/lib/wm/jao-exwm-zathura.el
@@ -64,8 +64,6 @@
(jao-doc-session-save)
(doc-view-imenu-index (car info) #'jao-zathura-goto-page))))
-(add-hook 'exwm-update-title-hook #'jao-exwm--zathura-setup t)
-
;;;###autoload
(defun jao-exwm-pdf-zathura-close-all ()
(interactive)
@@ -104,6 +102,9 @@
(defun jao-exwm-pdf-enable-zathura ()
(interactive)
(add-hook 'kill-emacs-query-functions #'jao-exwm-pdf-zathura-close-all t)
+ (add-hook 'exwm-update-title-hook #'jao-exwm--zathura-setup t)
+ (with-eval-after-load "org"
+ (define-key org-mode-map (kbd "C-c o") #'jao-exwm-zathura-goto-pdf))
(setq jao-pdf-open-in-emacs nil)
(setq jao-org-open-pdf-fun #'jao-zathura-open-doc)
(setq jao-org-links-pdf-store-fun #'jao-exwm-org-store-zathura-link)
@@ -113,6 +114,7 @@
(defun jao-exwm-pdf-disable-zathura ()
(interactive)
(remove-hook 'kill-emacs-query-functions #'jao-exwm-pdf-zathura-close-all)
+ (remove-hook 'exwm-update-title-hook #'jao-exwm--zathura-setup)
(setq jao-pdf-open-in-emacs t)
(setq jao-org-open-pdf-fun #'jao-find-or-open)
(setq jao-org-links-pdf-store-fun nil)
@@ -131,12 +133,6 @@
(when-let* ((pdf (jao-exwm-org-to-pdf-file)))
(jao-zathura-open-doc pdf))))
-(with-eval-after-load "org"
- (define-key org-mode-map (kbd "C-c o") #'jao-exwm-zathura-goto-pdf))
-
-(when (not jao-pdf-open-in-emacs)
- (jao-exwm-pdf-enable-zathura))
-
(defun jao-exwm-select-pdf ()
(interactive)
(let ((b (read-buffer "Document: " nil t