[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
w3m-new-session-in-background t doesn't behave conveniently
- From: Michael Heerdegen <michael_heerdegen@xxxxxx>
- Date: Thu, 10 Jan 2013 17:48:00 +0100
- X-ml-name: emacs-w3m
- X-mail-count: 11954
This bug report will be sent to the emacs-w3m development team,
not to your local site managers!!
Please write in simple English, because the emacs-w3m developers
aren't good at English reading. ;-)
Please describe as succinctly as possible:
- What happened.
- What you thought should have happened.
- Precisely what you were doing at the time.
Please also include any Lisp back-traces that you may have.
================================================================
Dear Bug Team!
This has always bothered me: Set `w3m-new-session-in-background' to t.
Now, if you use <S-return> or <S-mouse-2> to open a link in the
background, W3m creates a new tab, switches to this new tab, waits until
the new page is completely rendered, and not before that is done, it
jumps back to the old tab.
This is annoying, and I see no good reason why this would be useful.
And it's surely not what the user would expect - see other browsers.
BTW, while the new page is rendered, Emacs is still responding to user
input, it is even possible to return to the previously selected tab
manually in the meantime. This shows that the behavior can be
optimized.
I haven't browsed the code, so I dunno what should be done to fix this.
However, I have found a short workaround that works nicer. Instead of
setting w3m-new-session-in-background to t, I use these advices:
--8<---------------cut here---------------start------------->8---
(defadvice w3m-view-this-url-new-session (around restore-current-buffer activate)
"Don't select the new tab."
;;break the waiting in the orig fun with an idle timer
(lexical-let ((wconf (current-window-configuration)))
(run-with-idle-timer 0 nil (lambda () (set-window-configuration wconf))))
ad-do-it)
(defadvice w3m-mouse-view-this-url-new-session (around restore-current-buffer activate)
"Don't select the new tab."
;;break the waiting in the orig fun with an idle timer
(lexical-let ((wconf (current-window-configuration)))
(run-with-idle-timer 0 nil (lambda () (set-window-configuration wconf))))
ad-do-it)
--8<---------------cut here---------------end--------------->8---
I.e., I use a timer firing instantly when Emacs becomes idle. This
works well, with this, W3m instantly jumps back to the previous tab.
Of course, that's just a dirty hack that doesn't fix the underlying
problem. But, at least, it's better than the default behavior.
Thanks and regards,
Michael.
================================================================
System Info to help track down your bug:
---------------------------------------
emacs-w3m-version
=> nil
emacs-version
=> "GNU Emacs 24.2.91.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10)\n of 2012-12-30 on drachen"
mule-version
=> "6.0 (HANACHIRUSATO)"
system-type
=> gnu/linux
(featurep 'gtk)
=> t
w3m-version
=> "w3m/0.5.3+cvs-1.1055"
w3m-type
=> w3m-m17n
w3m-compile-options
=> ("lang=en" "m17n" "image" "color" "ansi-color" "mouse" "gpm" "menu" "cookie" "ssl" "ssl-verify" "external-uri-loader" "w3mmailer" "nntp" "gopher" "ipv6" "alarm" "mark" "migemo")
w3m-language
=> nil
w3m-command-arguments
=> nil
w3m-command-arguments-alist
=> nil
w3m-command-environment
=> nil
w3m-input-coding-system
=> utf-8
w3m-output-coding-system
=> utf-8
w3m-use-mule-ucs
=> nil