When trying to open URL link in emacs under MSYS2 I get the error browse-url-default-windows-browser: Searching for program: No such file or directory, cygstart. Looking into the function browse-url-default-windows-browser I found out that it needed to call process cygstart:

    (defun browse-url-default-windows-browser (url &optional _new-window)
      "Invoke the MS-Windows system's default Web browser.
    The optional NEW-WINDOW argument is not used."
    ((eq system-type 'cygwin)
             (call-process "cygstart" nil nil nil url))

But there is no cygstart in MSYS2 according to its wiki How does MSYS2 differ from Cygwin. Though the variable system-type really equals 'cygwin and cannot be changed to anything more appropriate.

How to fix this error?


It seems that start works. I made the following change to browse-url.el and then reloaded it with load-file. There is probably a more elegant way of doing this that doesn't involve modifying browse-url.el.

((eq system-type 'cygwin)
 (shell-command (concat "start " (shell-quote-argument url)))))
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.