2

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 setw3m-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?

Community
  • 1
  • 1
Clarence
  • 721
  • 1
  • 5
  • 9
  • What happens if you use `(setq browse-url-browser-function 'browse-url-chromium)` and `(setq browse-url-chromium-program "chrome")`? (replace chrome with the name of the chrome executable, if different. – juanleon Dec 11 '15 at 08:32
  • @juanleon It is still a message `byte-code: Install w3m command in exec-path or set-w3m-command variable correctly`. And I've tried to set a break point via `(debug-on-entry browse-url-chromium)`, but the debugger never stopped there. – Clarence Dec 11 '15 at 13:46
  • did you try with `emacs -Q`? Maybe some package is trying to override w3 browsing for you. – juanleon Dec 14 '15 at 08:16
  • @juanleon Yes, of course. `emacs -Q` make this links' behavior normal. However, I've installed too many packages... – Clarence Dec 21 '15 at 09:51
  • you need to do a binary search then... comment out half of the config, then check for behavior and comment/uncomment a quarter of the config, etc... – juanleon Dec 23 '15 at 07:29
  • Thanks @juanleon. A binary searching will be helpful. I'll do it sometime soon. – Clarence Dec 24 '15 at 08:24

0 Answers0