summaryrefslogtreecommitdiffhomepage
path: root/lib/doc/jao-pdf.el
diff options
context:
space:
mode:
Diffstat (limited to 'lib/doc/jao-pdf.el')
-rw-r--r--lib/doc/jao-pdf.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/doc/jao-pdf.el b/lib/doc/jao-pdf.el
index 62dfc08..6158306 100644
--- a/lib/doc/jao-pdf.el
+++ b/lib/doc/jao-pdf.el
@@ -26,6 +26,8 @@
;; section title of a given page.
;; - Interoperability with zathura.
+(require 'jao-doc-session)
+
;;; PDF info
(declare-function 'pdf-info-outline "pdf-info")
@@ -83,6 +85,10 @@ The result is cached as a local buffer variable."
(replace-regexp-in-string "[[:blank:]]+" " " cur-title)))
;;; zathura interop
+(defun jao-pdf-zathura-open-cmd (file page &optional suffix)
+ (let ((page (if page (format "-P %s" page) "")))
+ (format "zathura %s %s %s" file page (or suffix ""))))
+
(defun jao-pdf-zathura-file-info (title)
(when (string-match "\\(.+\\) \\[\\(.+\\) (\\([0-9]+\\)/\\([0-9]+\\))\\]"
title)
@@ -104,6 +110,7 @@ The result is cached as a local buffer variable."
(let* ((fn (file-name-nondirectory pdf-file))
(desc (jao-pdf-section-title page pdf-file))
(lnk (format "[[doc:%s::%d][%s]]" fn page desc)))
+ (jao-doc-session-mark)
(if (or (not exists) (and (not no-ask) (y-or-n-p "Insert link?")))
(insert lnk "\n")
(kill-new lnk)