(eshell-needs-pipe): New variable.
(eshell-needs-pipe-p): New function. (eshell-gather-process-output): Set process-connection-type according to eshell-needs-pipe-p. (Bug#1388)
This commit is contained in:
parent
64ba814f12
commit
1e262c4566
2 changed files with 34 additions and 5 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2008-11-30 Glenn Morris <rgm@gnu.org>
|
||||||
|
|
||||||
|
* eshell/esh-proc.el (eshell-needs-pipe): New variable.
|
||||||
|
(eshell-needs-pipe-p): New function.
|
||||||
|
(eshell-gather-process-output): Set process-connection-type according to
|
||||||
|
eshell-needs-pipe-p. (Bug#1388)
|
||||||
|
|
||||||
2008-11-30 Juanma Barranquero <lekktu@gmail.com>
|
2008-11-30 Juanma Barranquero <lekktu@gmail.com>
|
||||||
|
|
||||||
* calendar/diary-lib.el (diary-cyclic): Doc fix.
|
* calendar/diary-lib.el (diary-cyclic): Doc fix.
|
||||||
|
|
|
@ -236,6 +236,26 @@ The prompt will be set to PROMPT."
|
||||||
"A marker that tracks the beginning of output of the last subprocess.
|
"A marker that tracks the beginning of output of the last subprocess.
|
||||||
Used only on systems which do not support async subprocesses.")
|
Used only on systems which do not support async subprocesses.")
|
||||||
|
|
||||||
|
(defvar eshell-needs-pipe '("bc")
|
||||||
|
"List of commands which need `process-connection-type' to be nil.
|
||||||
|
Currently only affects commands in pipelines, and not those at
|
||||||
|
the front. If an element contains a directory part it must match
|
||||||
|
the full name of a command, otherwise just the nondirectory part must match.")
|
||||||
|
|
||||||
|
(defun eshell-needs-pipe-p (command)
|
||||||
|
"Return non-nil if COMMAND needs `process-connection-type' to be nil.
|
||||||
|
See `eshell-needs-pipe'."
|
||||||
|
(and eshell-in-pipeline-p
|
||||||
|
(not (eq eshell-in-pipeline-p 'first))
|
||||||
|
;; FIXME should this return non-nil for anything that is
|
||||||
|
;; neither 'first nor 'last? See bug#1388 discussion.
|
||||||
|
(catch 'found
|
||||||
|
(dolist (exe eshell-needs-pipe)
|
||||||
|
(if (string-equal exe (if (string-match "/" exe)
|
||||||
|
command
|
||||||
|
(file-name-nondirectory command)))
|
||||||
|
(throw 'found t))))))
|
||||||
|
|
||||||
(defun eshell-gather-process-output (command args)
|
(defun eshell-gather-process-output (command args)
|
||||||
"Gather the output from COMMAND + ARGS."
|
"Gather the output from COMMAND + ARGS."
|
||||||
(unless (and (file-executable-p command)
|
(unless (and (file-executable-p command)
|
||||||
|
@ -250,11 +270,13 @@ Used only on systems which do not support async subprocesses.")
|
||||||
(cond
|
(cond
|
||||||
((fboundp 'start-process)
|
((fboundp 'start-process)
|
||||||
(setq proc
|
(setq proc
|
||||||
|
(let ((process-connection-type
|
||||||
|
(unless (eshell-needs-pipe-p command)
|
||||||
|
process-connection-type)))
|
||||||
(apply 'start-process
|
(apply 'start-process
|
||||||
(file-name-nondirectory command) nil
|
(file-name-nondirectory command) nil
|
||||||
;; `start-process' can't deal with relative
|
;; `start-process' can't deal with relative filenames.
|
||||||
;; filenames
|
(append (list (expand-file-name command)) args))))
|
||||||
(append (list (expand-file-name command)) args)))
|
|
||||||
(eshell-record-process-object proc)
|
(eshell-record-process-object proc)
|
||||||
(set-process-buffer proc (current-buffer))
|
(set-process-buffer proc (current-buffer))
|
||||||
(if (eshell-interactive-output-p)
|
(if (eshell-interactive-output-p)
|
||||||
|
|
Loading…
Add table
Reference in a new issue