emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Suggested change in net/browse-url.el


From: David Kastrup
Subject: Re: Suggested change in net/browse-url.el
Date: 03 Apr 2004 03:44:09 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Richard Stallman <address@hidden> writes:

>        (if (not browse-url-generic-program)
>        (error "No browser defined (`browse-url-generic-program')"))
>     -  (apply 'start-process (concat browse-url-generic-program url) nil
>     -  browse-url-generic-program
>     +  (apply 'call-process browse-url-generic-program nil
>     +  0 nil
>            (append browse-url-generic-args (list url))))
> 
> This change will always run the browser synchronously.

No, it won't.

call-process is a built-in function.
(call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS)

Call PROGRAM synchronously in separate process.
The remaining arguments are optional.
The program's input comes from file INFILE (nil means `/dev/null').
Insert output in BUFFER before point; t means current buffer;
 nil for BUFFER means discard it; 0 means discard and don't wait.

[...]

Since I use 0 here, the output of calling the process is discarded
and Emacs does _not_ wait.

In fact, this way of using call-process is the _only_ way to start a
process in the background without getting an associated process object
within Emacs.  It is a bit confusing that the API for starting a
particularly asynchronous kind of process is hidden in the function
used normally for starting synchronous processes, but that's not my
fault.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

[Prev in Thread] Current Thread [Next in Thread]