From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.help Subject: Re: browse-url Date: Mon, 04 Apr 2005 02:31:00 +0200 Organization: Organization?!? Message-ID: References: <877jjn742a.fsf@desktop.xx.yy> <877jjjsbub.fsf@desktop.xx.yy> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1112627104 17840 80.91.229.2 (4 Apr 2005 15:05:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 4 Apr 2005 15:05:04 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Apr 04 17:05:02 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DIT81-0002Vn-0K for geh-help-gnu-emacs@m.gmane.org; Mon, 04 Apr 2005 17:04:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DISgh-0002KR-Sr for geh-help-gnu-emacs@m.gmane.org; Mon, 04 Apr 2005 10:36:23 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsmi-us.news.garr.it!newsmi-eu.news.garr.it!NewsITBone-GARR!irazu.switch.ch!switch.ch!news.belwue.de!newsfeed.arcor.de!news.arcor.de!not-for-mail Original-Newsgroups: gnu.emacs.help X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:MHVL1mjy0bleqaRiDc0GYIdSY3o= Original-Lines: 58 Original-NNTP-Posting-Date: 04 Apr 2005 02:31:00 MEST Original-NNTP-Posting-Host: 69ef77f0.newsread2.arcor-online.net Original-X-Trace: DXC=eJgVYkZ=bX22j7j^L?86D8Q5U85hF6f; 4jW\KbG]kaM8]kI_X=5Kea69Y>^WR5\`; 11_LiI6ENVa=3>5MOK` List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:25366 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:25366 Hugh Lawson writes: > David Kastrup writes: > >> Hugh Lawson writes: >> >> > Debian sarge >> > Emacs 21.4.1 >> > >> > browse-url works fine if firefox is already running. >> > >> > But suppose firefox isn't running. >> > >> > If I do 'M-x browse-url' and fill in the url, then firefox pops up for >> > a second and then disappears. The same thing happens with links I >> > click on in Emacs. >> > >> > I think I can imagine a shell script to deal with this, but surely >> > there is something alread in Emacs. >> >> The definition of browse-url-generic in browse-url.el needs to get >> replaced with: >> >> (defun browse-url-generic (url &optional new-window) >> ;; new-window ignored >> "Ask the WWW browser defined by `browse-url-generic-program' to load URL. >> Default to the URL around or before point. A fresh copy of the >> browser is started up in a new process with possible additional arguments >> `browse-url-generic-args'. This is appropriate for browsers which >> don't offer a form of remote control." >> (interactive (browse-url-interactive-arg "URL: ")) >> (if (not browse-url-generic-program) >> (error "No browser defined (`browse-url-generic-program')")) >> (apply 'call-process browse-url-generic-program nil >> 0 nil >> (append browse-url-generic-args (list url)))) > > > I don't understand how this solves my problem. If mozilla-firefox > is open and running. all is well. If it isn't then there is a > problem. Emacs has several possibilities to start processes. Starting with call-process and 0 as third argument detaches the process completely from Emacs. Starting the process with start-process, in contrast, leaves the process associated with Emacs. If the process detaches itself from the tty, Emacs assumes that it is finished and kills the process group. This is what happens with new Firefoxes that try to escape the Emacs tty. This is why you need an Elisp function that will use call-process instead of start-process for starting Firefox if it is supposed to survive detaching. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum