unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Fix bug with new firefox
@ 2015-03-02 17:13 Andreas Amann
  2015-03-02 19:55 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Amann @ 2015-03-02 17:13 UTC (permalink / raw)
  To: emacs-devel

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

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-support-for-remote-was-removed-in-firefox-36.0.patch --]
[-- Type: text/x-diff, Size: 3411 bytes --]

From fd19dadba178f781117dfe524de834f337cbb1a6 Mon Sep 17 00:00:00 2001
From: Andreas Amann <a.amann@ucc.ie>
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  <a.amann@ucc.ie>
+
+	* 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  <dancol@dancol.org>
 
 	* 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


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

* Re: Fix bug with new firefox
  2015-03-02 17:13 Fix bug with new firefox Andreas Amann
@ 2015-03-02 19:55 ` Eli Zaretskii
  2015-03-02 20:58   ` Andreas Amann
  2015-03-03  5:33   ` Thierry Volpiatto
  0 siblings, 2 replies; 8+ messages in thread
From: Eli Zaretskii @ 2015-03-02 19:55 UTC (permalink / raw)
  To: Andreas Amann; +Cc: emacs-devel

> From: Andreas Amann <a.amann@ucc.ie>
> Date: Mon, 2 Mar 2015 17:13:31 +0000
> 
> 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.

In which version of Firefox were these two options introduced?



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

* Re: Fix bug with new firefox
  2015-03-02 19:55 ` Eli Zaretskii
@ 2015-03-02 20:58   ` Andreas Amann
  2015-03-03  5:33   ` Thierry Volpiatto
  1 sibling, 0 replies; 8+ messages in thread
From: Andreas Amann @ 2015-03-02 20:58 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:
>> From: Andreas Amann <a.amann@ucc.ie>
>> Date: Mon, 2 Mar 2015 17:13:31 +0000
>> 
>> 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.
>
> In which version of Firefox were these two options introduced?

Not sure.  I see them first mentioned in the release notes for Firefox
2.0 from 2006:
http://website-archive.mozilla.org/www.mozilla.org/firefox_releasenotes/en-US/firefox/2.0/releasenotes/
At that point "-remote" was deprecated. 

However, back then they were spelled with one hyphen, i.e. "-new-tab"
and "-new-window".  I don't know, since when the double-hyphen version
are working.  To be on the save side, it is probably better to use
single-hyphen "-new-tab" and "-new-window"?



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

* Re: Fix bug with new firefox
  2015-03-02 19:55 ` Eli Zaretskii
  2015-03-02 20:58   ` Andreas Amann
@ 2015-03-03  5:33   ` Thierry Volpiatto
  1 sibling, 0 replies; 8+ messages in thread
From: Thierry Volpiatto @ 2015-03-03  5:33 UTC (permalink / raw)
  To: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Andreas Amann <a.amann@ucc.ie>
>> Date: Mon, 2 Mar 2015 17:13:31 +0000
>> 
>> 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.
>
> In which version of Firefox were these two options introduced?

AFAIK this have been fixed in emacs-24 1b0ebbd.

-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 




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

* Re: Fix bug with new firefox
@ 2015-03-03 17:08 Andreas Amann
  2015-03-03 17:54 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Amann @ 2015-03-03 17:08 UTC (permalink / raw)
  To: emacs-devel

> AFAIK this have been fixed in emacs-24 1b0ebbd.

You are right.  However it seems that 1b0ebbd was only applied to
emacs-24 and not to master which I was using.  Could it be applied to
master as well?




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

* Re: Fix bug with new firefox
  2015-03-03 17:08 Andreas Amann
@ 2015-03-03 17:54 ` Eli Zaretskii
  2015-03-03 18:10   ` Óscar Fuentes
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2015-03-03 17:54 UTC (permalink / raw)
  To: Andreas Amann; +Cc: emacs-devel

> From: Andreas Amann <a.amann@ucc.ie>
> Date: Tue, 3 Mar 2015 17:08:03 +0000
> 
> > AFAIK this have been fixed in emacs-24 1b0ebbd.
> 
> You are right.  However it seems that 1b0ebbd was only applied to
> emacs-24 and not to master which I was using.  Could it be applied to
> master as well?

It will be, whenever emacs-24 is next merged to master.



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

* Re: Fix bug with new firefox
  2015-03-03 17:54 ` Eli Zaretskii
@ 2015-03-03 18:10   ` Óscar Fuentes
  2015-03-03 18:18     ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Óscar Fuentes @ 2015-03-03 18:10 UTC (permalink / raw)
  To: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> > AFAIK this have been fixed in emacs-24 1b0ebbd.
>> 
>> You are right.  However it seems that 1b0ebbd was only applied to
>> emacs-24 and not to master which I was using.  Could it be applied to
>> master as well?
>
> It will be, whenever emacs-24 is next merged to master.

That fix still special-cases Windows, though. IIRC it was mentioned on
this thread that Firefox on Windows supports the new switches.




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

* Re: Fix bug with new firefox
  2015-03-03 18:10   ` Óscar Fuentes
@ 2015-03-03 18:18     ` Eli Zaretskii
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2015-03-03 18:18 UTC (permalink / raw)
  To: Óscar Fuentes; +Cc: emacs-devel

> From: Óscar Fuentes <ofv@wanadoo.es>
> Date: Tue, 03 Mar 2015 19:10:19 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> > AFAIK this have been fixed in emacs-24 1b0ebbd.
> >> 
> >> You are right.  However it seems that 1b0ebbd was only applied to
> >> emacs-24 and not to master which I was using.  Could it be applied to
> >> master as well?
> >
> > It will be, whenever emacs-24 is next merged to master.
> 
> That fix still special-cases Windows, though. IIRC it was mentioned on
> this thread that Firefox on Windows supports the new switches.

Feel free to fix the fix, if you can verify it works on Windows.




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

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

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-02 17:13 Fix bug with new firefox Andreas Amann
2015-03-02 19:55 ` Eli Zaretskii
2015-03-02 20:58   ` Andreas Amann
2015-03-03  5:33   ` Thierry Volpiatto
  -- strict thread matches above, loose matches on Subject: below --
2015-03-03 17:08 Andreas Amann
2015-03-03 17:54 ` Eli Zaretskii
2015-03-03 18:10   ` Óscar Fuentes
2015-03-03 18: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).