unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#30673: [PATCH] Allow `browse-url-emacs' to fetch url in same window.
@ 2018-03-02  0:14 Pierre Téchoueyres
  2018-03-10 11:20 ` Eli Zaretskii
  2018-03-19  9:18 ` Eli Zaretskii
  0 siblings, 2 replies; 4+ messages in thread
From: Pierre Téchoueyres @ 2018-03-02  0:14 UTC (permalink / raw)
  To: 30673

[-- Attachment #1: Type: text/plain, Size: 184 bytes --]

Here is a patch to allow browse-url-emacs to be invoked in a way to
reuse the current window.

Could it be included into master branch ? I guess it's too late  for
emacs-26.

Thanks



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: browse-url-emacs --]
[-- Type: text/x-patch, Size: 1510 bytes --]

From 8bd95d79c32b29bd11202ced04fd811d4a8f6119 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pierre=20T=C3=A9choueyres?= <pierre.techoueyres@free.fr>
Date: Thu, 1 Mar 2018 22:22:05 +0100
Subject: [PATCH] Allow `browse-url-emacs' to fetch url in same window.

* lisp/net/browse-url.el (browse-url-emacs): add same-window argument.
---
 lisp/net/browse-url.el | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index 98b0acfc0c..a8055d1dc9 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -1243,18 +1243,14 @@ browse-url-epiphany-sentinel
 (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)
--
2.14.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#30673: [PATCH] Allow `browse-url-emacs' to fetch url in same window.
  2018-03-02  0:14 bug#30673: [PATCH] Allow `browse-url-emacs' to fetch url in same window Pierre Téchoueyres
@ 2018-03-10 11:20 ` Eli Zaretskii
  2018-03-10 15:05   ` Pierre Téchoueyres
  2018-03-19  9:18 ` Eli Zaretskii
  1 sibling, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2018-03-10 11:20 UTC (permalink / raw)
  To: Pierre Téchoueyres; +Cc: 30673

> From: Pierre Téchoueyres <pierre.techoueyres@free.fr>
> Date: Fri, 02 Mar 2018 01:14:03 +0100
> 
> Here is a patch to allow browse-url-emacs to be invoked in a way to
> reuse the current window.

Thanks, but doesn't this go against the comment in the current code,
which says all the other browsers show the URL in another window?





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#30673: [PATCH] Allow `browse-url-emacs' to fetch url in same window.
  2018-03-10 11:20 ` Eli Zaretskii
@ 2018-03-10 15:05   ` Pierre Téchoueyres
  0 siblings, 0 replies; 4+ messages in thread
From: Pierre Téchoueyres @ 2018-03-10 15:05 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 30673

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Pierre Téchoueyres <pierre.techoueyres@free.fr>
>> Date: Fri, 02 Mar 2018 01:14:03 +0100
>>
>> Here is a patch to allow browse-url-emacs to be invoked in a way to
>> reuse the current window.
>
> Thanks, but doesn't this go against the comment in the current code,
> which says all the other browsers show the URL in another window?
>
I don't thik so. I didn't change the default behaviour, which stay like
for the other browsers. But I added a possibility, which I think, make emacs
better than the other browsers.

Actually, the only way to browse an URL reusing the same Emacs window is
to define another `brows-url-emacs' duplicating this one.

I think it's just sad this possibility wasn't allowed because others
browsers aren't able to do it.

I don't know a way, for the others browsers, to reuse the same window /
tabs / whatever to display another url. This is, I think, the reason of
the comment. Maybe I should then add a comment to state this more
clearly ?

#+begin_src emacs-lisp
;; 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. But, here we can control that, so let's have the choice !
#+end_src

What do you think ?

And I didn't thiks about this : but should I add something in NEWS ?





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#30673: [PATCH] Allow `browse-url-emacs' to fetch url in same window.
  2018-03-02  0:14 bug#30673: [PATCH] Allow `browse-url-emacs' to fetch url in same window Pierre Téchoueyres
  2018-03-10 11:20 ` Eli Zaretskii
@ 2018-03-19  9:18 ` Eli Zaretskii
  1 sibling, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2018-03-19  9:18 UTC (permalink / raw)
  To: Pierre Téchoueyres; +Cc: 30673

> From: Pierre Téchoueyres <pierre.techoueyres@free.fr>
> Date: Fri, 02 Mar 2018 01:14:03 +0100
> 
> Here is a patch to allow browse-url-emacs to be invoked in a way to
> reuse the current window.

Thanks, pushed to the master branch.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-03-19  9:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-02  0:14 bug#30673: [PATCH] Allow `browse-url-emacs' to fetch url in same window Pierre Téchoueyres
2018-03-10 11:20 ` Eli Zaretskii
2018-03-10 15:05   ` Pierre Téchoueyres
2018-03-19  9:18 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).