From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#35055: 27.0.50; async-shell-command truncates output lines Date: Sat, 13 Apr 2019 12:45:10 +0200 Message-ID: <87v9zib2vd.fsf@gmx.de> References: <87tvfkuivn.fsf@mail.linkov.net> <875zrym4eo.fsf@gmx.de> <877ecd797c.fsf@mail.linkov.net> <87y34s21vp.fsf@gmx.de> <87zhp6vmu5.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> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="164315"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 35055@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 13 12:46:18 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 1hFGAr-000gXf-GD for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Apr 2019 12:46:17 +0200 Original-Received: from localhost ([127.0.0.1]:49620 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFGAj-00084X-Mf for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Apr 2019 06:46:09 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:60281) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFGAd-0007zw-FX for bug-gnu-emacs@gnu.org; Sat, 13 Apr 2019 06:46:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hFGAc-0007gA-ER for bug-gnu-emacs@gnu.org; Sat, 13 Apr 2019 06:46:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44620) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hFGAb-0007fz-Q6 for bug-gnu-emacs@gnu.org; Sat, 13 Apr 2019 06:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hFGAb-0001Zl-Ng for bug-gnu-emacs@gnu.org; Sat, 13 Apr 2019 06:46:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Apr 2019 10:46:01 +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.15551523235995 (code B ref 35055); Sat, 13 Apr 2019 10:46:01 +0000 Original-Received: (at 35055) by debbugs.gnu.org; 13 Apr 2019 10:45:23 +0000 Original-Received: from localhost ([127.0.0.1]:58156 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hFG9z-0001Yd-4h for submit@debbugs.gnu.org; Sat, 13 Apr 2019 06:45:23 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:41415) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hFG9x-0001YO-OJ for 35055@debbugs.gnu.org; Sat, 13 Apr 2019 06:45:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1555152312; bh=J4b0+Ssf0zGbhrpV4KjKG6Eyy5Sd7lAQ5p6eAInxJ/k=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=gw7W6s4PQX4up6tShXJgxJ89XnYVEADvKD7Xnwke00x0rHIQo3iP3ziG4ibKQU/Ys vwdjpfjDr9hkaTEADeentyfX6y8+B5B6BPoB9t/uloVV5D2Kx588sgHTPML4JuT2u8 v4KzrIE4F4HraYjeJdS3QJMUeEfrsx4B3BDVBFy4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from detlef.gmx.de ([178.20.95.31]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M6ilI-1guGpI0xSW-00wS3u; Sat, 13 Apr 2019 12:45:12 +0200 In-Reply-To: <87mul0tfe5.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 08 Apr 2019 23:23:46 +0300") X-Provags-ID: V03:K1:d2KU3RIbrZ0OpPzcomntwevrLWbI3aWad7Y9w5kUGknkaino4+P JY3yjvlHRXLKRUQ5Usm+OrpWBggIco+GFWtuVwrCQsfU1mm/+AGTP7q/kalRaEH0J6ajic8 86fn+bSjqlVi8KWbfXputrHrhqpoYKa2nL5q67mydAasz/ygtgHLe9PnP5kcT0LzJaX4GGo qqiQE2fbixxpklx2wMsQA== X-UI-Out-Filterresults: notjunk:1;V03:K0:XmUBb5Cu11Y=:lQZWscy5d5reSA3uZlchpz lKYuEWScviySPpFVVqBlF1FVDNlkipoqe46HSwvTlf29nQ6EkG/uebV5ragh97DMcrXjbWtB3 pWLPHovViKc1YsBL9bMMLTPKh5VJg4BGvIG5zS4xTejVBIH/SEqG39dO7oRvlGYJ2cyZRo7AV ZMdKsAeqxNf1XBMOKUBdt7xXpWJI97eeEc46QY9W3AmDB71iZRm3xzL4nJ7kmRMl6DoO3HYsb AyNDtJr+6ZJc+shh7QQtYcsogafLEXVHX0N32OVjDjYQMzKu4kJ4P+auL3422v2GgD5cr8sM8 ZMZq+MPJpRsv2L3wHzTEaGmWCq/E7GMLbXAsGXYwD28OO9D6c+eMwx3THwV2EFESm8Ld3DNcA PSq5VLBeypXgLcCDGBEYRlCo8gZHaK+PQPADoIKIulhBDbHuIyLyCEsJkau1s2qrBW0COr2RC ZA/rIbeIzSzeCMtwrI5D5ossVP7Yp8Uvfv8yQbMmDLV8V/FoD53AicYYTMajS+nHIiTTgSjjA PfRAY1EfOXVpehO0uxIC7P0mg2WySrB4hAawTMmSfIaoLiC4jv/sG4TJq5spvRXJxrJSVZmX2 9o8PGYSZXT00qZoPs8X8tYeu4zfokRBlgdZYvh6nDmjE37uMG6LjYeDabTI3NVLKvF/VvBmWA QpzIDhazK0oCCpt1m9fGV51S7EIhqi4f32uzAsOibWAXTV1GqU8A+giYvccYaeDbkUwtfOM1W oCwoOQZsqicyOeZrO4/TLmKlrwmFXvaIYUV14XST44qLloCEuf0iZktC0dTN4Hmq1kNvP0eZ 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:157579 Archived-At: Juri Linkov writes: Hi Juri, [sorry for the late reply; it was a busy week] >> Again, using tramp-remote-process-environment seems to be the >> appropriate place. > > Thanks for the suggestion, I customized it to '("COLUMNS=3D222") > that is approximately equal to my frame's width, thus `ps` > shows enough output, and `dpkg -l '*emacs*'` is not too wide > ('dpkg' tries to fill all available columns). > > Should a similar option be added for async-shell-command as well? > > diff --git a/lisp/simple.el b/lisp/simple.el > index 857e0fc001..7212686add 100644 > --- a/lisp/simple.el > +++ b/lisp/simple.el > @@ -3336,6 +3336,15 @@ async-shell-command-display-buffer > :group 'shell > :version "26.1") > > +(defcustom async-shell-command-width nil > + "Number of columns available for shell command. > +If nil, use the shell default number (usually 80). > +If a positive integer, use a fixed width." > + :type '(choice (const :tag "Use system limit" nil) > + (integer :tag "Fixed width" :value 80)) > + :group 'shell > + :version "27.1") > + > (defcustom shell-command-dont-erase-buffer nil > "If non-nil, output buffer is not erased between shell commands. > Also, a non-nil value sets the point in the output buffer > @@ -3599,8 +3608,13 @@ shell-command > (with-current-buffer buffer > (shell-command--save-pos-or-erase) > (setq default-directory directory) > - (setq proc > - (start-process-shell-command "Shell" buffer com= mand)) > + (let ((process-environment > + (if (natnump async-shell-command-width) > + (cons (format "COLUMNS=3D%d" async-shell-command-width) > + process-environment) > + process-environment))) > + (setq proc > + (start-process-shell-command "Shell" buffer command))) > (setq mode-line-process '(":%s")) > (require 'shell) (shell-mode) > (set-process-sentinel proc #'shell-command-sentinel) What about calling this just `shell-command-width'? It wouldn't hurt for synchronous shell commands, and I could adapt `tramp-remote-process-environment' accordingly if set. Might be more convenient for users. Best regards, Michael.