Choice of default browser for MIME parts?

4 views
Skip to first unread message

Tim Lavoie

unread,
Feb 26, 2026, 1:05:30 PM (7 days ago) Feb 26
to mu-di...@googlegroups.com
Hello,

I've been using mu4e for quite a while, though mostly without having to
mess around much. One quirk I've started trying to track down is still
eluding me.

I've switched default browsers on this system, where Firefox was the
default originally. I've configured it so xdg-open calls the new
default, and from within article view, opens the correct browser.

Where I run into challenges is that the "A v" method of opening in a
browser still opens it in Firefox. I haven't got any reference to
Firefox in current customizations or init files.

Suggestions?

  Cheers,
  Tim
  

Dirk-Jan C. Binnema

unread,
Mar 1, 2026, 2:22:26 AM (4 days ago) Mar 1
to mu-di...@googlegroups.com
Ultimately, this is handled by an Emacs function "browse-url", and you
can influence the program it uses through some variables:

,----
| The variables ‘browse-url-browser-function’,
| ‘browse-url-handlers’, and ‘browse-url-default-handlers’
| determine which browser function to use.
`----

Probably `browse-url-browser-function' can do the trick here.

By default, it is set to `browse-url-default-browser', which tries a few
thing, among which is trying xdg-open if it can.

So perhaps try
M-x browse-url
and see if that works.

Hope that helps,
Dirk.

--
Dirk-Jan C. Binnema Helsinki, Finland
e:dj...@djcbsoftware.nl w:www.djcbsoftware.nl
gpg: 6987 9CED 1745 9375 0F14 DA98 11DD FEA9 DCC4 A036

Tim Lavoie

unread,
Mar 1, 2026, 2:56:54 AM (4 days ago) Mar 1
to mu-di...@googlegroups.com
Thanks Dirk. 

M-x browse-url does indeed do what I want, opening my default browser.
Looking at those three variables you (and indeed, the docs) mention, I was still expecting that my preferred default browser would be used.
I figured it out (and will get there), but for the purpose of this discussion:

browse-url-browser-function is a variable defined in ‘browse-url.el’.
- Its value is ‘browse-url-default-browser’

browse-url-handlers is a variable defined in ‘browse-url.el’.
- Its value is nil

browse-url-default-handlers is a variable defined in ‘browse-url.el’.
- Its value is
(("\\mailto:" . browse-url--mailto) ("\\man:" . browse-url--man)
 ("\\irc6?s?://" . browse-url--irc)
 (browse-url--non-html-file-url-p . browse-url-emacs))

OK, fine, back to square one. Looking at the "a-v" action (view in browser), I started looking up function definitions, opening up plausible subjects in the code, and going a bit down the rabbit hole. I should do this more in Emacs, but after all this time, it's something I haven't done much of before. It is very cool that I *can*, however.

Anyway, it occurred to me in all this that the end result seems to be calling browse-url after all, but after the gnus article code has written it out as a temporary HTML file.
xdg-open https://whatever opens Vivaldi, while xdg-open file://foo.html opens Firefox.

Aha! It's not what Emacs is doing after all, but the desktop settings that hadn't caught up for opening an HTML file. I changed that, and it works!

  Cheers,
  Tim

--
You received this message because you are subscribed to the Google Groups "mu-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mu-discuss+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/mu-discuss/87y0kcggkc.fsf%40djcbsoftware.nl.

Dirk-Jan C. Binnema

unread,
Mar 1, 2026, 12:42:09 PM (4 days ago) Mar 1
to mu-di...@googlegroups.com
Hi Tim,
Great you figured it out and thank you for sharing the steps!

Kind regards,

Tim Lavoie

unread,
Mar 1, 2026, 9:55:31 PM (4 days ago) Mar 1
to mu-di...@googlegroups.com
Hey Dirk,

I figured I had better document these things, because it drove me crazy for a bit. Best to assume I'm not alone in doing slightly daft things.

  Tim

--
You received this message because you are subscribed to the Google Groups "mu-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mu-discuss+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages