+2014-02-21 Glenn Morris <rgm@gnu.org>
+
+ * internals.texi (Process Internals):
+ * processes.texi (Deleting Processes, Output from Processes)
+ (Process Buffers, Filter Functions, Accepting Output, Sentinels)
+ (Network, Network Servers, Network Processes, Serial Ports):
+ Filters and sentinels can no longer be nil.
+ * elisp.texi (Top): Menu update.
+
2014-02-20 Glenn Morris <rgm@gnu.org>
* functions.texi (Defining Functions): Mention defalias-fset-function.
Receiving Output from Processes
-* Process Buffers:: If no filter, output is put in a buffer.
+* Process Buffers:: By default, output is put in a buffer.
* Filter Functions:: Filter functions accept output from the process.
* Decoding Output:: Filters can get unibyte or multibyte strings.
* Accepting Output:: How to wait until process output arrives.
process is running or @code{t} if the process is stopped.
@item filter
-If non-@code{nil}, a function used to accept output from the process
-instead of a buffer.
+A function used to accept output from the process.
@item sentinel
-If non-@code{nil}, a function called whenever the state of the process
-changes.
+A function called whenever the state of the process changes.
@item buffer
The associated buffer of the process.
at any time. If you explicitly delete a terminated process before it
is deleted automatically, no harm results. Deleting a running
process sends a signal to terminate it (and its child processes, if
-any), and calls the process sentinel if it has one. @xref{Sentinels}.
+any), and calls the process sentinel. @xref{Sentinels}.
When a process is deleted, the process object itself continues to
exist as long as other Lisp objects point to it. All the Lisp
buffer, or the name of a buffer. (A buffer or buffer-name stands for
the process that @code{get-buffer-process} returns.) Calling
@code{delete-process} on a running process terminates it, updates the
-process status, and runs the sentinel (if any) immediately. If the
+process status, and runs the sentinel immediately. If the
process has already terminated, calling @code{delete-process} has no
effect on its status, or on the running of its sentinel (which will
happen sooner or later).
shell command.
@menu
-* Process Buffers:: If no filter, output is put in a buffer.
+* Process Buffers:: By default, output is put in a buffer.
* Filter Functions:: Filter functions accept output from the process.
* Decoding Output:: Filters can get unibyte or multibyte strings.
* Accepting Output:: How to wait until process output arrives.
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 (@pxref{Filter Functions}),
-its output is inserted in the associated buffer. The position to insert
-the output is determined by the @code{process-mark}, which is then
-updated to point to the end of the text just inserted. Usually, but not
-always, the @code{process-mark} is at the end of the buffer.
+ By default, process output is inserted in the associated buffer.
+(You can change this by defining a custom filter function,
+@pxref{Filter Functions}). The position to insert the output is
+determined by the @code{process-mark}, which is then updated to point
+to the end of the text just inserted. Usually, but not always, the
+@code{process-mark} is at the end of the buffer.
@findex process-kill-buffer-query-function
Killing the associated buffer of a process also kills the process.
@cindex process filter
A process @dfn{filter function} is a function that receives the
-standard output from the associated process. If a process has a filter,
-then @emph{all} output from that process is passed to the filter. The
-process buffer is used directly for output from the process only when
-there is no filter.
+standard output from the associated process. @emph{all} output from
+that process is passed to the filter. The default filter simply
+outputs directly to the process buffer.
The filter function can only be called when Emacs is waiting for
something, because process output arrives only at such times. Emacs
filter function. @xref{Debugger}.
Many filter functions sometimes (or always) insert the output in the
-process's buffer, mimicking the actions of Emacs when there is no
-filter. Such filter functions need to make sure that they save the
+process's buffer, mimicking the actions of the default filter.
+Such filter functions need to make sure that they save the
current buffer, select the correct buffer (if different) before
inserting output, and then restore the original buffer.
They should also check whether the buffer is still alive, update the
@defun set-process-filter process filter
This function gives @var{process} the filter function @var{filter}. If
-@var{filter} is @code{nil}, it gives the process no filter.
+@var{filter} is @code{nil}, it gives the process the default filter,
+which inserts the process output into the process buffer.
@end defun
@defun process-filter process
-This function returns the filter function of @var{process}, or @code{nil}
-if it has none.
+This function returns the filter function of @var{process}.
@end defun
Here is an example of the use of a filter function:
@ignore @c The code in this example doesn't show the right way to do things.
Here is another, more realistic example, which demonstrates how to use
-the process mark to do insertion in the same fashion as is done when
-there is no filter function:
+the process mark to do insertion in the same fashion as the default filter:
@smallexample
@group
@defun accept-process-output &optional process seconds millisec just-this-one
This function allows Emacs to read pending output from processes. The
-output is inserted in the associated buffers or given to their filter
-functions. If @var{process} is non-@code{nil} then this function does
-not return until some output has been received from @var{process}.
+output is given to their filter functions. If @var{process} is
+non-@code{nil} then this function does not return until some output
+has been received from @var{process}.
The arguments @var{seconds} and @var{millisec} let you specify timeout
periods. The former specifies a period measured in seconds and the
@defun set-process-sentinel process sentinel
This function associates @var{sentinel} with @var{process}. If
-@var{sentinel} is @code{nil}, then the process will have no sentinel.
-The default behavior when there is no sentinel is to insert a message in
-the process's buffer when the process status changes.
+@var{sentinel} is @code{nil}, then the process will have the default
+sentinel, which inserts a message in the process's buffer when the
+process status changes.
Changes in process sentinels take effect immediately---if the sentinel
is slated to be run but has not been called yet, and you specify a new
@end defun
@defun process-sentinel process
-This function returns the sentinel of @var{process}, or @code{nil} if it
-has none.
+This function returns the sentinel of @var{process}.
@end defun
@defun waiting-for-user-input-p
The @var{buffer} argument is the buffer to associate with the
connection. Output from the connection is inserted in the buffer,
-unless you specify a filter function to handle the output. If
+unless you specify your own filter function to handle the output. If
@var{buffer} is @code{nil}, it means that the connection is not
associated with any buffer.
is unique for each connection in the Emacs session.
@item
-If the server's filter is non-@code{nil}, the connection process does
+If the server has a non-default filter, the connection process does
not get a separate process buffer; otherwise, Emacs creates a new
buffer for the purpose. The buffer name is the server's buffer name
or process name, concatenated with the client identification string.
@xref{Query Before Exit}.
@item :filter @var{filter}
-Initialize the process filter to @var{filter}.
+Initialize the process filter to @var{filter}. (Otherwise the default
+filter is used.)
@item :filter-multibyte @var{multibyte}
If @var{multibyte} is non-@code{nil}, strings given to the process
default value of @code{enable-multibyte-characters}.
@item :sentinel @var{sentinel}
-Initialize the process sentinel to @var{sentinel}.
+Initialize the process sentinel to @var{sentinel}. (Otherwise the default
+sentinel is used.)
@item :log @var{log}
Initialize the log function of a server process to @var{log}. The log
@code{stop-process}.
@item :filter @var{filter}
-Install @var{filter} as the process filter.
+Install @var{filter} as the process filter. (Otherwise the default
+filter is used.)
@item :sentinel @var{sentinel}
-Install @var{sentinel} as the process sentinel.
+Install @var{sentinel} as the process sentinel. (Otherwise the default
+sentinel is used.)
@item :plist @var{plist}
Install @var{plist} as the initial plist of the process.
+2014-02-21 Glenn Morris <rgm@gnu.org>
+
+ * flymake.texi (Starting the syntax check process): Grammar fix.
+
+ * tramp.texi (External packages): Grammar fix.
+ Reword for default sentinel not being nil any more.
+
2014-02-19 Michael Albinus <michael.albinus@gmx.de>
* trampver.texi: Update release number.
The command line (command name and the list of arguments) for launching a process is returned by the
initialization function. Flymake then just calls @code{start-process}
-to start an asynchronous process and configures process filter and
-sentinel which is used for processing the output of the syntax check
+to start an asynchronous process and configures a process filter and
+sentinel, which are used for processing the output of the syntax check
tool.
@node Parsing the output
it has seen so far.
This is a performance degradation, because the lost file attributes
-must be recomputed when needed again. In cases the caller of
+must be recomputed when needed again. In cases where the caller of
@code{process-file} knows that there are no file attribute changes, it
-shall let-bind the variable @code{process-file-side-effects} to
-@code{nil}. @value{tramp} wouldn't flush the file attributes cache then.
+should let-bind the variable @code{process-file-side-effects} to
+@code{nil}. Then @value{tramp} won't flush the file attributes cache.
@lisp
(let (process-file-side-effects)
For asynchronous processes, @value{tramp} flushes the file attributes
cache via a process sentinel. If the caller of
@code{start-file-process} knows that there are no file attribute
-changes, it shall set the process sentinel to @code{nil}. In case the
-caller defines an own process sentinel, @value{tramp}'s process
+changes, it should set the process sentinel to the default. In cases
+where the caller defines its own process sentinel, @value{tramp}'s process
sentinel is overwritten. The caller can still flush the file
attributes cache in its process sentinel with this code:
+2014-02-21 Glenn Morris <rgm@gnu.org>
+
+ * process.c (Fprocess_buffer, Faccept_process_output)
+ (Finternal_default_process_filter, Finternal_default_process_sentinel):
+ Doc fixes.
+
2014-02-21 Martin Rudalics <rudalics@gmx.at>
* window.c (Fwindow_scroll_bar_width): New function.
/* Asynchronous subprocess control for GNU Emacs.
-Copyright (C) 1985-1988, 1993-1996, 1998-1999, 2001-2014 Free Software
-Foundation, Inc.
+Copyright (C) 1985-1988, 1993-1996, 1998-1999, 2001-2014
+ Free Software Foundation, Inc.
This file is part of GNU Emacs.
DEFUN ("process-buffer", Fprocess_buffer, Sprocess_buffer,
1, 1, 0,
doc: /* Return the buffer PROCESS is associated with.
-Output from PROCESS is inserted in this buffer unless PROCESS has a filter. */)
+The default process filter inserts output from PROCESS into this buffer. */)
(register Lisp_Object process)
{
CHECK_PROCESS (process);
The filter gets two arguments: the process and the string of output.
The string argument is normally a multibyte string, except:
-- if the process' input coding system is no-conversion or raw-text,
+- if the process's input coding system is no-conversion or raw-text,
it is a unibyte string (the non-converted input), or else
- if `default-enable-multibyte-characters' is nil, it is a unibyte
string (the result of converting the decoded input multibyte
CHECK_PROCESS (process);
p = XPROCESS (process);
- /* Don't signal an error if the process' input file descriptor
+ /* Don't signal an error if the process's input file descriptor
is closed. This could make debugging Lisp more difficult,
for example when doing something like
is the server process, CLIENT is the new process for the connection,
and MESSAGE is a string.
-:plist PLIST -- Install PLIST as the new process' initial plist.
+:plist PLIST -- Install PLIST as the new process's initial plist.
:server QLEN -- if QLEN is non-nil, create a server process for the
specified FAMILY, SERVICE, and connection type (stream or datagram).
for the connection with the following parameters:
- The client's process name is constructed by concatenating the server
-process' NAME and a client identification string.
+process's NAME and a client identification string.
- If the FILTER argument is non-nil, the client process will not get a
separate process buffer; otherwise, the client's process buffer is a newly
-created buffer named after the server process' BUFFER name or process
+created buffer named after the server process's BUFFER name or process
NAME concatenated with the client identification string.
- The connection type and the process filter and sentinel parameters are
-inherited from the server process' TYPE, FILTER and SENTINEL.
-- The client process' contact info is set according to the client's
+inherited from the server process's TYPE, FILTER and SENTINEL.
+- The client process's contact info is set according to the client's
addressing information (typically an IP address and a port number).
-- The client process' plist is initialized from the server's plist.
+- The client process's plist is initialized from the server's plist.
Notice that the FILTER and SENTINEL args are never used directly by
the server process. Also, the BUFFER argument is not used directly by
the server process, but via the optional :log function, accepted (and
-failed) connections may be logged in the server process' buffer.
+failed) connections may be logged in the server process's buffer.
The original argument list, modified with the actual connection
information, is available via the `process-contact' function.
DEFUN ("accept-process-output", Faccept_process_output, Saccept_process_output,
0, 4, 0,
doc: /* Allow any pending output from subprocesses to be read by Emacs.
-It is read into the process' buffers or given to their filter functions.
+It is given to their filter functions.
Non-nil arg PROCESS means do not return until some output has been received
from PROCESS.
DEFUN ("internal-default-process-filter", Finternal_default_process_filter,
Sinternal_default_process_filter, 2, 2, 0,
- doc: /* Function used as default process filter. */)
+ doc: /* Function used as default process filter.
+This inserts the process's output into its buffer. */)
(Lisp_Object proc, Lisp_Object text)
{
struct Lisp_Process *p;
DEFUN ("internal-default-process-sentinel", Finternal_default_process_sentinel,
Sinternal_default_process_sentinel, 2, 2, 0,
- doc: /* Function used as default sentinel for processes. */)
+ doc: /* Function used as default sentinel for processes.
+This inserts a status message into the process's buffer. */)
(Lisp_Object proc, Lisp_Object msg)
{
Lisp_Object buffer, symbol;