From: Tino Calancha <f92capac@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Tino Calancha <f92capac@gmail.com>, 22679@debbugs.gnu.org
Subject: bug#22679: 25.0.91; ibuffer-do-shell-command-pipe truncate output
Date: Thu, 25 Aug 2016 18:39:30 +0900 (JST) [thread overview]
Message-ID: <alpine.DEB.2.20.1608251837560.13338@calancha-pc> (raw)
In-Reply-To: <jwv4m6ahzjh.fsf-monnier+emacsbugs@gnu.org>
> 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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
next prev parent reply other threads:[~2016-08-25 9:39 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-15 13:21 bug#22679: 25.0.91; ibuffer-do-shell-command-pipe truncate output Tino Calancha
2016-06-10 5:02 ` Glenn Morris
[not found] ` <CAMn5WmYDL0CrDppLc_Vs+EM5CkA_wfdb1z+QCmNj_=v6PiYM-g@mail.gmail.com>
2016-06-10 9:08 ` Tino Calancha
2016-07-05 15:58 ` Glenn Morris
2016-07-05 16:27 ` Tino Calancha
2016-07-09 17:28 ` Glenn Morris
2016-07-13 15:27 ` Stefan Monnier
2016-08-19 8:33 ` Tino Calancha
2016-08-19 13:52 ` Stefan Monnier
2016-08-20 3:28 ` Tino Calancha
2016-08-20 10:28 ` Tino Calancha
2016-08-20 12:46 ` Stefan Monnier
2016-08-21 14:37 ` Tino Calancha
2016-08-22 16:06 ` Stefan Monnier
2016-08-23 15:08 ` Tino Calancha
2016-08-24 17:05 ` Stefan Monnier
2016-08-25 9:39 ` Tino Calancha [this message]
2016-08-25 12:36 ` Stefan Monnier
2016-08-25 13:26 ` Tino Calancha
2017-01-27 6:26 ` Tino Calancha
2017-02-03 4:25 ` Tino Calancha
2017-02-09 9:24 ` Tino Calancha
2016-06-11 3:48 ` C. Calancha
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.20.1608251837560.13338@calancha-pc \
--to=f92capac@gmail.com \
--cc=22679@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).