aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSpencer Baugh2025-10-07 14:41:20 -0400
committerEli Zaretskii2025-10-11 12:14:10 +0300
commit443af6fe1d0161142af0bc4578efd0653c3f1be9 (patch)
tree669784d5985d653295668797a14a99e0aa09a002 /src
parentdc2650faa9c185b74e958dbda0665be6a2050923 (diff)
downloademacs-443af6fe1d0161142af0bc4578efd0653c3f1be9.tar.gz
emacs-443af6fe1d0161142af0bc4578efd0653c3f1be9.zip
Allow creating a pipe process without a buffer
Previously, even passing :buffer nil to make-pipe-process would create a buffer. Now, if you explicitly call (make-pipe-process :buffer nil), it will create a pipe process without a buffer, just like all the other process creation functions. * src/process.c (Fmake_pipe_process): Check for explicit :buffer nil and don't make a buffer. (bug#79596) * doc/lispref/processes.texi (Asynchronous Processes): Update. * test/src/process-tests.el (process-test-make-pipe-process-no-buffer): Add test.
Diffstat (limited to 'src')
-rw-r--r--src/process.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/process.c b/src/process.c
index 8ec420aaa2c..82b8829ba8c 100644
--- a/src/process.c
+++ b/src/process.c
@@ -2414,7 +2414,8 @@ arguments are defined:
2414:buffer BUFFER -- BUFFER is the buffer (or buffer-name) to associate 2414:buffer BUFFER -- BUFFER is the buffer (or buffer-name) to associate
2415with the process. Process output goes at the end of that buffer, 2415with the process. Process output goes at the end of that buffer,
2416unless you specify a filter function to handle the output. If BUFFER 2416unless you specify a filter function to handle the output. If BUFFER
2417is not given, the value of NAME is used. 2417is not given, the value of NAME is used. BUFFER may be also nil, meaning
2418that this process is not associated with any buffer.
2418 2419
2419:coding CODING -- If CODING is a symbol, it specifies the coding 2420:coding CODING -- If CODING is a symbol, it specifies the coding
2420system used for both reading and writing for this process. If CODING 2421system used for both reading and writing for this process. If CODING
@@ -2479,10 +2480,15 @@ usage: (make-pipe-process &rest ARGS) */)
2479 if (inchannel > max_desc) 2480 if (inchannel > max_desc)
2480 max_desc = inchannel; 2481 max_desc = inchannel;
2481 2482
2482 buffer = plist_get (contact, QCbuffer); 2483 {
2483 if (NILP (buffer)) 2484 Lisp_Object buffer_member = plist_member (contact, QCbuffer);
2484 buffer = name; 2485 if (NILP (buffer_member))
2485 buffer = Fget_buffer_create (buffer, Qnil); 2486 buffer = name;
2487 else
2488 buffer = XCAR (XCDR (buffer_member));
2489 }
2490 if (!NILP (buffer))
2491 buffer = Fget_buffer_create (buffer, Qnil);
2486 pset_buffer (p, buffer); 2492 pset_buffer (p, buffer);
2487 2493
2488 pset_childp (p, contact); 2494 pset_childp (p, contact);