Function: internal-default-process-filter
internal-default-process-filter is a function defined in process.c.
Signature
(internal-default-process-filter PROC TEXT)
Documentation
Function used as default process filter.
This inserts the process's output into its buffer, if there is one. Otherwise it discards the output.
Probably introduced at or before Emacs version 30.1.
Source Code
// Defined in /usr/src/emacs/src/process.c
{
struct Lisp_Process *p;
CHECK_PROCESS (proc);
p = XPROCESS (proc);
CHECK_STRING (text);
if (!NILP (p->buffer) && BUFFER_LIVE_P (XBUFFER (p->buffer)))
{
Lisp_Object old_read_only;
ptrdiff_t old_begv, old_zv;
ptrdiff_t before, before_byte;
ptrdiff_t opoint, opoint_byte;
read_process_output_before_insert (p, &old_read_only, &old_begv, &old_zv,
&before, &before_byte, &opoint, &opoint_byte);
/* Adjust the multibyteness of TEXT to that of the buffer. */
if (NILP (BVAR (current_buffer, enable_multibyte_characters))
!= ! STRING_MULTIBYTE (text))
text = (STRING_MULTIBYTE (text)
? Fstring_as_unibyte (text)
: Fstring_to_multibyte (text));
/* Insert before markers in case we are inserting where
the buffer's mark is, and the user's next command is Meta-y. */
insert_from_string_before_markers (text, 0, 0,
SCHARS (text), SBYTES (text), 0);
read_process_output_after_insert (p, &old_read_only, old_begv, old_zv,
before, before_byte, opoint, opoint_byte);
}
return Qnil;
}