emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp ChangeLog eshell/esh-proc.el


From: Glenn Morris
Subject: [Emacs-diffs] emacs/lisp ChangeLog eshell/esh-proc.el
Date: Sun, 30 Nov 2008 01:28:05 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       08/11/30 01:28:04

Modified files:
        lisp           : ChangeLog 
        lisp/eshell    : esh-proc.el 

Log message:
        (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)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.14887&r2=1.14888
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/eshell/esh-proc.el?cvsroot=emacs&r1=1.23&r2=1.24

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.14887
retrieving revision 1.14888
diff -u -b -r1.14887 -r1.14888
--- ChangeLog   30 Nov 2008 01:01:18 -0000      1.14887
+++ ChangeLog   30 Nov 2008 01:28:01 -0000      1.14888
@@ -1,3 +1,10 @@
+2008-11-30  Glenn Morris  <address@hidden>
+
+       * 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  <address@hidden>
 
        * calendar/diary-lib.el (diary-cyclic): Doc fix.

Index: eshell/esh-proc.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/eshell/esh-proc.el,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- eshell/esh-proc.el  25 Nov 2008 04:25:46 -0000      1.23
+++ eshell/esh-proc.el  30 Nov 2008 01:28:04 -0000      1.24
@@ -236,6 +236,26 @@
   "A marker that tracks the beginning of output of the last subprocess.
 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)
   "Gather the output from COMMAND + ARGS."
   (unless (and (file-executable-p command)
@@ -250,11 +270,13 @@
     (cond
      ((fboundp 'start-process)
       (setq proc
+           (let ((process-connection-type
+                  (unless (eshell-needs-pipe-p command)
+                    process-connection-type)))
            (apply 'start-process
                   (file-name-nondirectory command) nil
-                  ;; `start-process' can't deal with relative
-                  ;; filenames
-                  (append (list (expand-file-name command)) args)))
+                    ;; `start-process' can't deal with relative filenames.
+                    (append (list (expand-file-name command)) args))))
       (eshell-record-process-object proc)
       (set-process-buffer proc (current-buffer))
       (if (eshell-interactive-output-p)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]