There is problem in my emacs: when I click a link in org-mode, it always prompt me:
byte-code: Install w3m command in
exec-path' or set
w3m-command' variable correctly
It is very strange that the URL could be correctly opened by Chrome when I run browse-url http://google.com
via M-x
. However, when I click it, the error comes out!
Actually I don't wanna use w3m -- I wanna use Chrome to open the link.
I've searched for the answer, and found the following solution. But it does NOT work for me.
(setq browse-url-browser-function 'browse-url-generic
browse-url-generic-program "chromium-browser")
(setq browse-url-browser-function 'browse-url-default-windows-browser)
(setq browse-url-browser-function 'browse-url-default-macosx-browser)
-- from How to make emacs org-mode open links to sites in Google Chrome
I've also tried to debug the browse-url
, but failed to find the reason.
Now I've got a temporary rough solution -- overwrite the browse-url
function:
(defun browse-url (url &rest args)
"Browse url using outer browser"
(interactive (browse-url-interactive-arg "URL: "))
(call-process "open" nil nil nil url))
Are there any elegant solutions?