[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
w3m-view-this-url-new-session in background
- From: Michael Heerdegen <michael_heerdegen@xxxxxx>
- Date: Thu, 12 Sep 2019 00:39:45 +0200
- X-ml-name: emacs-w3m
- X-mail-count: 13543
Ok,
I post here instead of with M-x report-emacs-w3m-bug since it is broken
for me (see my last message).
What I want to have is what S-RET (w3m-view-this-url-new-session) does
but in the background - a feature that is known from other web browsers.
That doesn't exist in w3m yet (at this level), correct?
If not, I would suggest to add it. Or better use the currently unused
prefix arg of `w3m-view-this-url-new-session' to control the behavior.
I think ideally the default should be user configurable, and the prefix
arg would should the default behavior.
Seems w3m has all capabilities to do what I want, but it's not simple to
get it as a user. Currently I use this hack:
#+begin_src emacs-lisp
(advice-add 'w3m-view-this-url-new-session :around
(defun my-w3m-view-this-url-new-session-in-backgound (f &rest args)
(cl-letf* ((w3m-goto-url-new-session--orig
(indirect-function 'w3m-goto-url-new-session))
((symbol-function 'w3m-goto-url-new-session)
(lambda (&rest args)
(apply w3m-goto-url-new-session--orig
(if current-prefix-arg args
(mapcar
(lambda (i)
(if (< i 5) (nth i args) (not (nth i args))))
(number-sequence 0 5)))))))
(apply f args))))
#+end_src
Of course this obviously is really just a hack, I guess a BACKGROUND
flag should somehow be passed by the code up to the place where
`w3m-goto-url-new-session' gets called.
TIA,
Michael.