mu icon indicating copy to clipboard operation
mu copied to clipboard

[mu4e bug] emacs 26.3: Cannot click on URLs in emails when using 1.6.4

Open nsc-kronberg opened this issue 4 years ago • 10 comments

Describe the bug After upgrading from 1.4.x to 1.6.4, I can no longer click on URLs with the mouse in mu4e:view mode.

To Reproduce

  1. View a simple text/plain email with the string "https://www.google.com" in it.
  2. The URL gets highlighted (light blue, underlined, "[1]" at the end).
  3. Hover the mouse over the URL. The text "Follow the link" pops up. Click the URL. Nothing happens. No output in the Messages buffer.
  4. Press "g", then "1" (for "URL to visit"). This works, the link opens in my default browser

Since my mu4e config is rather complicated, I installed mu 1.6.4 on a new test account and verified I got the same behaviour. I also installed the latest 1.4.x on the test account to verify that clicking URLs with the mouse works as expected there.

My .emacs.d/init.el:

(add-to-list 'load-path "/home/mutest/mu-1.6.4/share/emacs/site-lisp/mu4e")
(require 'mu4e)

If I switch to the old view, clicking the URL with mouse-1 works again. Emacs init for that config:

(add-to-list 'load-path "/home/mutest/mu-1.6.4/share/emacs/site-lisp/mu4e")
(setq mu4e-view-use-old t)
(require 'mu4e)

Environment Ubuntu 20.04. Emacs 26.3. mu 1.6.4 built from the Git tag 1.6.4:

mu version                           : 1.6.4
Xapian version                       : 1.4.14
GLib version                         : 2.64.6
GMime version                        : 3.2.7
Guile version                        : 2.2.7
Build mu4e                           : yes
Emacs version                        : GNU Emacs 26.3
Build 'mug' toy-ui (gtk+/webkit)     : no

Have direntry->d_ino                 : yes
Have direntry->d_type                : yes

nsc-kronberg avatar Aug 25 '21 09:08 nsc-kronberg

Hmm, it works for me.

Can you try C-h k and then click on some URL, and see what it says?

djcb avatar Aug 25 '21 10:08 djcb

<mouse-1> at that spot runs the command mouse-set-point (found in
global-map), which is an interactive compiled Lisp function in
‘mouse.el’.

It is bound to <mouse-1>.

(mouse-set-point EVENT &optional PROMOTE-TO-REGION)

Move point to the position clicked on with the mouse.
This should be bound to a mouse click event type.
If PROMOTE-TO-REGION is non-nil and event is a multiple-click, select
the corresponding element around point, with the resulting position of
point determined by ‘mouse-select-region-move-to-beginning’.

For documentation of the corresponding mouse down event <down-mouse-1>,
click and hold the mouse button longer than 0.5 second(s).

nsc-kronberg avatar Aug 25 '21 10:08 nsc-kronberg

Can you reproduce with a minimal configuration, e.g., have some file my-minimal-mu4e.el, with:

(add-to-list 'load-path "<path-to-mu4e-sources>")
(setq mu4e-mu-binary "<path-to-mu4e-binary>")
(require 'mu4e)

(change paths as needed) and then use

emacs -Q -l my-minimal-mu4e.el

and see if you can reproduce still? Thanks.

djcb avatar Aug 25 '21 11:08 djcb

My test account Emacs configuration was already very minimal, but I got the same result with your example.

mutest@ventus:~$ cat my-minimal-mu4e.el 
(add-to-list 'load-path "/home/mutest/mu-1.6.4/share/emacs/site-lisp/mu4e")
(setq mu4e-mu-binary "/home/mutest/mu-1.6.4/bin/mu")
(require 'mu4e)
mutest@ventus:~$ emacs -Q -l my-minimal-mu4e.el

It seems this only happens with text/plan emails (most of my URL clicking happens when I get a notification from our support ticket system, which sends a text email with the ticket URL in it, so I didn't realize this until now).

Here is a very basic example of an email where the URL cannot be clicked using the mouse but can be opened using "g":

mutest@ventus:~$ cat Maildir/INBOX/cur/1629881999.999594_1.ventus\,U\=71275\:2\,S
MIME-Version: 1.0
From: Mats Kronberg <[email protected]>
Date: Wed, 25 Aug 2021 10:45:31 +0200
Message-ID: <[email protected]>
Subject: Plaintext email with with URL in body
To: Mats Kronberg <[email protected]>
Content-Type: text/plain; charset="UTF-8"

Here is the test URL in a shorted email: https://www.google.com

mutest@ventus:~$ 

nsc-kronberg avatar Aug 25 '21 11:08 nsc-kronberg

Hmm, that's puzzling, it works fine here (albeit with the emacs 28 dev version).

Now, the binding you're seeing is not the expected one -- what you should see is:

mu4e~view-browse-url-from-binding is an interactive function defined
in mu4e-view-common.el.

Signature
(mu4e~view-browse-url-from-binding &optional URL)

Documentation
View in browser the url at point, or click location.

So not quite sure what's not working.

djcb avatar Aug 25 '21 11:08 djcb

Did some more testing...

  • Emacs 28 built from the Git master branch (f09ee98e68): OK, works as expected
  • Emacs 27.2 built from source tarball: OK, works as expected
  • Emacs 26.3 built from source tarball: FAIL, same problem as the Ubuntu-packaged 26.3

nsc-kronberg avatar Aug 25 '21 12:08 nsc-kronberg

I'm using Emacs 27.1 (Debian) and it works fine (both with mouse-1 and M-RET).

Did you try with Enter Debugger on Error?

image

Chris00 avatar Aug 25 '21 14:08 Chris00

I'm using Emacs 27.1 (Debian) and it works fine (both with mouse-1 and M-RET).

Did you try with Enter Debugger on Error?

I tried that now (Emacs 26.3), but nothing happens at all when I click the link. No debugger, nothing in the echo area or Messages buffer. If I press M-RET, I get "M-RET is undefined" in the echo area and Messages.

I'm not surprised that it works for you. As you can see in my last post, I tested with Emacs 26.3, 27.2 and 28.latest, and it's only in 26.3 (the default version in Ubuntu LTS 20.04) I get this problem.

nsc-kronberg avatar Aug 25 '21 15:08 nsc-kronberg

Thanks for checking; weird problem. Perhaps the NEWS for emacs 27.2 has a hint want changed in this area.

djcb avatar Aug 26 '21 12:08 djcb

If this still happens, one other interesting thing to test would be to use C-h k and left-click on a link. This should get you to the description of mu4e~view-browse-url-from-binding (at least in 1.7.x).

If you see that, but it still doesn't work, perhaps it's something with the browser setup? I.e. check browse-url.

djcb avatar May 30 '22 19:05 djcb