From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Amann Newsgroups: gmane.emacs.devel Subject: Fix bug with new firefox Date: Mon, 2 Mar 2015 17:13:31 +0000 Message-ID: <87pp8r5nlw.fsf@msstf091.ucc.ie> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1425325484 2615 80.91.229.3 (2 Mar 2015 19:44:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 2 Mar 2015 19:44:44 +0000 (UTC) To: Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 02 20:44:30 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YSWGT-0002nt-Nl for ged-emacs-devel@m.gmane.org; Mon, 02 Mar 2015 20:44:29 +0100 Original-Received: from localhost ([::1]:59275 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSWGT-0002OL-A2 for ged-emacs-devel@m.gmane.org; Mon, 02 Mar 2015 14:44:29 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSWGO-0002Nz-Kg for emacs-devel@gnu.org; Mon, 02 Mar 2015 14:44:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YSWGK-0003c4-G1 for emacs-devel@gnu.org; Mon, 02 Mar 2015 14:44:24 -0500 Original-Received: from mail-am1on0621.outbound.protection.outlook.com ([2a01:111:f400:fe00::621]:23803 helo=emea01-am1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSWGK-0003bn-6j for emacs-devel@gnu.org; Mon, 02 Mar 2015 14:44:20 -0500 Original-Received: from VI1PR02CA0021.eurprd02.prod.outlook.com (25.162.7.159) by AMSPR02MB246.eurprd02.prod.outlook.com (10.242.94.147) with Microsoft SMTP Server (TLS) id 15.1.99.14; Mon, 2 Mar 2015 17:13:32 +0000 Original-Received: from DB3FFO11FD049.protection.gbl (2a01:111:f400:7e04::198) by VI1PR02CA0021.outlook.office365.com (2a01:111:e400:581f::31) with Microsoft SMTP Server (TLS) id 15.1.99.14 via Frontend Transport; Mon, 2 Mar 2015 17:13:32 +0000 Original-Received: from mail3.ucc.ie (143.239.1.23) by DB3FFO11FD049.mail.protection.outlook.com (10.47.217.80) with Microsoft SMTP Server (TLS) id 15.1.99.6 via Frontend Transport; Mon, 2 Mar 2015 17:13:31 +0000 Original-Received: from msstf091.ucc.ie (msstf091.ucc.ie [143.239.76.91]) by mail3.ucc.ie (8.14.4/8.14.4) with ESMTP id t22HDVml007096 for ; Mon, 2 Mar 2015 17:13:31 GMT Original-Received: by msstf091.ucc.ie (Postfix, from userid 1000) id 62319A3CD5; Mon, 2 Mar 2015 17:13:31 +0000 (GMT) User-Agent: Notmuch/0.19 (http://notmuchmail.org) Emacs/25.0.50.1 (x86_64-unknown-linux-gnu) X-EOPAttributedMessage: 0 Received-SPF: Pass (protection.outlook.com: domain of ucc.ie designates 143.239.1.23 as permitted sender) receiver=protection.outlook.com; client-ip=143.239.1.23; helo=mail3.ucc.ie; Authentication-Results: spf=pass (sender IP is 143.239.1.23) smtp.mailfrom=a.amann@ucc.ie; gnu.org; dkim=none (message not signed) header.d=none; X-Forefront-Antispam-Report: CIP:143.239.1.23; CTRY:IE; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(979002)(6009001)(438002)(199003)(54534003)(377424004)(189002)(50986999)(2351001)(6806004)(19580395003)(106466001)(103686003)(46102003)(74482002)(229853001)(40036004)(46386002)(16796002)(36756003)(107886001)(45336002)(42186005)(19580405001)(54356999)(77156002)(52956003)(83506001)(84326002)(575784001)(86362001)(15975445007)(92566002)(110136001)(4610100001)(62966003)(450100001)(33646002)(87936001)(90966001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:AMSPR02MB246; H:mail3.ucc.ie; FPR:; SPF:Pass; MLV:ovrnspm; A:0; MX:1; PTR:mail3.ucc.ie; LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AMSPR02MB246; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006); SRVR:AMSPR02MB246; BCL:0; PCL:0; RULEID:; SRVR:AMSPR02MB246; X-Forefront-PRVS: 0503FF9A3E X-OriginatorOrg: ucc.ie X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2015 17:13:31.9178 (UTC) X-MS-Exchange-CrossTenant-Id: 46fe5ca5-866f-4e42-92e9-ed8786245545 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=46fe5ca5-866f-4e42-92e9-ed8786245545; Ip=[143.239.1.23] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AMSPR02MB246 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a01:111:f400:fe00::621 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:183583 Archived-At: --=-=-= Content-Type: text/plain Hi, firefox 36.0 removed the "-remote" command line option, see https://www.mozilla.org/en-US/firefox/36.0/releasenotes/ Unfortunately this breaks "browse-url-firefox" which depends on it. To fix this, please apply the patch below. I also put the patch on github https://github.com/andram/emacs/commit/fd19dadba178f781117dfe524de834f337cbb1a6 not sure which is more convenient for devs, as I am not a regular contributor. Comment of patch: Patch now uses "--new-tab" and "--new-window" command line args, which are supported since a long time. This makes the sentinel redundant. It should in theory also work on MS-Windows, and even improve the situation in that links can now also be opened in a new tab if desired. However, I only tested the patch on linux. Thanks Andreas --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename="0001-support-for-remote-was-removed-in-firefox-36.0.patch" >From fd19dadba178f781117dfe524de834f337cbb1a6 Mon Sep 17 00:00:00 2001 From: Andreas Amann Date: Mon, 2 Mar 2015 16:49:15 +0000 Subject: [PATCH] support for "-remote" was removed in firefox 36.0 Use "--new-tab" and "--new-window" instead in browse-url-firefox --- lisp/ChangeLog | 6 ++++++ lisp/net/browse-url.el | 45 +++++++-------------------------------------- 2 files changed, 13 insertions(+), 38 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7ce2e81..d39ed27 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2015-03-02 Andreas Amann + + * net/browse-url.el (browse-url-firefox): support for "-remote" + was removed in firefox 36.0. Use "--new-tab" and "--new-window" + instead. + 2015-03-02 Daniel Colascione * vc/vc.el (vc-responsible-backend): Add autoload cooking for diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 42fb954..b0c6064 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -1117,53 +1117,22 @@ 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'. - -On MS-Windows systems the optional `new-window' parameter is -ignored. Firefox for Windows does not support the \"-remote\" -command line parameter. Therefore, the -`browse-url-new-window-flag' and `browse-url-firefox-new-window-is-tab' -are ignored as well. Firefox on Windows will always open the requested -URL in a new window." +NEW-WINDOW is used instead of `browse-url-new-window-flag'." (interactive (browse-url-interactive-arg "URL: ")) (setq url (browse-url-encode-url url)) (let* ((process-environment (browse-url-process-environment)) - (use-remote - (not (memq system-type '(windows-nt ms-dos)))) (process (apply 'start-process (concat "firefox " url) nil browse-url-firefox-program (append browse-url-firefox-arguments - (if use-remote - (list "-remote" - (concat - "openURL(" - url - (if (browse-url-maybe-new-window new-window) - (if browse-url-firefox-new-window-is-tab - ",new-tab" - ",new-window")) - ")")) - (list url)))))) - ;; If we use -remote, the process exits with status code 2 if - ;; Firefox is not already running. The sentinel runs firefox - ;; directly if that happens. - (when use-remote - (set-process-sentinel process - `(lambda (process change) - (browse-url-firefox-sentinel process ,url)))))) - -(defun browse-url-firefox-sentinel (process url) - "Handle a change to the process communicating with Firefox." - (or (eq (process-exit-status process) 0) - (let* ((process-environment (browse-url-process-environment))) - ;; Firefox is not running - start it - (message "Starting Firefox...") - (apply 'start-process (concat "firefox " url) nil - browse-url-firefox-program - (append browse-url-firefox-startup-arguments (list url)))))) + (if (browse-url-maybe-new-window new-window) + (if browse-url-firefox-new-window-is-tab + '("--new-tab") + '("--new-window")) + '("--new-tab")) + (list url))))))) ;;;###autoload (defun browse-url-chromium (url &optional _new-window) -- 2.3.1 --=-=-=--