]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow 'browse-url-emacs' to fetch URL in the selected window
authorPierre Téchoueyres <pierre.techoueyres@free.fr>
Thu, 1 Mar 2018 21:22:05 +0000 (22:22 +0100)
committerAndrew G Cohen <cohen@andy.bu.edu>
Tue, 11 Dec 2018 06:17:51 +0000 (14:17 +0800)
* lisp/net/browse-url.el (browse-url-emacs): Use same-window argument.
(Bug#30673)

lisp/net/browse-url.el

index 8086495aaaa99c426444bf7e990bc44b786bcb47..3b5169d4734bfa3d24e4ba83338a404eceebc647 100644 (file)
@@ -1242,18 +1242,14 @@ used instead of `browse-url-new-window-flag'."
 (defvar url-handler-regexp)
 
 ;;;###autoload
-(defun browse-url-emacs (url &optional _new-window)
+(defun browse-url-emacs (url &optional same-window)
   "Ask Emacs to load URL into a buffer and show it in another window."
   (interactive (browse-url-interactive-arg "URL: "))
   (require 'url-handlers)
   (let ((file-name-handler-alist
          (cons (cons url-handler-regexp 'url-file-handler)
                file-name-handler-alist)))
-    ;; Ignore `new-window': with all other browsers the URL is always shown
-    ;; in another window than the current Emacs one since it's shown in
-    ;; another application's window.
-    ;; (if new-window (find-file-other-window url) (find-file url))
-    (find-file-other-window url)))
+    (if same-window (find-file url) (find-file-other-window url))))
 
 ;;;###autoload
 (defun browse-url-gnome-moz (url &optional new-window)