[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

browse-url and URL handlers (MS-Windows)

From: Pascal Quesseveur
Subject: browse-url and URL handlers (MS-Windows)
Date: Mon, 03 Oct 2022 11:44:13 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (windows-nt)


On MS-Windows I had set browse-url-browser-function to a custom
function which calls 'rundll32 url.dll,FileProtocolHandler ...'  to
open the URL with the dedicated program. I had set that definition
some years ago and I am pretty sure it worked.

With 28.1 it appears that my function is no longer called. It seems to
me it comes from the fact that browse-url uses
browse-url-default-handlers which is defined as:

(("\\`mailto:"; . browse-url--mailto)
 ("\\`man:" . browse-url--man)
 (browse-url--non-html-file-url-p . browse-url-emacs))

That means that for a URL which is not identified as HTML browse-url
calls browse-url-emacs. On my system that doesn't work when files are
not ASCII file (PNG, RTF, ...). I can define browse-url-handlers to
set a handler to open those files with an axternal program but I find
it annoying.

When called with a PREFIX browse-url calls
browse-url-secondary-browser-function which calls
browse-url-default-windows-browser. On MS-Windows that function calls
the MS-Windows system's default Web browser

(w32-shell-execute "open" ...)

and everything works as expected.

Why not always call browse-url-default-windows-browser in browse-url?
If I want to open a certain type of file with emacs, I can configure
the system to use emacsclient with that type of file.  IMO things
would be easier.

Pascal Quesseveur

reply via email to

[Prev in Thread] Current Thread [Next in Thread]