summaryrefslogtreecommitdiffhomepage
path: root/lib/eos/jao-afio.el
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-09-01 00:08:14 +0100
committerjao <jao@gnu.org>2022-09-01 00:08:14 +0100
commit749905e3b35e784b8254d9efbe33ddef2cb1d776 (patch)
tree3bbf9b319fc0f3b6b1aed9dc4dc4441ca6ebe2f3 /lib/eos/jao-afio.el
parent1070a4ecb5c15933e80724bf93f785a9790a27cb (diff)
downloadelibs-749905e3b35e784b8254d9efbe33ddef2cb1d776.tar.gz
elibs-749905e3b35e784b8254d9efbe33ddef2cb1d776.tar.bz2
eww-session: don't try to open if there's eww buffers around
Diffstat (limited to 'lib/eos/jao-afio.el')
-rw-r--r--lib/eos/jao-afio.el18
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/eos/jao-afio.el b/lib/eos/jao-afio.el
index 0f1ae43..c8f4b7d 100644
--- a/lib/eos/jao-afio.el
+++ b/lib/eos/jao-afio.el
@@ -72,25 +72,29 @@
(when (y-or-n-p (format "Load saved session? (%d docs)" (length docs)))
(jao-afio-open-pdf-session docs))))))
-(declare w3m "w3m")
-(declare w3m-alive-p "w3m")
-(declare w3m-previous-buffer "w3m")
-(declare notmuch "notmuch")
+(declare-function w3m "w3m")
+(declare-function notmuch "notmuch")
+(declare-function jao-eww-session-eww-buffers "jao-eww-session")
+(declare-function jao-eww-session-load "jao-eww-session")
+
+(defun jao-afio--open-eww-sesion ()
+ (when (null (jao-eww-session-eww-buffers))
+ (jao-eww-session-load)))
;;;###autoload
(defun jao-afio-open-www ()
(interactive)
(require 'jao-eww-session)
(if (< (frame-width) 160)
- (if jao-afio-use-w3m (w3m) (jao-eww-session-load))
+ (if jao-afio-use-w3m (w3m) (jao-afio--open-eww-session))
(delete-other-windows)
(split-window-right)
(if jao-afio-use-w3m
(w3m)
- (jao-eww-session-load)
+ (jao-afio--open-eww-session)
(let ((b (current-buffer)))
(other-window 1)
- (switch-to-buffer (car (jao-eww-session--list-buffers b)))
+ (switch-to-buffer (car (jao-eww-session-eww-buffers b)))
(other-window 1)))))
;;;###autoload