diff options
| author | Jim Porter | 2023-03-30 17:39:24 -0700 |
|---|---|---|
| committer | Jim Porter | 2023-03-31 13:07:36 -0700 |
| commit | 6419d78fa6f8a7794893da5a8a5d65f75a5a29fa (patch) | |
| tree | 517f0137a0d8f444f27dea31dd793a9a711bd23c /lisp/eshell | |
| parent | 3bdbb66efb9895b8ed55270075fa7d8329f8d36b (diff) | |
| download | emacs-6419d78fa6f8a7794893da5a8a5d65f75a5a29fa.tar.gz emacs-6419d78fa6f8a7794893da5a8a5d65f75a5a29fa.zip | |
Fix using background commands in 'eshell-command'
Do not merge to master.
This regressed due to the patch for bug#53715, which changed how
Eshell pipelines return the processes in the pipeline (bug#62556).
* lisp/eshell/esh-cmd.el (eshell-eval-command): Allow process-pairs.
* test/lisp/eshell/eshell-tests.el (eshell-test/eshell-command/simple)
(eshell-test/eshell-command/pipeline)
(eshell-test/eshell-command/background)
(eshell-test/eshell-command/background-pipeline): New tests.
Diffstat (limited to 'lisp/eshell')
| -rw-r--r-- | lisp/eshell/esh-cmd.el | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el index f4ac384ccc5..706477a5f45 100644 --- a/lisp/eshell/esh-cmd.el +++ b/lisp/eshell/esh-cmd.el | |||
| @@ -1032,18 +1032,20 @@ produced by `eshell-parse-command'." | |||
| 1032 | (setq eshell-current-command command) | 1032 | (setq eshell-current-command command) |
| 1033 | (let* ((delim (catch 'eshell-incomplete | 1033 | (let* ((delim (catch 'eshell-incomplete |
| 1034 | (eshell-resume-eval))) | 1034 | (eshell-resume-eval))) |
| 1035 | (val (car-safe delim))) | 1035 | (val (car-safe delim)) |
| 1036 | (val-is-process (or (eshell-processp val) | ||
| 1037 | (eshell-process-pair-p val)))) | ||
| 1036 | ;; If the return value of `eshell-resume-eval' is wrapped in a | 1038 | ;; If the return value of `eshell-resume-eval' is wrapped in a |
| 1037 | ;; list, it indicates that the command was run asynchronously. | 1039 | ;; list, it indicates that the command was run asynchronously. |
| 1038 | ;; In that case, unwrap the value before checking the delimiter | 1040 | ;; In that case, unwrap the value before checking the delimiter |
| 1039 | ;; value. | 1041 | ;; value. |
| 1040 | (if (and val | 1042 | (if (and val |
| 1041 | (not (eshell-processp val)) | 1043 | (not val-is-process) |
| 1042 | (not (eq val t))) | 1044 | (not (eq val t))) |
| 1043 | (error "Unmatched delimiter: %S" val) | 1045 | (error "Unmatched delimiter: %S" val) |
| 1044 | ;; Eshell-command expect a list like (<process>) to know if the | 1046 | ;; Eshell-command expect a list like (<process>) to know if the |
| 1045 | ;; command should be async or not. | 1047 | ;; command should be async or not. |
| 1046 | (or (and (eshell-processp val) delim) val))))) | 1048 | (or (and val-is-process delim) val))))) |
| 1047 | 1049 | ||
| 1048 | (defun eshell-resume-command (proc status) | 1050 | (defun eshell-resume-command (proc status) |
| 1049 | "Resume the current command when a process ends." | 1051 | "Resume the current command when a process ends." |