summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-05-05 02:20:14 +0100
committerjao <jao@gnu.org>2021-05-05 02:20:14 +0100
commit119147eafdc798d4c9b2dfc160d9fc6972a298bd (patch)
tree264dd3f02c428cae08674e07c88381f8ca29d967 /lib
parent5e519e0617427eff39578e16c36487ee66b5acd9 (diff)
downloadelibs-119147eafdc798d4c9b2dfc160d9fc6972a298bd.tar.gz
elibs-119147eafdc798d4c9b2dfc160d9fc6972a298bd.tar.bz2
pdf: inhibit saving sessions while opening them
Diffstat (limited to 'lib')
-rw-r--r--lib/doc/jao-doc-view.el5
-rw-r--r--lib/eos/jao-afio.el7
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/doc/jao-doc-view.el b/lib/doc/jao-doc-view.el
index 058fc04..95a22a6 100644
--- a/lib/doc/jao-doc-view.el
+++ b/lib/doc/jao-doc-view.el
@@ -69,10 +69,13 @@
(defun jao-doc-view--save-session-1 ()
(when (jao-doc-view--is-pdf) (jao-doc-view-save-session t)))
+(defvar jao-doc-view-inhibit-session-save nil)
+
(defun jao-doc-view--save-session ()
(let ((inhibit-message t)
(message-log-max nil))
- (jao-doc-view-save-session)
+ (when (not jao-doc-view-inhibit-session-save)
+ (jao-doc-view-save-session))
t))
(add-hook 'kill-emacs-query-functions #'jao-doc-view--save-session)
diff --git a/lib/eos/jao-afio.el b/lib/eos/jao-afio.el
index 14794fd..f62c314 100644
--- a/lib/eos/jao-afio.el
+++ b/lib/eos/jao-afio.el
@@ -72,9 +72,10 @@
;;;###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))))
+ (let ((jao-doc-view-inhibit-session-save t))
+ (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)