summaryrefslogtreecommitdiffhomepage
path: root/lib/eos
diff options
context:
space:
mode:
Diffstat (limited to 'lib/eos')
-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)