Function: browse-url-emacs
browse-url-emacs is an autoloaded, interactive and byte-compiled
function defined in browse-url.el.gz.
Signature
(browse-url-emacs URL &optional SAME-WINDOW)
Documentation
Ask Emacs to load URL into a buffer and show it in another window.
Optional argument SAME-WINDOW non-nil means show the URL in the currently selected window instead.
Probably introduced at or before Emacs version 22.2.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/net/browse-url.el.gz
;;;###autoload
(defun browse-url-emacs (url &optional same-window)
"Ask Emacs to load URL into a buffer and show it in another window.
Optional argument SAME-WINDOW non-nil means show the URL in the
currently selected window instead."
(interactive (browse-url-interactive-arg "URL: "))
(require 'url-handlers)
(let ((parsed (url-generic-parse-url url))
(func (if same-window 'find-file 'find-file-other-window)))
(if (and (equal (url-type parsed) "file")
(file-directory-p (url-filename parsed)))
;; It's a directory; just open it.
(funcall func (url-filename parsed))
(let ((file-name-handler-alist
(cons (cons url-handler-regexp 'url-file-handler)
file-name-handler-alist)))
(funcall func url)))))