all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andreas Amann <a.amann@ucc.ie>
To: <emacs-devel@gnu.org>
Subject: Fix bug with new firefox
Date: Mon, 2 Mar 2015 17:13:31 +0000	[thread overview]
Message-ID: <87pp8r5nlw.fsf@msstf091.ucc.ie> (raw)

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


             reply	other threads:[~2015-03-02 17:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-02 17:13 Andreas Amann [this message]
2015-03-02 19:55 ` Fix bug with new firefox 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

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=87pp8r5nlw.fsf@msstf091.ucc.ie \
    --to=a.amann@ucc.ie \
    --cc=emacs-devel@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.