Function: browse-url-default-windows-browser

browse-url-default-windows-browser is an interactive and byte-compiled function defined in browse-url.el.gz.

Signature

(browse-url-default-windows-browser URL &optional NEW-WINDOW)

Documentation

Invoke the MS-Windows system's default Web browser.

The optional NEW-WINDOW argument is not used.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/net/browse-url.el.gz
(declare-function w32-shell-execute "w32fns.c")    ;; Defined in C.

(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."
  (interactive (browse-url-interactive-arg "URL: "))
  (setq url (browse-url-encode-url url))
  (cond ((eq system-type 'ms-dos)
	 (if dos-windows-version
	     (shell-command (concat "start " (shell-quote-argument url)))
	   (error "Browsing URLs is not supported on this system")))
	((eq system-type 'cygwin)
	 (call-process "cygstart" nil nil nil url))
	(t
         (w32-shell-execute "open"
                            ;; w32-shell-execute passes file:// URLs
                            ;; to APIs that expect file names, so we
                            ;; need to unhex any %nn encoded
                            ;; characters in the URL.  We don't do
                            ;; that for other URLs; in particular,
                            ;; default Windows mail client barfs on
                            ;; quotes in the MAILTO URLs, so we prefer
                            ;; to leave the URL with its embedded %nn
                            ;; encoding intact.
                            (if (eq t (compare-strings url nil 7
                                                       "file://" nil nil))
                                (url-unhex-string url)
                              url)))))