all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: 35055@debbugs.gnu.org
Subject: bug#35055: 27.0.50; async-shell-command truncates output lines
Date: Thu, 02 May 2019 23:57:40 +0300	[thread overview]
Message-ID: <87pnp0y7wv.fsf@mail.linkov.net> (raw)
In-Reply-To: <878svpdyag.fsf@gmx.de> (Michael Albinus's message of "Thu, 02 May 2019 11:02:31 +0200")

[-- Attachment #1: Type: text/plain, Size: 714 bytes --]

>> 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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: async-shell-command-width.2.patch --]
[-- Type: text/x-diff, Size: 4051 bytes --]

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"

  reply	other threads:[~2019-05-02 20:57 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-30 21:55 bug#35055: 27.0.50; async-shell-command truncates output lines Juri Linkov
2019-04-01 10:00 ` Michael Albinus
2019-04-01 20:44   ` Juri Linkov
2019-04-02  9:27     ` Michael Albinus
2019-04-03 20:36       ` Juri Linkov
2019-04-04 20:59         ` Juri Linkov
2019-04-05 12:35           ` Michael Albinus
2019-04-06 20:47             ` Juri Linkov
2019-04-07  7:32               ` Michael Albinus
2019-04-07 20:15                 ` Juri Linkov
2019-04-08  7:39                   ` Michael Albinus
2019-04-08 20:23                     ` Juri Linkov
2019-04-13 10:45                       ` Michael Albinus
2019-04-13 21:48                         ` Juri Linkov
2019-04-14 17:55                           ` Michael Albinus
2019-04-14 19:41                             ` Juri Linkov
2019-04-15  7:47                               ` Michael Albinus
2019-04-16 20:39                                 ` Juri Linkov
2019-04-17  7:22                                   ` Michael Albinus
2019-04-17 20:13                                     ` Juri Linkov
2019-04-18  7:40                                       ` Michael Albinus
2019-04-18 20:51                                         ` Juri Linkov
2019-04-19  7:21                                           ` Michael Albinus
2019-04-30 21:17                                           ` Michael Albinus
2019-05-01 21:07                                             ` Juri Linkov
2019-05-02  9:02                                               ` Michael Albinus
2019-05-02 20:57                                                 ` Juri Linkov [this message]
2019-05-03  7:20                                                   ` Michael Albinus
2019-05-05 19:27                                                     ` Juri Linkov
2019-05-06  9:28                                                       ` Michael Albinus

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pnp0y7wv.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=35055@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.