summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-04-17 02:41:57 +0100
committerjao <jao@gnu.org>2021-04-17 02:41:57 +0100
commit45bf5ca9f1ab4fcec6388ba9624e6eac719e0b24 (patch)
treea5aa1c1a1a634ac964bb5b189b0c34d58bcaddeb /lib
parentd82155d445a9c1f4630d2b667cd91f57730fa458 (diff)
downloadelibs-45bf5ca9f1ab4fcec6388ba9624e6eac719e0b24.tar.gz
elibs-45bf5ca9f1ab4fcec6388ba9624e6eac719e0b24.tar.bz2
nits
Diffstat (limited to 'lib')
-rw-r--r--lib/doc/jao-doc-view.el3
-rw-r--r--lib/eos/jao-afio.el19
2 files changed, 13 insertions, 9 deletions
diff --git a/lib/doc/jao-doc-view.el b/lib/doc/jao-doc-view.el
index 0687518..058fc04 100644
--- a/lib/doc/jao-doc-view.el
+++ b/lib/doc/jao-doc-view.el
@@ -64,8 +64,7 @@
(when-let (fn (and (not (equalp cb b)) (jao-doc-view--is-pdf)))
(add-to-list 'docs fn))))
(when (> (length docs) 0)
- (jao-doc-view--save-to-file jao-doc-view-session-file docs)
- (message "%s docs saved" (length docs)))))
+ (jao-doc-view--save-to-file jao-doc-view-session-file docs))))
(defun jao-doc-view--save-session-1 ()
(when (jao-doc-view--is-pdf) (jao-doc-view-save-session t)))
diff --git a/lib/eos/jao-afio.el b/lib/eos/jao-afio.el
index 90abc7f..7ebaf5d 100644
--- a/lib/eos/jao-afio.el
+++ b/lib/eos/jao-afio.el
@@ -64,22 +64,27 @@
(jao-afio--goto-frame next)))
;;;###autoload
+(defvar jao-open-doc-fun 'find-file)
+
+;;;###autoload
+(defun jao-afio-open-pdf-session ()
+ (interactive)
+ (dolist (doc (jao-doc-view-session))
+ (when (and (file-exists-p doc) (y-or-n-p (format "Open %s? " doc)))
+ (jao-open-doc doc))))
+
(defun jao-afio-open-doc ()
(interactive)
(delete-other-windows)
(split-window-right)
(let ((docs (remove-if-not (lambda (b)
- (eq (buffer-local-value 'major-mode b)
- 'pdf-view-mode))
+ (with-current-buffer b (jao-doc-view--is-pdf)))
(buffer-list))))
(if (car docs)
(progn (switch-to-buffer (car docs))
(switch-to-buffer-other-window (or (cadr docs) (car docs))))
- (when (and (jao-doc-view-session)
- (y-or-n-p "Load saved session? "))
- (dolist (doc (jao-doc-view-session))
- (when (and (file-exists-p doc) (y-or-n-p (format "Open %s? " doc)))
- (find-file doc)))))))
+ (when (and (jao-doc-view-session) (y-or-n-p "Load saved session? "))
+ (jao-afio-open-pdf-session)))))
(defvar jao-afio-use-w3m nil)
(declare w3m "w3m")