From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#22679: 25.0.91; ibuffer-do-shell-command-pipe truncate output Date: Thu, 25 Aug 2016 18:39:30 +0900 (JST) Message-ID: References: <7oa66k9es.fsf@fencepost.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Trace: blaine.gmane.org 1472118023 25470 195.159.176.226 (25 Aug 2016 09:40:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 25 Aug 2016 09:40:23 +0000 (UTC) User-Agent: Alpine 2.20 (DEB 67 2015-01-07) Cc: Tino Calancha , 22679@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 25 11:40:18 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bcr8z-0005zQ-Ff for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Aug 2016 11:40:17 +0200 Original-Received: from localhost ([::1]:55287 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcr90-00018S-1C for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Aug 2016 05:40:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54281) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcr8n-000170-Lf for bug-gnu-emacs@gnu.org; Thu, 25 Aug 2016 05:40:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bcr8k-00065F-Gi for bug-gnu-emacs@gnu.org; Thu, 25 Aug 2016 05:40:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42296) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcr8k-00065B-D5 for bug-gnu-emacs@gnu.org; Thu, 25 Aug 2016 05:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bcr8k-0007LY-0D for bug-gnu-emacs@gnu.org; Thu, 25 Aug 2016 05:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Aug 2016 09:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22679 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 22679-submit@debbugs.gnu.org id=B22679.147211798228201 (code B ref 22679); Thu, 25 Aug 2016 09:40:01 +0000 Original-Received: (at 22679) by debbugs.gnu.org; 25 Aug 2016 09:39:42 +0000 Original-Received: from localhost ([127.0.0.1]:40008 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bcr8Q-0007Km-IR for submit@debbugs.gnu.org; Thu, 25 Aug 2016 05:39:42 -0400 Original-Received: from mail-pf0-f193.google.com ([209.85.192.193]:34244) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bcr8O-0007KZ-Ol for 22679@debbugs.gnu.org; Thu, 25 Aug 2016 05:39:41 -0400 Original-Received: by mail-pf0-f193.google.com with SMTP id g202so2930138pfb.1 for <22679@debbugs.gnu.org>; Thu, 25 Aug 2016 02:39:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=+hMONxGXL/4xeppUMnhmH+nwDoxhP7yCsM6ouz+JFTw=; b=dwyi+iajeWUicB1Wll/Nlf5r3qFkAzZxqzCJaoxSE80Eg+WInm6Hw6PBwjUv4IKIZt bKJAM5XhjlwvBU7FpB+gUWJsvKJyTSEyd9vlubXxeWu74XrGLWduNlsX3MomcHj7O2ru +P1W8gpP76FYlnRVFPLDZQJpOobV79z8SkEQC8F8HgWskAZ1Epe1URVmfaip5/6k7z4h YNh8BVp6ievRHPIF5FCxYkVXvA25iFkSpcv8zHELvmIFGTBcwDEPXBnS0DP8a199i2F9 ckoxF0j/gcX4QVKdP4b1e25kdcJETPzvFfPK4jQgPWjyJDgoHsWEAUt1XsxQOLm38qaz MF3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=+hMONxGXL/4xeppUMnhmH+nwDoxhP7yCsM6ouz+JFTw=; b=H6hjmgbZ7OrJBPRc5ktAhzlc6cgi13O1nVe0Oupfbes4zLaq4DPi/W3xKB8+pwbeRF gXkBuh9f0JFr3SBjQ2xYu/JM7Gf8hR9MMjP6Jvaar8icovvEQwUiy58yP37UrZpEtnbo H0WP8Nu6Q9lktYy86zZIpW8rMLLVraPPwV17douoUG/3zMFP2b/0whffZXPj5glt1imr 9MTrYNkRm5K738qZt088iHxIRUxHZoPC+xPiKFb1O1+9nTadDW/RToCRYpFQt58IbmOO CUqQeaGuq/8oVtkLdgfQLFJJPaVvV3ApcKPhWCXMI1GZDZLBc4bSAPmoZafei+TaG0wb TyxQ== X-Gm-Message-State: AE9vXwO2OZ23BPWE7LpNO8San702ugjluKLh05DFwC2GhkOIYf8VbuZJk9egimo/onwI9g== X-Received: by 10.98.68.148 with SMTP id m20mr14488566pfi.0.1472117974862; Thu, 25 Aug 2016 02:39:34 -0700 (PDT) Original-Received: from calancha-pc ([103.5.140.139]) by smtp.gmail.com with ESMTPSA id cp11sm19485618pac.28.2016.08.25.02.39.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Aug 2016 02:39:34 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:122639 Archived-At: > 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 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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;