* bug#22157: still present in 25.0.90
[not found] <19694.1449984793@allegro.localdomain>
@ 2016-02-01 1:19 ` Mike Kupfer
[not found] ` <m2vb349303.fsf@krugs.de>
2016-04-28 17:43 ` bug#22157: problem only seen with Gnus, not MH-E Mike Kupfer
2 siblings, 0 replies; 13+ messages in thread
From: Mike Kupfer @ 2016-02-01 1:19 UTC (permalink / raw)
To: 22157
I'm afraid that I'm still seeing this problem in 25.0.90.
mike
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#22157: html renderer shr - Links open twice in external browser
[not found] ` <m2vb349303.fsf@krugs.de>
@ 2016-04-28 3:47 ` Mike Kupfer
2016-04-28 7:43 ` Rainer M Krug
0 siblings, 1 reply; 13+ messages in thread
From: Mike Kupfer @ 2016-04-28 3:47 UTC (permalink / raw)
To: Rainer M Krug; +Cc: ding, 22157
Rainer M Krug wrote:
> I have set my html renderer to shr which works, but whenever I click a
> link, it opens twice in the external browser.
>
> I want it to open in the external browser - that is fine, but only once.
>
> This started only recently, but I can not pinpoint the exact time when
> this started.
Yes, I noticed this late last year with Emacs 25. Haven't seen it with
Emacs 24.5 (using the Gnus that comes with it). It's still present in
25.0.92 (I haven't had time to try out .93 yet).
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22157
mike
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#22157: html renderer shr - Links open twice in external browser
2016-04-28 3:47 ` bug#22157: html renderer shr - Links open twice in external browser Mike Kupfer
@ 2016-04-28 7:43 ` Rainer M Krug
0 siblings, 0 replies; 13+ messages in thread
From: Rainer M Krug @ 2016-04-28 7:43 UTC (permalink / raw)
To: Mike Kupfer; +Cc: ding, 22157
[-- Attachment #1: Type: text/plain, Size: 767 bytes --]
Mike Kupfer <m.kupfer@acm.org> writes:
> Rainer M Krug wrote:
>
>> I have set my html renderer to shr which works, but whenever I click a
>> link, it opens twice in the external browser.
>>
>> I want it to open in the external browser - that is fine, but only once.
>>
>> This started only recently, but I can not pinpoint the exact time when
>> this started.
>
> Yes, I noticed this late last year with Emacs 25. Haven't seen it with
> Emacs 24.5 (using the Gnus that comes with it). It's still present in
> 25.0.92 (I haven't had time to try out .93 yet).
>
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22157
Thanks for the info,
Rainer
>
> mike
>
>
>
>
--
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 454 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#22157: problem only seen with Gnus, not MH-E
[not found] <19694.1449984793@allegro.localdomain>
2016-02-01 1:19 ` bug#22157: still present in 25.0.90 Mike Kupfer
[not found] ` <m2vb349303.fsf@krugs.de>
@ 2016-04-28 17:43 ` Mike Kupfer
2016-05-02 7:31 ` bug#22157: html renderer shr - Links open twice in external browser Katsumi Yamaoka
2 siblings, 1 reply; 13+ messages in thread
From: Mike Kupfer @ 2016-04-28 17:43 UTC (permalink / raw)
To: 22157
I did a little more experimenting this morning, and I only see this
problem with Gnus. Although I have MH-E configured to use shr, too,
left-click works fine for it, with both HTML and plaintext messages.
(Still 25.0.92.)
mike
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#22157: html renderer shr - Links open twice in external browser
2016-04-28 17:43 ` bug#22157: problem only seen with Gnus, not MH-E Mike Kupfer
@ 2016-05-02 7:31 ` Katsumi Yamaoka
2016-05-02 9:59 ` Katsumi Yamaoka
0 siblings, 1 reply; 13+ messages in thread
From: Katsumi Yamaoka @ 2016-05-02 7:31 UTC (permalink / raw)
To: 22157
(Last Subject: problem only seen with Gnus, not MH-E)
I don't know why it doesn't happen with MH-E, though. I think
this is why a link opens twice:
・If a link has an image, there are two keymaps `shr-map' and
`shr-image-map'. `shr-map' binds `mouse-2' to `shr-browse-url',
and `follow-link' to `mouse-face'; `shr-image-map' has a copy
of `shr-map' bindings.
・The `follow-link' binding responds to the `mouse-1' button if
`mouse-1-click-follows-link' is non-nil (the default).
A fix would be:
--- shr.el~ 2016-04-24 22:03:10.675591200 +0000
+++ shr.el 2016-05-02 07:23:19.038316700 +0000
@@ -191,7 +191,7 @@
map))
(defvar shr-image-map
- (let ((map (copy-keymap shr-map)))
+ (let ((map (make-sparse-keymap)))
(when (boundp 'image-map)
(set-keymap-parent map image-map))
map))
I realized why I wasn't troubled with such a problem is that
I've set `mouse-1-click-follows-link' to nil years ago. ;-)
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#22157: html renderer shr - Links open twice in external browser
2016-05-02 7:31 ` bug#22157: html renderer shr - Links open twice in external browser Katsumi Yamaoka
@ 2016-05-02 9:59 ` Katsumi Yamaoka
2016-05-06 1:37 ` Katsumi Yamaoka
0 siblings, 1 reply; 13+ messages in thread
From: Katsumi Yamaoka @ 2016-05-02 9:59 UTC (permalink / raw)
To: 22157
On Mon, 02 May 2016 16:31:34 +0900, Katsumi Yamaoka wrote:
> I think this is why a link opens twice:
> ・If a link has an image, there are two keymaps `shr-map' and
> `shr-image-map'. `shr-map' binds `mouse-2' to `shr-browse-url',
> and `follow-link' to `mouse-face'; `shr-image-map' has a copy
> of `shr-map' bindings.
No. There are three keymaps. The other one is that of the widget
button, that `mm-convert-shr-links' creates. This might be the
reason why it doesn't happen with MH-E.
> ・The `follow-link' binding responds to the `mouse-1' button if
> `mouse-1-click-follows-link' is non-nil (the default).
But I don't know why it responds to a single `mouse-1' click twice
so far. It might otherwise not be the cause.
> A fix would be:
> --- shr.el~ 2016-04-24 22:03:10.675591200 +0000
> +++ shr.el 2016-05-02 07:23:19.038316700 +0000
> @@ -191,7 +191,7 @@
> map))
> (defvar shr-image-map
> - (let ((map (copy-keymap shr-map)))
> + (let ((map (make-sparse-keymap)))
> (when (boundp 'image-map)
> (set-keymap-parent map image-map))
> map))
This fixes the problem anyway.
I tried making a simple test program that reproduce the `twice'
problem, but haven't succeeded in it yet.
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#22157: html renderer shr - Links open twice in external browser
2016-05-02 9:59 ` Katsumi Yamaoka
@ 2016-05-06 1:37 ` Katsumi Yamaoka
2016-05-06 8:43 ` Nicolas Petton
0 siblings, 1 reply; 13+ messages in thread
From: Katsumi Yamaoka @ 2016-05-06 1:37 UTC (permalink / raw)
To: 22157
The change 72166f2f3dba18f1217c666574032f5a0351ed65 seems to have
fixed this bug.
On Tue, 03 May 2016 06:39:44 +0000, Martin Rudalics wrote:
> Bind `widget-button-click' to mouse-1/-2 instead of down-mouse-1/-2
> * lisp/wid-edit.el (widget-keymap): Bind `widget-button-click'
> to mouse-1/-2 instead of down-mouse-1/-2. Suggested by Stefan
> Monnier. (Bug#19185, Bug#20398)
cf. <http://article.gmane.org/gmane.emacs.diffs/135579>
To try the old `widget-keymap' definition to reproduce the bug,
I needed to eval the following form, that exists in gnus-art.el,
after reverting the `widget-keymap' definition:
(set-keymap-parent gnus-article-mode-map widget-keymap)
With this, I learned that `set-keymap-parent' uses a copy of
a parent keymap, i.e., a change made in a parent keymap has no
effect on *this* keymap.
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#22157: html renderer shr - Links open twice in external browser
2016-05-06 1:37 ` Katsumi Yamaoka
@ 2016-05-06 8:43 ` Nicolas Petton
2016-06-10 8:35 ` Katsumi Yamaoka
0 siblings, 1 reply; 13+ messages in thread
From: Nicolas Petton @ 2016-05-06 8:43 UTC (permalink / raw)
To: Katsumi Yamaoka, 22157; +Cc: 22157-done
[-- Attachment #1: Type: text/plain, Size: 151 bytes --]
Katsumi Yamaoka <yamaoka@jpl.org> writes:
> The change 72166f2f3dba18f1217c666574032f5a0351ed65 seems to have
> fixed this bug.
I'm closing it then.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 512 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#22157: html renderer shr - Links open twice in external browser
2016-05-06 8:43 ` Nicolas Petton
@ 2016-06-10 8:35 ` Katsumi Yamaoka
2016-06-10 9:23 ` Stephen Berman
0 siblings, 1 reply; 13+ messages in thread
From: Katsumi Yamaoka @ 2016-06-10 8:35 UTC (permalink / raw)
To: 22157; +Cc: Stephen Berman, Mike Kupfer
On Fri, 06 May 2016 10:43:09 +0200, Nicolas Petton wrote:
> Katsumi Yamaoka <yamaoka@jpl.org> writes:
>> The change 72166f2f3dba18f1217c666574032f5a0351ed65 seems to have
>> fixed this bug.
> I'm closing it then.
The bug has come back by the change[1] done in master two hours
ago in relation to bug#23571. I vaguely guessed this is due to
something bad in Gnus' way[2] but haven't resolved yet.
Thanks.
[1] Revert "Bind `widget-button-click' to mouse-1/-2 instead of down-mouse-1/-2"
<http://lists.gnu.org/archive/html/emacs-diffs/2016-06/msg00069.html>
[2] There are three keymaps in the article buffer
<https://lists.gnu.org/archive/html/bug-gnu-emacs/2016-05/msg00074.html>
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#22157: html renderer shr - Links open twice in external browser
2016-06-10 8:35 ` Katsumi Yamaoka
@ 2016-06-10 9:23 ` Stephen Berman
2016-06-10 13:58 ` martin rudalics
0 siblings, 1 reply; 13+ messages in thread
From: Stephen Berman @ 2016-06-10 9:23 UTC (permalink / raw)
To: 22157
[resending to the bug list, after unarchiving the bug]
On Fri, 10 Jun 2016 17:35:04 +0900 Katsumi Yamaoka <yamaoka@jpl.org> wrote:
> On Fri, 06 May 2016 10:43:09 +0200, Nicolas Petton wrote:
>> Katsumi Yamaoka <yamaoka@jpl.org> writes:
>>> The change 72166f2f3dba18f1217c666574032f5a0351ed65 seems to have
>>> fixed this bug.
>> I'm closing it then.
>
> The bug has come back by the change[1] done in master two hours
> ago in relation to bug#23571. I vaguely guessed this is due to
> something bad in Gnus' way[2] but haven't resolved yet.
>
> Thanks.
>
> [1] Revert "Bind `widget-button-click' to mouse-1/-2 instead of down-mouse-1/-2"
> <http://lists.gnu.org/archive/html/emacs-diffs/2016-06/msg00069.html>
>
> [2] There are three keymaps in the article buffer
> <https://lists.gnu.org/archive/html/bug-gnu-emacs/2016-05/msg00074.html>
I didn't know this bug had also been connected with commit 72166f. I
just tried to reproduce it on my master branch, which still has the
commit (I have not yet updated since Martin reverted it), and here are
my results (the indented lines are quotes from the OP):
When viewing an HTML email using shr, when I left-click on a link, Gnus
starts 2 browsers and directs each to the URL for the link.
I still see this on master with commit 72166f (in my case it's two tabs
on one browser instance).
When viewing a plaintext email that contains a URL, when I left-click
on the URL, Gnus starts a browser for that URL okay, but I also get a
message like
Buffer is read-only: #<buffer *Article gnu.emacs.gnus*>
I do not see this on master with commit 72166f, but I do see it without
that commit.
In both cases (HTML, plaintext) middle-clicking on the link/URL works
okay.
For me too on master with commit 72166f.
In short, the now reverted commit does not completely fix this bug for
me. And since it introduced bug#23571, which for me is more annoying
than bug#22157, I would prefer it not to be simply recomitted; hopefully
a better fix can be found.
Steve Berman
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#22157: html renderer shr - Links open twice in external browser
2016-06-10 9:23 ` Stephen Berman
@ 2016-06-10 13:58 ` martin rudalics
2016-06-13 1:22 ` Katsumi Yamaoka
0 siblings, 1 reply; 13+ messages in thread
From: martin rudalics @ 2016-06-10 13:58 UTC (permalink / raw)
To: Stephen Berman, 22157
> I didn't know this bug had also been connected with commit 72166f. I
> just tried to reproduce it on my master branch, which still has the
> commit (I have not yet updated since Martin reverted it), and here are
> my results (the indented lines are quotes from the OP):
>
> When viewing an HTML email using shr, when I left-click on a link, Gnus
> starts 2 browsers and directs each to the URL for the link.
One for the down and one for the up event, I suppose.
> I still see this on master with commit 72166f (in my case it's two tabs
> on one browser instance).
>
> When viewing a plaintext email that contains a URL, when I left-click
> on the URL, Gnus starts a browser for that URL okay, but I also get a
> message like
>
> Buffer is read-only: #<buffer *Article gnu.emacs.gnus*>
The typical attempt to yank text in that buffer. IIRC this was my major
concern (in *info* buffers) but I didn't find the corresponding thread
any more :-(
> I do not see this on master with commit 72166f, but I do see it without
> that commit.
>
> In both cases (HTML, plaintext) middle-clicking on the link/URL works
> okay.
>
> For me too on master with commit 72166f.
IIRC all these bugs were only triggered by mouse-1 events.
> In short, the now reverted commit does not completely fix this bug for
> me. And since it introduced bug#23571, which for me is more annoying
> than bug#22157, I would prefer it not to be simply recomitted; hopefully
> a better fix can be found.
Do we know whether mouse-1 ever worked correctly?
martin
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#22157: html renderer shr - Links open twice in external browser
2016-06-10 13:58 ` martin rudalics
@ 2016-06-13 1:22 ` Katsumi Yamaoka
2016-06-22 10:41 ` Katsumi Yamaoka
0 siblings, 1 reply; 13+ messages in thread
From: Katsumi Yamaoka @ 2016-06-13 1:22 UTC (permalink / raw)
To: 22157
On Fri, 10 Jun 2016 15:58:42 +0200, martin rudalics wrote:
>> When viewing an HTML email using shr, when I left-click on a link, Gnus
>> starts 2 browsers and directs each to the URL for the link.
> One for the down and one for the up event, I suppose.
Left-click causes invoking `widget-button-click' by the mouse-1
event, and `shr-browse-url' by the mouse-2 event 0.6 sec after
(I tested it by adding a logger code to each function). But
middle-click invokes only `widget-button-click' by down-mouse-2.
At the link position, there are two keymaps[1]:
There is an overlay here:
From 876 to 882
button url-link (widget)Top
evaporate t
face nil
follow-link nil
help-echo [Show]
-> "https://www.amazon.co.jp/..."
keymap [Show]
-> (keymap ...(mouse-2 . shr-browse-url) (follow-link . mouse-face)...
mouse-face (highlight)
pointer hand
There are text properties here:
face (variable-pitch shr-link (:foreground "#333333")...
follow-link t
help-echo [Show]
-> "https://www.amazon.co.jp/..."
keymap [Show]
-> (keymap ...(mouse-2 . shr-browse-url) (follow-link . mouse-face)...
local-map nil
mouse-face highlight
shr-url [Show]
-> (the same as the help-echo string)
IIUC, the overlay is what `mm-convert-shr-links' adds, and the
text properties are what `shr-urlify' adds. Though Lars wrote
in 2013-06-17 as follows, is it really necessary?
* mm-decode.el (mm-convert-shr-links): Override the shr local map, so
that Gnus commands work.
[1] I wrote "there are three keymaps" last month but it's wrong,
probably.
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#22157: html renderer shr - Links open twice in external browser
2016-06-13 1:22 ` Katsumi Yamaoka
@ 2016-06-22 10:41 ` Katsumi Yamaoka
0 siblings, 0 replies; 13+ messages in thread
From: Katsumi Yamaoka @ 2016-06-22 10:41 UTC (permalink / raw)
To: 22157-done
On Mon, 13 Jun 2016 10:22:20 +0900, Katsumi Yamaoka wrote:
> Left-click causes invoking `widget-button-click' by the mouse-1
> event, and `shr-browse-url' by the mouse-2 event 0.6 sec after
> (I tested it by adding a logger code to each function). But
> middle-click invokes only `widget-button-click' by down-mouse-2.
> At the link position, there are two keymaps[1]:
[...]
> [1] I wrote "there are three keymaps" last month but it's wrong,
> probably.
No, that's right. I'm sorry for flip-flopping; the third one is
`gnus-article-mode-map', of which the parent is `widget-keymap'.
Anyway I found the solution for this bug at last. I verified
the problem happens with emacs-25, not only master, so I've
committed the fix to emacs-25:
git diff 8297331..ea512a7
Regards,
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2016-06-22 10:41 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <19694.1449984793@allegro.localdomain>
2016-02-01 1:19 ` bug#22157: still present in 25.0.90 Mike Kupfer
[not found] ` <m2vb349303.fsf@krugs.de>
2016-04-28 3:47 ` bug#22157: html renderer shr - Links open twice in external browser Mike Kupfer
2016-04-28 7:43 ` Rainer M Krug
2016-04-28 17:43 ` bug#22157: problem only seen with Gnus, not MH-E Mike Kupfer
2016-05-02 7:31 ` bug#22157: html renderer shr - Links open twice in external browser Katsumi Yamaoka
2016-05-02 9:59 ` Katsumi Yamaoka
2016-05-06 1:37 ` Katsumi Yamaoka
2016-05-06 8:43 ` Nicolas Petton
2016-06-10 8:35 ` Katsumi Yamaoka
2016-06-10 9:23 ` Stephen Berman
2016-06-10 13:58 ` martin rudalics
2016-06-13 1:22 ` Katsumi Yamaoka
2016-06-22 10:41 ` Katsumi Yamaoka
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).