From c760155d9eacb11c16cb7b601297791206e0e3b0 Mon Sep 17 00:00:00 2001 From: jao Date: Thu, 25 Mar 2021 23:16:35 +0000 Subject: afio-w3m -> afio-www --- exwm.org | 12 ++++++------ lib/eos/jao-afio.el | 26 ++++++++++++++++---------- w3m.org | 2 +- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/exwm.org b/exwm.org index e45ff39..06ecea9 100644 --- a/exwm.org +++ b/exwm.org @@ -36,11 +36,11 @@ (when (jao-exwm--mark-frame init) (jao-afio-open-gnus))) - (defun jao-exwm--goto-w3m (&optional init) + (defun jao-exwm--goto-www (&optional init) (interactive "P") (exwm-workspace-switch-create 5) (when (jao-exwm--mark-frame init) - (jao-afio-open-w3m) + (jao-afio-open-www) (let ((scroll-bar-mode 'left)) (toggle-scroll-bar 1) (set-frame-parameter (window-frame) 'scroll-bar-width 12)) @@ -59,12 +59,12 @@ (defun jao-exwm-no-afio-setup () (interactive) (defalias 'jao-open-gnus-frame 'jao-exwm--goto-mail) - (defalias 'jao-goto-w3m-frame 'jao-exwm--goto-w3m) + (defalias 'jao-goto-www-frame 'jao-exwm--goto-www) (setq jao-open-doc-fun #'jao-exwm-open-doc) (setq minibuffer-follows-selected-frame t) (global-set-key "\C-cf" 'jao-exwm--goto-main) (global-set-key "\C-cg" 'jao-exwm--goto-mail) - (global-set-key "\C-cw" 'jao-exwm--goto-w3m) + (global-set-key "\C-cw" 'jao-exwm--goto-www) (global-set-key "\C-cz" 'jao-exwm--goto-docs)) (if jao-exwm--use-afio @@ -214,7 +214,7 @@ (cl-case n ((1) (jao-afio--goto-main)) ((2) (jao-afio--goto-gnus)) - ((3) (jao-afio--goto-w3m)) + ((3) (jao-afio--goto-www)) ((4) (jao-afio--goto-docs)) ((5) (jao-afio--goto-scratch-1)) ((0) (jao-afio--goto-scratch))) @@ -467,7 +467,7 @@ '(([?\s-0] . jao-afio--goto-scratch) ([?\s-1] . jao-afio--goto-main) ([?\s-2] . jao-afio--goto-gnus) - ([?\s-3] . jao-afio--goto-w3m) + ([?\s-3] . jao-afio--goto-www) ([?\s-4] . jao-afio--goto-docs) ([?\s-A] . org-agenda-list) ([?\s-a] . jao-first-window) 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) diff --git a/w3m.org b/w3m.org index b31e2ec..a66dd41 100644 --- a/w3m.org +++ b/w3m.org @@ -37,7 +37,7 @@ w3m-use-header-line nil w3m-use-refresh nil) (setq jao-browse-url-function 'jao-w3m-browse-url) - :config (defalias 'jao-goto-w3m-frame 'jao-afio--goto-w3m) + :config (defalias 'jao-goto-w3m-frame 'jao-afio--goto-www) :bind (:map w3m-mode-map (("C-c C-@" . tracking-next-buffer) ("C-c C-SPC" . tracking-next-buffer)))) (require 'w3m) -- cgit v1.2.3