GNU bug report logs - #8917
browse-url-xdg-open can fail to return

Previous Next

Package: emacs;

Reported by: Lawrence Mitchell <wence <at> gmx.li>

Date: Wed, 22 Jun 2011 09:19:02 UTC

Severity: normal

Done: Jan Djärv <jan.h.d <at> swipnet.se>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8917 in the body.
You can then email your comments to 8917 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8917; Package emacs. (Wed, 22 Jun 2011 09:19:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lawrence Mitchell <wence <at> gmx.li>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 22 Jun 2011 09:19:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Lawrence Mitchell <wence <at> gmx.li>
To: bug-gnu-emacs <at> gnu.org
Subject: browse-url-xdg-open can fail to return
Date: Wed, 22 Jun 2011 10:18:28 +0100
In GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.4)
 of 2011-06-06 on e4300lm
Windowing system distributor `The X.Org Foundation', version 11.0.11001000
configured using `configure '-C''

If Emacs uses browse-url-xdg-open to open URLs, and the browser
is /not/ already running, browse-url starts a new browser process
and then sits waiting for it to complete.  Control does not
return to Emacs until the browser is quit.

I believe this is an unintended side-effect of this change:

| 2010-10-08  Andreas Schwab  <schwab <at> linux-m68k.org>

| 	* net/browse-url.el (browse-url-xdg-open): Remove use of /bin/sh.


I think the correct fix is to just discard output from the
command and return immediately (nohup is then also not needed).
Here's a patch:

--8<---------------cut here---------------start------------->8---
From c7183b3a4886a65951b155b1e0d57e0b50e19504 Mon Sep 17 00:00:00 2001
From: Lawrence Mitchell <wence <at> gmx.li>
Date: Wed, 22 Jun 2011 10:08:29 +0100
Subject: [PATCH] browse-url: Don't wait for xdg-open to return

* net/browse-url.el (browse-url-xdg-open): Use 0, rather than nil
BUFFER in call-process.
---
 lisp/ChangeLog         |    5 +++++
 lisp/net/browse-url.el |    2 +-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1ab91cf..4511dbc 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2011-06-22  Lawrence Mitchell  <wence <at> gmx.li>
+
+	* net/browse-url.el (browse-url-xdg-open): Use 0, rather than nil
+	BUFFER in call-process.
+
 2011-06-21  Tim Harper  <timcharper <at> gmail.com>
 
 	* term/ns-win.el (ns-initialize-window-system): set
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index c1ec3f0..d9e6827 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -958,7 +958,7 @@ Galeon, Konqueror, Netscape, Mosaic, Lynx in an xterm, and then W3."
 ;;;###autoload
 (defun browse-url-xdg-open (url &optional new-window)
   (interactive (browse-url-interactive-arg "URL: "))
-  (call-process "nohup" nil nil nil "xdg-open" url))
+  (call-process "xdg-open" nil 0 nil url))
 
 ;;;###autoload
 (defun browse-url-netscape (url &optional new-window)

--8<---------------cut here---------------end--------------->8---





Reply sent to Jan Djärv <jan.h.d <at> swipnet.se>:
You have taken responsibility. (Wed, 22 Jun 2011 16:46:02 GMT) Full text and rfc822 format available.

Notification sent to Lawrence Mitchell <wence <at> gmx.li>:
bug acknowledged by developer. (Wed, 22 Jun 2011 16:46:02 GMT) Full text and rfc822 format available.

Message #10 received at 8917-done <at> debbugs.gnu.org (full text, mbox):

From: Jan Djärv <jan.h.d <at> swipnet.se>
To: Lawrence Mitchell <wence <at> gmx.li>
Cc: 8917-done <at> debbugs.gnu.org
Subject: Re: bug#8917: browse-url-xdg-open can fail to return
Date: Wed, 22 Jun 2011 18:45:30 +0200
Hello.

That works, applied.

Thanks,

	Jan D.

2011-06-22 11:18, Lawrence Mitchell skrev:
> In GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.4)
>   of 2011-06-06 on e4300lm
> Windowing system distributor `The X.Org Foundation', version 11.0.11001000
> configured using `configure '-C''
>
> If Emacs uses browse-url-xdg-open to open URLs, and the browser
> is /not/ already running, browse-url starts a new browser process
> and then sits waiting for it to complete.  Control does not
> return to Emacs until the browser is quit.
>
> I believe this is an unintended side-effect of this change:
>
> | 2010-10-08  Andreas Schwab<schwab <at> linux-m68k.org>
>
> | 	* net/browse-url.el (browse-url-xdg-open): Remove use of /bin/sh.
>
>
> I think the correct fix is to just discard output from the
> command and return immediately (nohup is then also not needed).
> Here's a patch:
>
> --8<---------------cut here---------------start------------->8---
>> From c7183b3a4886a65951b155b1e0d57e0b50e19504 Mon Sep 17 00:00:00 2001
> From: Lawrence Mitchell<wence <at> gmx.li>
> Date: Wed, 22 Jun 2011 10:08:29 +0100
> Subject: [PATCH] browse-url: Don't wait for xdg-open to return
>
> * net/browse-url.el (browse-url-xdg-open): Use 0, rather than nil
> BUFFER in call-process.
> ---
>   lisp/ChangeLog         |    5 +++++
>   lisp/net/browse-url.el |    2 +-
>   2 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/lisp/ChangeLog b/lisp/ChangeLog
> index 1ab91cf..4511dbc 100644
> --- a/lisp/ChangeLog
> +++ b/lisp/ChangeLog
> @@ -1,3 +1,8 @@
> +2011-06-22  Lawrence Mitchell<wence <at> gmx.li>
> +
> +	* net/browse-url.el (browse-url-xdg-open): Use 0, rather than nil
> +	BUFFER in call-process.
> +
>   2011-06-21  Tim Harper<timcharper <at> gmail.com>
>
>   	* term/ns-win.el (ns-initialize-window-system): set
> diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
> index c1ec3f0..d9e6827 100644
> --- a/lisp/net/browse-url.el
> +++ b/lisp/net/browse-url.el
> @@ -958,7 +958,7 @@ Galeon, Konqueror, Netscape, Mosaic, Lynx in an xterm, and then W3."
>   ;;;###autoload
>   (defun browse-url-xdg-open (url&optional new-window)
>     (interactive (browse-url-interactive-arg "URL: "))
> -  (call-process "nohup" nil nil nil "xdg-open" url))
> +  (call-process "xdg-open" nil 0 nil url))
>
>   ;;;###autoload
>   (defun browse-url-netscape (url&optional new-window)
>
> --8<---------------cut here---------------end--------------->8---
>
>
>





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 21 Jul 2011 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 339 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.