[ < ] | [ > ] | [ << ] | [Plus haut] | [ >> ] | [Top] | [Table des matières] | [Index] | [ ? ] |
A process can (and usually does) have an associated buffer, which is an ordinary Emacs buffer that is used for two purposes: storing the output from the process, and deciding when to kill the process. You can also use the buffer to identify a process to operate on, since in normal practice only one process is associated with any given buffer. Many applications of processes also use the buffer for editing input to be sent to the process, but this is not built into Emacs Lisp.
Unless the process has a filter function (voir la section Process Filter Functions), its
output is inserted in the associated buffer. The position to insert the
output is determined by the process-mark
, which is then updated to
point to the end of the text just inserted. Usually, but not always, the
process-mark
is at the end of the buffer.
This function returns the associated buffer of the process process.
(process-buffer (get-process "shell")) ⇒ #<buffer *shell*> |
This function returns the process marker for process, which is the marker that says where to insert output from the process.
If process does not have a buffer, process-mark
returns a
marker that points nowhere.
Insertion of process output in a buffer uses this marker to decide where to insert, and updates it to point after the inserted text. That is why successive batches of output are inserted consecutively.
Filter functions normally should use this marker in the same fashion as is
done by direct insertion of output in the buffer. A good example of a
filter function that uses process-mark
is found at the end of the
following section.
When the user is expected to enter input in the process buffer for transmission to the process, the process marker separates the new input from previous output.
This function sets the buffer associated with process to
buffer. If buffer is nil
, the process becomes associated
with no buffer.
This function returns a nondeleted process associated with the buffer
specified by buffer-or-name. If there are several processes
associated with it, this function chooses one (currently, the one most
recently created, but don't count on that). Deletion of a process (see
delete-process
) makes it ineligible for this function to return.
It is usually a bad idea to have more than one process associated with the same buffer.
(get-buffer-process "*shell*") ⇒ #<process shell> |
Killing the process's buffer deletes the process, which kills the subprocess
with a SIGHUP
signal (voir la section Sending Signals to Processes).
[ < ] | [ > ] | [ << ] | [Plus haut] | [ >> ] | [Top] | [Table des matières] | [Index] | [ ? ] |
Ce document a été généré par Eric Reinbold le 13 Octobre 2007 en utilisant texi2html 1.78.