Subject: bug#79442: RFE: process-lines equivalent for NUL-separated output

From: Tim Landscheidt <[email-masked]>
Date: Sat, 13 Sep 2025 12:00:37 +0000

Eli Zaretskii <[email-masked]> wrote:

>> The function process-lines executes a program and returns
>> the lines of its output as a list.  However using newlines
>> as output separators is prone to errors, and therefore many
>> programs support using NUL (?\C-@) to separate their output.

>> Currently, with Emacs one needs to use constructs like:

>> | (split-string
>> |  (shell-command-to-string
>> |   (concat "foo "
>> |           (shell-quote-argument "bar baz")))
>> |  "\0"
>> |  t)

>> It would be nice if Emacs shipped a function so that the
>> above could be rewritten as:

>> | (process-output "foo" "bar baz")

> So you want process-lines to call split-string for you (given some
> optional argument)?

I'm not sure whether it is possible to add an optional
argument to process-lines as it passes the remaining
arguments to the executed program.  How would such a call
look like?