From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#35055: 27.0.50; async-shell-command truncates output lines Date: Thu, 02 May 2019 23:57:40 +0300 Organization: LINKOV.NET Message-ID: <87pnp0y7wv.fsf@mail.linkov.net> References: <87tvfkuivn.fsf@mail.linkov.net> <87r2ah32rr.fsf@mail.linkov.net> <878swopr3p.fsf@gmx.de> <87y34mc13t.fsf@mail.linkov.net> <874l7ajmnx.fsf@gmx.de> <87lg0l1syw.fsf@mail.linkov.net> <87v9zpgd3t.fsf@gmx.de> <87mul0tfe5.fsf@mail.linkov.net> <87v9zib2vd.fsf@gmx.de> <877ebxa857.fsf@mail.linkov.net> <87a7gszd2q.fsf@gmx.de> <87sgukxu27.fsf@mail.linkov.net> <875zrfzp4m.fsf@gmx.de> <87mukpznua.fsf@mail.linkov.net> <8736mhp047.fsf@gmx.de> <875zrcqtje.fsf@mail.linkov.net> <877ebroj5g.fsf@gmx.de> <8736mfjatu.fsf@mail.linkov.net> <87lfzrw5us.fsf@gmx.de> <87y33phoja.fsf@mail.linkov.net> <878svpdyag.fsf@gmx.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="88148"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 35055@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 02 22:59:15 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMInQ-000MhQ-Fs for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 May 2019 22:59:13 +0200 Original-Received: from localhost ([127.0.0.1]:58482 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMInP-0002qT-FB for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 May 2019 16:59:11 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:58578) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMInI-0002pw-A5 for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 16:59:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMInH-0005UY-0o for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 16:59:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33589) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hMInG-0005U2-AN for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 16:59:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hMInG-0008Mj-7E for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 16:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 May 2019 20:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35055 X-GNU-PR-Package: emacs Original-Received: via spool by 35055-submit@debbugs.gnu.org id=B35055.155683071032120 (code B ref 35055); Thu, 02 May 2019 20:59:02 +0000 Original-Received: (at 35055) by debbugs.gnu.org; 2 May 2019 20:58:30 +0000 Original-Received: from localhost ([127.0.0.1]:47133 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hMImj-0008M0-Mm for submit@debbugs.gnu.org; Thu, 02 May 2019 16:58:30 -0400 Original-Received: from firebrick.maple.relay.mailchannels.net ([23.83.214.59]:36252) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hMImh-0008Ln-6b for 35055@debbugs.gnu.org; Thu, 02 May 2019 16:58:28 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id ADFAA141EBB; Thu, 2 May 2019 20:58:25 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a69.g.dreamhost.com (100-96-79-6.trex.outbound.svc.cluster.local [100.96.79.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id DFDC81426B7; Thu, 2 May 2019 20:58:24 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a69.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Thu, 02 May 2019 20:58:25 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Thoughtful-Language: 1edd16154ace960b_1556830705435_3324592041 X-MC-Loop-Signature: 1556830705435:2904532241 X-MC-Ingress-Time: 1556830705435 Original-Received: from pdx1-sub0-mail-a69.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a69.g.dreamhost.com (Postfix) with ESMTP id 75B118057A; Thu, 2 May 2019 13:58:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=4U6cqo0L45Ae5qcGVxHgTXgCyu0=; b= G43m4ggB0lfW3309DqS7MM2lppfyhHZUbAiCjayQheG7U7tZs1b64r38yh2FkHZ1 inNC0k6umwKMVmItHtkWGZBezDxN1g6bDl47Ry6+pQYrieVhenCBPiUcUh54lQxK KHzvR8I2wYn/kcX9NQHSIkBP3sz5UpLbt7+PsHNwvLU= Original-Received: from mail.jurta.org (m91-129-107-198.cust.tele2.ee [91.129.107.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a69.g.dreamhost.com (Postfix) with ESMTPSA id 68CEF80584; Thu, 2 May 2019 13:58:16 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a69 In-Reply-To: <878svpdyag.fsf@gmx.de> (Michael Albinus's message of "Thu, 02 May 2019 11:02:31 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrieelgdduheekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesmhdtreertdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdejrdduleeknecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtjedrudelkedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehmihgthhgrvghlrdgrlhgsihhnuhhssehgmhigrdguvgenucevlhhushhtvghrufhiiigvpedt 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: 209.51.188.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:158664 Archived-At: --=-=-= Content-Type: text/plain >> Do you agree with this change? > > Yes, with the minor remarks: > >> + The option @code{async-shell-command-width} defines the number of display >> +columns available for output of asynchronous or remote shell commands. > > Do not mention remote. > >> +*** 'async-shell-command-width' defines the number of display columns >> available for output of asynchronous or remote shell commands. > > dito. > >> +(defcustom async-shell-command-width nil >> + "Number of display columns available for asynchronous/remote shell command. > > dito. > >> + ;; Test `async-shell-command-width' of `async-shell-command'. > > `async-shell-command' shouldn't be mentioned anymore, it's obvious. I hope now it's right: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=async-shell-command-width.2.patch diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 7d7065a441..5f74392736 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -775,6 +775,13 @@ Single Shell displayed only when the command generates output, set @code{async-shell-command-display-buffer} to @code{nil}. +@vindex async-shell-command-width + The option @code{async-shell-command-width} defines the number of display +columns available for output of asynchronous shell commands. +A positive integer tells the shell to use that number of columns for +command output. The default value is @code{nil} that means to use +the same number of columns as provided by the shell. + @kindex M-| @findex shell-command-on-region @kbd{M-|} (@code{shell-command-on-region}) is like @kbd{M-!}, but diff --git a/etc/NEWS b/etc/NEWS index 9e3559d27e..5e948452d8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1103,8 +1103,8 @@ variable for remote shells. It still defaults to "/bin/sh". ** Single shell commands --- -*** 'shell-command-width' defines the number of display columns -available for output of asynchronous or remote shell commands. +*** 'async-shell-command-width' defines the number of display columns +available for output of asynchronous shell commands. ** Pcomplete diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 2e1a0960d7..c0446b79a7 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3639,10 +3639,10 @@ tramp-handle-shell-command (if (and (not current-buffer-p) (integerp asynchronous)) (let ((tramp-remote-process-environment - ;; `shell-command-width' has been introduced with Emacs 27.1. - (if (natnump (bound-and-true-p shell-command-width)) + ;; `async-shell-command-width' has been introduced with Emacs 27.1. + (if (natnump (bound-and-true-p async-shell-command-width)) (cons (format "COLUMNS=%d" - (bound-and-true-p shell-command-width)) + (bound-and-true-p async-shell-command-width)) tramp-remote-process-environment) tramp-remote-process-environment))) (prog1 diff --git a/lisp/simple.el b/lisp/simple.el index acea1f9ddc..4454791ad2 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3353,7 +3353,7 @@ async-shell-command-display-buffer :group 'shell :version "26.1") -(defcustom shell-command-width nil +(defcustom async-shell-command-width nil "Number of display columns available for asynchronous shell command output. If nil, use the shell default number (usually 80 columns). If a positive integer, tell the shell to use that number of columns for @@ -3627,8 +3627,8 @@ shell-command (shell-command--save-pos-or-erase) (setq default-directory directory) (let ((process-environment - (if (natnump shell-command-width) - (cons (format "COLUMNS=%d" shell-command-width) + (if (natnump async-shell-command-width) + (cons (format "COLUMNS=%d" async-shell-command-width) process-environment) process-environment))) (setq proc diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index cba697da18..7d3c43408d 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -4192,18 +4192,17 @@ tramp--test-shell-command-to-string-asynchronously ;; Cleanup. (ignore-errors (delete-file tmp-name))) - ;; Test `shell-command-width' of `async-shell-command'. - ;; Since Emacs 27.1. - (when (and (boundp 'shell-command-width) + ;; Test `async-shell-command-width'. Since Emacs 27.1. + (when (and (boundp 'async-shell-command-width) (zerop (call-process "tput" nil nil nil "cols")) (zerop (process-file "tput" nil nil nil "cols"))) - (let (shell-command-width) + (let (async-shell-command-width) (should (string-equal (format "%s\n" (car (process-lines "tput" "cols"))) (tramp--test-shell-command-to-string-asynchronously "tput cols"))) - (setq shell-command-width 1024) + (setq async-shell-command-width 1024) (should (string-equal "1024\n" --=-=-=--