diff options
author | jao <jao@gnu.org> | 2022-09-01 00:08:14 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-09-01 00:08:14 +0100 |
commit | 749905e3b35e784b8254d9efbe33ddef2cb1d776 (patch) | |
tree | 3bbf9b319fc0f3b6b1aed9dc4dc4441ca6ebe2f3 /lib/net | |
parent | 1070a4ecb5c15933e80724bf93f785a9790a27cb (diff) | |
download | elibs-749905e3b35e784b8254d9efbe33ddef2cb1d776.tar.gz elibs-749905e3b35e784b8254d9efbe33ddef2cb1d776.tar.bz2 |
eww-session: don't try to open if there's eww buffers around
Diffstat (limited to 'lib/net')
-rw-r--r-- | lib/net/jao-eww-session.el | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/net/jao-eww-session.el b/lib/net/jao-eww-session.el index 9a34656..4ac5447 100644 --- a/lib/net/jao-eww-session.el +++ b/lib/net/jao-eww-session.el @@ -86,7 +86,7 @@ the session is already displayed in a eww tab, jao-eww-session can: (defvar jao-eww-current-session '(jao-eww-session 0 nil)) -(defun jao-eww-session--list-buffers (&optional skip) +(defun jao-eww-session-eww-buffers (&optional skip) (seq-filter (lambda (b) (when (not (eq b skip)) (with-current-buffer b (derived-mode-p 'eww-mode)))) @@ -94,7 +94,7 @@ the session is already displayed in a eww tab, jao-eww-session can: (defun jao-eww-session-invisible-buffers () (seq-filter (lambda (b) (null (get-buffer-window b))) - (jao-eww-session--list-buffers (current-buffer)))) + (jao-eww-session-eww-buffers (current-buffer)))) (defun jao-eww--current-url () (when-let (url (eww-current-url)) (url-encode-url url))) @@ -104,7 +104,7 @@ the session is already displayed in a eww tab, jao-eww-session can: (cb (current-buffer)) (pos 0) (count 0)) - (dolist (b (jao-eww-session--list-buffers (when skip-current cb)) + (dolist (b (jao-eww-session-eww-buffers (when skip-current cb)) (list pos (reverse urls))) (set-buffer b) (when-let (url (jao-eww--current-url)) @@ -141,7 +141,7 @@ the session is already displayed in a eww tab, jao-eww-session can: (or (and (eq jao-eww-session-duplicate-tabs 'never)) (not (y-or-n-p (format "'%s' (%s) is already open. Duplicate? " (jao-eww-buffer-title) url)))))))) - (jao-eww-session--list-buffers))) + (jao-eww-session-eww-buffers))) (defun jao-eww-session-load-aux () (let ((new-session (jao-eww-session-from-file @@ -226,7 +226,7 @@ the session is already displayed in a eww tab, jao-eww-session can: (dolist (url urls) (eww url 4)) (seq-each #'kill-buffer buffers) (unless (zerop offset) - (switch-to-buffer (nth offset (jao-eww-session--list-buffers))))))) + (switch-to-buffer (nth offset (jao-eww-session-eww-buffers))))))) (provide 'jao-eww-session) ;;; jao-eww-session.el ends here |