From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.bugs Subject: [PATCH] browse-url.el mozilla tab support Date: Thu, 10 Oct 2002 16:37:39 +0200 Sender: bug-gnu-emacs-admin@gnu.org Message-ID: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1034260701 4557 127.0.0.1 (10 Oct 2002 14:38:21 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 10 Oct 2002 14:38:21 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17zeS9-0001B6-00 for ; Thu, 10 Oct 2002 16:38:17 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17zeSJ-0002Ew-00; Thu, 10 Oct 2002 10:38:27 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17zeRf-0001sI-00 for bug-gnu-emacs@gnu.org; Thu, 10 Oct 2002 10:37:47 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17zeRb-0001gy-00 for bug-gnu-emacs@gnu.org; Thu, 10 Oct 2002 10:37:45 -0400 Original-Received: from 178.230.13.217.in-addr.dgcsystems.net ([217.13.230.178] helo=yxa.extundo.com) by monty-python.gnu.org with esmtp (Exim 4.10) id 17zeRa-0001bp-00 for bug-gnu-emacs@gnu.org; Thu, 10 Oct 2002 10:37:42 -0400 Original-Received: from latte.josefsson.org (yxa.extundo.com [217.13.230.178]) by yxa.extundo.com (8.12.6/8.12.6) with ESMTP id g9AEbeFt021864 for ; Thu, 10 Oct 2002 16:37:40 +0200 Original-To: bug-gnu-emacs@gnu.org X-Hashcash: 0:021010:bug-gnu-emacs@gnu.org:a9c3649374932eeb User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-debian-linux-gnu) Errors-To: bug-gnu-emacs-admin@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.bugs:3676 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:3676 Ok to install this? Does FSF have papers for Steve Youngs? Maybe it is too trivial to require papers, it is cut'n'paste of the existing Galeon code. 2002-10-10 Simon Josefsson * browse-url.el (browse-url-mozilla): Doc fix. 2002-10-10 Steve Youngs * browse-url.el (browse-url-mozilla-new-window-is-tab): New. (browse-url-mozilla): Use it. --- browse-url.el.~1.23.~ 2002-07-25 20:49:46.000000000 +0200 +++ browse-url.el 2002-10-10 16:34:46.000000000 +0200 @@ -335,6 +335,13 @@ :type '(repeat (string :tag "Argument")) :group 'browse-url) +(defcustom browse-url-mozilla-new-window-is-tab nil + "*Whether to open up new windows in a tab or a new window. +If non-nil, then open the URL in a new tab rather than a new window if +`browse-url-mozilla' is asked to open it in a new window." + :type 'boolean + :group 'browse-url) + (defcustom browse-url-galeon-new-window-is-tab nil "*Whether to open up new windows in a tab or a new window. If non-nil, then open the URL in a new tab rather than a new window if @@ -853,6 +860,10 @@ random existing one. A non-nil interactive prefix argument reverses the effect of `browse-url-new-window-flag'. +If `browse-url-mozilla-new-window-is-tab' is non-nil, then whenever a +document would otherwise be loaded in a new window, it is loaded in a +new tab in an existing window instead. + When called non-interactively, optional second argument NEW-WINDOW is used instead of `browse-url-new-window-flag'." (interactive (browse-url-interactive-arg "URL: ")) @@ -862,7 +873,8 @@ (setq url (replace-match (format "%%%x" (string-to-char (match-string 0 url))) t t url))) (let* ((process-environment (browse-url-process-environment)) - (process (apply 'start-process + (process + (apply 'start-process (concat "mozilla " url) nil browse-url-mozilla-program (append @@ -870,7 +882,11 @@ (list "-remote" (concat "openURL(" url - (if new-window ",new-window") + (if (browse-url-maybe-new-window + new-window) + (if browse-url-mozilla-new-window-is-tab + ",new-tab") + ",new-window") ")")))))) (set-process-sentinel process `(lambda (process change)