Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 542046 - >=app-editors/emacs-24.3: "browse-url-firefox" doesn't work for www-client/firefox{,-bin} >= 36.0. Upstream patch available.
Summary: >=app-editors/emacs-24.3: "browse-url-firefox" doesn't work for www-client/fi...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Emacs project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-03 23:28 UTC by Teika kazura
Modified: 2015-03-08 03:46 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Teika kazura 2015-03-03 23:28:18 UTC
This is mainly an emacs issue, not of firefox.

www-client/firefox and www-client/firefox-bin >= 36.0 dropped the command line option "-remote". As a result of this, Emacs' function `browse-url-firefox', which makes firefox open a url, does not work any more. Remember that functions like `org-open-at-piont' rely on "browse-url-firefox", depending on the case.

Emacs upstream provides a patch (for 24.5):
 http://git.savannah.gnu.org/cgit/emacs.git/patch/?id=1b0ebbdb566a8dfa5f45ce121b2c835e9760091f
 (Thread http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19921 discusses this issue.)

The patch (more precisely, its 3rd hunk) seems to apply cleanly to emacs-24.3 and 24.4.

But I'm not sure if it's the best fix in the real world. It'd be safer to write a wrapper of /usr/bin/firefox*, but obviously everyone will be reluctant to take the burden, and it may cause future problems...

Thanks.
Comment 1 Ulrich Müller gentoo-dev 2015-03-07 08:28:08 UTC
CCing mozilla team. Looks like firefox still accepts the -remote option but ignores it. There is no warning or error message and it exits with successful status:

   $ firefox --version
   Mozilla Firefox 36.0
   $ firefox -remote "openURL(http://www.gentoo.org/,new-tab)"
   $ echo $?
   0


As for the Emacs fix, commit 1b0ebbdb isn't what I would call a clean patch, because it contains several unrelated changes like reformatting of docstrings. So I tend to apply the patch posted in http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19921#5 instead.

@teika: The patch posted in the upstream bug uses --new-tab and --new-window whereas the emacs-24 commit has -new-tab and -new-window. Any idea why this was changed? Both variants seem to work with firefox-31.4.0 (which documents "-") and firefox-36.0 (which documents "--").
Comment 2 Ulrich Müller gentoo-dev 2015-03-07 16:12:49 UTC
Added to patchsets and fixed in emacs-23.4-r13 and emacs-24.4-r4: http://gitweb.gentoo.org/proj/emacs-tools.git/commit/?h=patchsets&id=a46bb508acc1e3fd08a299243d95fffd5faf6c35
(Upstream documentation at https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options has a single dash for options, so I guess this is the preferred syntax.)

There is already an upstream bug for firefox ignoring invalid options:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123574
Comment 3 Jory A. Pratt gentoo-dev 2015-03-08 03:46:12 UTC
(In reply to Ulrich Müller from comment #1)
> CCing mozilla team. Looks like firefox still accepts the -remote option but
> ignores it. There is no warning or error message and it exits with
> successful status:
> 
>    $ firefox --version
>    Mozilla Firefox 36.0
>    $ firefox -remote "openURL(http://www.gentoo.org/,new-tab)"
>    $ echo $?
>    0
> 
> 
> As for the Emacs fix, commit 1b0ebbdb isn't what I would call a clean patch,
> because it contains several unrelated changes like reformatting of
> docstrings. So I tend to apply the patch posted in
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19921#5 instead.
> 
> @teika: The patch posted in the upstream bug uses --new-tab and --new-window
> whereas the emacs-24 commit has -new-tab and -new-window. Any idea why this
> was changed? Both variants seem to work with firefox-31.4.0 (which documents
> "-") and firefox-36.0 (which documents "--").

-remote readded in 36.0.1 which has been committed to the tree.