bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#22679: 25.0.91; ibuffer-do-shell-command-pipe truncate output


From: Tino Calancha
Subject: bug#22679: 25.0.91; ibuffer-do-shell-command-pipe truncate output
Date: Thu, 25 Aug 2016 18:39:30 +0900 (JST)
User-agent: Alpine 2.20 (DEB 67 2015-01-07)



Indentation looks wrong, but other than that, looks OK.  Thanks.
Do you thing we should support PROGRAM being nil?
For instance in,
* lisp/emacs-lisp/chart.el (chart-space-usage)
it first inserts a command in the buffer, and then calls
`call-process-region' with 6 arguments.
My previous implementation cannot handle that, i.e., fails if
PROGRAM is nil.  In fact, that task maybe fit better with `call-process'/
`call-process-shell-command': i would just not write the command
in the buffer, and pass it as argument to `call-process'.
Following patch handle COMMAND being nil.  What implementation do
you prefer?

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

From c572c4a4e625648016dea192c3234dfc2128ce46 Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha@gmail.com>
Date: Thu, 25 Aug 2016 18:27:42 +0900
Subject: [PATCH] * lisp/subr.el (call-shell-region): Handle COMMAND being nil

---
 lisp/subr.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lisp/subr.el b/lisp/subr.el
index 96917b9..7b7f204 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -3097,9 +3097,12 @@ call-shell-region
 Otherwise it waits for COMMAND to terminate
 and returns a numeric exit status or a signal description string.
If you quit, the process is killed with SIGINT, or SIGKILL if you quit again."
-  (call-process-region start end
-                       shell-file-name delete buffer nil
-                       shell-command-switch command))
+  (apply #'call-process-region
+         (append (list start end
+                       shell-file-name delete buffer nil)
+                 (if command
+                     (list shell-command-switch command)
+                   '()))))

 ;;;; Lisp macros to do various things temporarily.

--
2.9.3

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;






reply via email to

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