Nikki's Tumblr

Feb 25
Permalink

Cygwin emacs URL opening fix

The net/browse-url.el provided default for cygwin hosts is broken, it assumes w32-shell-execute works on cygwin, it doesn’t.

The following function is a very simple workaround, cystart will tell windows to open the url, which is most likely the right-ish behaviour (should use default browser)

(defun browse-cygwin (url &optional new-window)
  (interactive)
  (start-process "browser" nil "cygstart" url))

(setq-default browse-url-browser-function browse-cygwin)