diff options
| author | Noam Postavsky | 2019-07-24 20:33:18 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2019-07-25 18:36:03 -0400 |
| commit | b3e20737d83acbbbec372645e2a951293d84bd29 (patch) | |
| tree | 4db4e10154ddaf0e736275485f5ca9c5b5dfa1bd /src | |
| parent | f67195028467e26348cab3a6cdc97034cd93f897 (diff) | |
| download | emacs-b3e20737d83acbbbec372645e2a951293d84bd29.tar.gz emacs-b3e20737d83acbbbec372645e2a951293d84bd29.zip | |
Fix subproc listening when setting filter to non-t (Bug#36591)
* src/process.c (Fset_process_filter): Call add_process_read_fd
according to the state of process filter before it's updated. This
restores the correct functioning as it was before 2016-02-16 "Allow
setting the filter masks later". Inline the set_process_filter_masks
call instead of fixing it that function, because it is also called
from connect_network_socket, and we don't want to change the behavior
of that function so close to release.
* test/src/process-tests.el (set-process-filter-t): New test.
Diffstat (limited to 'src')
| -rw-r--r-- | src/process.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/process.c b/src/process.c index 2df51cfd996..b602507765e 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -1268,10 +1268,19 @@ The string argument is normally a multibyte string, except: | |||
| 1268 | if (NILP (filter)) | 1268 | if (NILP (filter)) |
| 1269 | filter = Qinternal_default_process_filter; | 1269 | filter = Qinternal_default_process_filter; |
| 1270 | 1270 | ||
| 1271 | pset_filter (p, filter); | ||
| 1272 | |||
| 1273 | if (p->infd >= 0) | 1271 | if (p->infd >= 0) |
| 1274 | set_process_filter_masks (p); | 1272 | { |
| 1273 | /* If filter WILL be t, stop reading output. */ | ||
| 1274 | if (EQ (filter, Qt) && !EQ (p->status, Qlisten)) | ||
| 1275 | delete_read_fd (p->infd); | ||
| 1276 | else if (/* If filter WAS t, then resume reading output. */ | ||
| 1277 | EQ (p->filter, Qt) | ||
| 1278 | /* Network or serial process not stopped: */ | ||
| 1279 | && !EQ (p->command, Qt)) | ||
| 1280 | add_process_read_fd (p->infd); | ||
| 1281 | } | ||
| 1282 | |||
| 1283 | pset_filter (p, filter); | ||
| 1275 | 1284 | ||
| 1276 | if (NETCONN1_P (p) || SERIALCONN1_P (p) || PIPECONN1_P (p)) | 1285 | if (NETCONN1_P (p) || SERIALCONN1_P (p) || PIPECONN1_P (p)) |
| 1277 | pset_childp (p, Fplist_put (p->childp, QCfilter, filter)); | 1286 | pset_childp (p, Fplist_put (p->childp, QCfilter, filter)); |