summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-03-25 23:16:35 +0000
committerjao <jao@gnu.org>2021-03-25 23:16:35 +0000
commitc760155d9eacb11c16cb7b601297791206e0e3b0 (patch)
treea763a161daf40fde460d4ce51e859c2ec4b6e7af /lib
parent24dd1dfa89d1a133b0a6c2301bbde4524b3d4650 (diff)
downloadelibs-c760155d9eacb11c16cb7b601297791206e0e3b0.tar.gz
elibs-c760155d9eacb11c16cb7b601297791206e0e3b0.tar.bz2
afio-w3m -> afio-www
Diffstat (limited to 'lib')
-rw-r--r--lib/eos/jao-afio.el26
1 files changed, 16 insertions, 10 deletions
diff --git a/lib/eos/jao-afio.el b/lib/eos/jao-afio.el
index 10ca474..ab5fd12 100644
--- a/lib/eos/jao-afio.el
+++ b/lib/eos/jao-afio.el
@@ -81,17 +81,23 @@
(when (and (file-exists-p doc) (y-or-n-p (format "Open %s? " doc)))
(find-file doc)))))))
+(defvar jao-afio-use-w3m nil)
+
;;;###autoload
-(defun jao-afio-open-w3m ()
+(defun jao-afio-open-www ()
(interactive)
+ (require 'jao-eww-session)
(if (< (frame-width) 180)
- (w3m)
+ (if jao-afio-use-w3m (w3m) (jao-eww-session-load))
(delete-other-windows)
(split-window-right)
- (w3m)
+ (if jao-afio-use-w3m (w3m) (jao-eww-session-load))
(other-window 1)
- (switch-to-buffer "*w3m*")
- (ignore-errors (w3m-previous-buffer 2))))
+ (when jao-afio-use-w3m
+ (switch-to-buffer "*w3m*")
+ (ignore-errors (w3m-previous-buffer 2)))
+ (unless jao-afio-use-w3m
+ (switch-to-buffer (car (last (jao-eww-session--list-buffers)))))))
;;;###autoload
(defun jao-afio-open-gnus ()
@@ -129,7 +135,7 @@
(jump-to-register next)
(delete-other-windows)
(cl-case next
- (?w (jao-afio-open-w3m))
+ (?w (jao-afio-open-www))
(?g (jao-afio-open-gnus))
(?p (jao-afio-open-doc))
(?s (delete-other-windows))))
@@ -155,7 +161,7 @@
(jao-afio--check-frame)
(jao-afio--goto-frame ?p reset))
-(defun jao-afio--goto-w3m (&optional reset)
+(defun jao-afio--goto-www (&optional reset)
(interactive "P")
(if (jao-afio--check-frame-p)
(jao-afio--goto-frame ?w reset)
@@ -166,8 +172,8 @@
(ignore-errors (jao-afio--init f))
t)
-(defun jao-afio--goto-w3m-buffer (buf &rest _)
- (jao-afio--goto-w3m)
+(defun jao-afio--goto-www-buffer (buf &rest _)
+ (jao-afio--goto-www)
(jao-first-window)
(switch-to-buffer buf nil t))
@@ -202,7 +208,7 @@
(defun jao-afio-setup (&optional fallback-fun init-p)
(global-set-key "\C-cf" 'jao-afio--goto-main)
(global-set-key "\C-cg" 'jao-afio--goto-gnus)
- (global-set-key "\C-cw" 'jao-afio--goto-w3m)
+ (global-set-key "\C-cw" 'jao-afio--goto-www)
(global-set-key "\C-cz" 'jao-afio--goto-docs)
(setq jao-afio-fallback-fun fallback-fun)
(add-hook (if init-p 'after-init-hook 'after-make-frame-functions)