all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Pierre Téchoueyres" <pierre.techoueyres@free.fr>
To: 30673@debbugs.gnu.org
Subject: bug#30673: [PATCH] Allow `browse-url-emacs' to fetch url in same window.
Date: Fri, 02 Mar 2018 01:14:03 +0100	[thread overview]
Message-ID: <87606fe3lg.fsf@killashandra.ballybran.fr> (raw)

[-- 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

             reply	other threads:[~2018-03-02  0:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-02  0:14 Pierre Téchoueyres [this message]
2018-03-10 11:20 ` bug#30673: [PATCH] Allow `browse-url-emacs' to fetch url in same window Eli Zaretskii
2018-03-10 15:05   ` Pierre Téchoueyres
2018-03-19  9:18 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87606fe3lg.fsf@killashandra.ballybran.fr \
    --to=pierre.techoueyres@free.fr \
    --cc=30673@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.