diff options
| author | Juri Linkov | 2019-05-05 22:27:33 +0300 |
|---|---|---|
| committer | Juri Linkov | 2019-05-05 22:27:33 +0300 |
| commit | df9b56ecff43b64f39e98ab118fe9a0f299882c4 (patch) | |
| tree | a7689e9ea9e4470facb5e815e71dd24dd14c92a2 | |
| parent | 81487bf89122ef0f369690e421740d38dbc17e23 (diff) | |
| download | emacs-df9b56ecff43b64f39e98ab118fe9a0f299882c4.tar.gz emacs-df9b56ecff43b64f39e98ab118fe9a0f299882c4.zip | |
Rename shell-command-width to async-shell-command-width (bug#35055)
* lisp/simple.el (async-shell-command-width):
* lisp/net/tramp.el (tramp-handle-shell-command):
* test/lisp/net/tramp-tests.el (tramp-test32-shell-command):
* doc/misc/tramp.texi (Remote processes): Rename this variable.
* doc/emacs/misc.texi (Single Shell): Add async-shell-command-width.
| -rw-r--r-- | doc/emacs/misc.texi | 7 | ||||
| -rw-r--r-- | doc/misc/tramp.texi | 4 | ||||
| -rw-r--r-- | etc/NEWS | 4 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 6 | ||||
| -rw-r--r-- | lisp/simple.el | 6 | ||||
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 9 |
6 files changed, 21 insertions, 15 deletions
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 7d7065a441a..5f743927367 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi | |||
| @@ -775,6 +775,13 @@ documentation for more possibilities. | |||
| 775 | displayed only when the command generates output, set | 775 | displayed only when the command generates output, set |
| 776 | @code{async-shell-command-display-buffer} to @code{nil}. | 776 | @code{async-shell-command-display-buffer} to @code{nil}. |
| 777 | 777 | ||
| 778 | @vindex async-shell-command-width | ||
| 779 | The option @code{async-shell-command-width} defines the number of display | ||
| 780 | columns available for output of asynchronous shell commands. | ||
| 781 | A positive integer tells the shell to use that number of columns for | ||
| 782 | command output. The default value is @code{nil} that means to use | ||
| 783 | the same number of columns as provided by the shell. | ||
| 784 | |||
| 778 | @kindex M-| | 785 | @kindex M-| |
| 779 | @findex shell-command-on-region | 786 | @findex shell-command-on-region |
| 780 | @kbd{M-|} (@code{shell-command-on-region}) is like @kbd{M-!}, but | 787 | @kbd{M-|} (@code{shell-command-on-region}) is like @kbd{M-!}, but |
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 0c51f15fbb9..2eb5b45eb2a 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi | |||
| @@ -3093,9 +3093,9 @@ uses @file{/system/bin/sh}). Like the variables in the previous | |||
| 3093 | section, these variables can be changed via connection-local | 3093 | section, these variables can be changed via connection-local |
| 3094 | variables. | 3094 | variables. |
| 3095 | 3095 | ||
| 3096 | @vindex shell-command-width | 3096 | @vindex async-shell-command-width |
| 3097 | @vindex COLUMNS@r{, environment variable} | 3097 | @vindex COLUMNS@r{, environment variable} |
| 3098 | If Emacs supports the variable @code{shell-command-width} (since Emacs | 3098 | If Emacs supports the variable @code{async-shell-command-width} (since Emacs |
| 3099 | 27.1), @value{tramp} cares about its value for asynchronous shell | 3099 | 27.1), @value{tramp} cares about its value for asynchronous shell |
| 3100 | commands. It specifies the number of display columns for command | 3100 | commands. It specifies the number of display columns for command |
| 3101 | output. For synchronous shell commands, a similar effect can be | 3101 | output. For synchronous shell commands, a similar effect can be |
| @@ -1119,8 +1119,8 @@ variable for remote shells. It still defaults to "/bin/sh". | |||
| 1119 | ** Single shell commands | 1119 | ** Single shell commands |
| 1120 | 1120 | ||
| 1121 | --- | 1121 | --- |
| 1122 | *** 'shell-command-width' defines the number of display columns | 1122 | *** 'async-shell-command-width' defines the number of display columns |
| 1123 | available for output of asynchronous or remote shell commands. | 1123 | available for output of asynchronous shell commands. |
| 1124 | 1124 | ||
| 1125 | ** Pcomplete | 1125 | ** Pcomplete |
| 1126 | 1126 | ||
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 911fa912727..1f83756c322 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -3640,10 +3640,10 @@ support symbolic links." | |||
| 3640 | 3640 | ||
| 3641 | (if (and (not current-buffer-p) (integerp asynchronous)) | 3641 | (if (and (not current-buffer-p) (integerp asynchronous)) |
| 3642 | (let ((tramp-remote-process-environment | 3642 | (let ((tramp-remote-process-environment |
| 3643 | ;; `shell-command-width' has been introduced with Emacs 27.1. | 3643 | ;; `async-shell-command-width' has been introduced with Emacs 27.1. |
| 3644 | (if (natnump (bound-and-true-p shell-command-width)) | 3644 | (if (natnump (bound-and-true-p async-shell-command-width)) |
| 3645 | (cons (format "COLUMNS=%d" | 3645 | (cons (format "COLUMNS=%d" |
| 3646 | (bound-and-true-p shell-command-width)) | 3646 | (bound-and-true-p async-shell-command-width)) |
| 3647 | tramp-remote-process-environment) | 3647 | tramp-remote-process-environment) |
| 3648 | tramp-remote-process-environment))) | 3648 | tramp-remote-process-environment))) |
| 3649 | (prog1 | 3649 | (prog1 |
diff --git a/lisp/simple.el b/lisp/simple.el index acea1f9ddc1..4454791ad20 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -3353,7 +3353,7 @@ is output." | |||
| 3353 | :group 'shell | 3353 | :group 'shell |
| 3354 | :version "26.1") | 3354 | :version "26.1") |
| 3355 | 3355 | ||
| 3356 | (defcustom shell-command-width nil | 3356 | (defcustom async-shell-command-width nil |
| 3357 | "Number of display columns available for asynchronous shell command output. | 3357 | "Number of display columns available for asynchronous shell command output. |
| 3358 | If nil, use the shell default number (usually 80 columns). | 3358 | If nil, use the shell default number (usually 80 columns). |
| 3359 | If a positive integer, tell the shell to use that number of columns for | 3359 | If a positive integer, tell the shell to use that number of columns for |
| @@ -3627,8 +3627,8 @@ impose the use of a shell (with its need to quote arguments)." | |||
| 3627 | (shell-command--save-pos-or-erase) | 3627 | (shell-command--save-pos-or-erase) |
| 3628 | (setq default-directory directory) | 3628 | (setq default-directory directory) |
| 3629 | (let ((process-environment | 3629 | (let ((process-environment |
| 3630 | (if (natnump shell-command-width) | 3630 | (if (natnump async-shell-command-width) |
| 3631 | (cons (format "COLUMNS=%d" shell-command-width) | 3631 | (cons (format "COLUMNS=%d" async-shell-command-width) |
| 3632 | process-environment) | 3632 | process-environment) |
| 3633 | process-environment))) | 3633 | process-environment))) |
| 3634 | (setq proc | 3634 | (setq proc |
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index cba697da18c..7d3c43408d4 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -4192,18 +4192,17 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 4192 | ;; Cleanup. | 4192 | ;; Cleanup. |
| 4193 | (ignore-errors (delete-file tmp-name))) | 4193 | (ignore-errors (delete-file tmp-name))) |
| 4194 | 4194 | ||
| 4195 | ;; Test `shell-command-width' of `async-shell-command'. | 4195 | ;; Test `async-shell-command-width'. Since Emacs 27.1. |
| 4196 | ;; Since Emacs 27.1. | 4196 | (when (and (boundp 'async-shell-command-width) |
| 4197 | (when (and (boundp 'shell-command-width) | ||
| 4198 | (zerop (call-process "tput" nil nil nil "cols")) | 4197 | (zerop (call-process "tput" nil nil nil "cols")) |
| 4199 | (zerop (process-file "tput" nil nil nil "cols"))) | 4198 | (zerop (process-file "tput" nil nil nil "cols"))) |
| 4200 | (let (shell-command-width) | 4199 | (let (async-shell-command-width) |
| 4201 | (should | 4200 | (should |
| 4202 | (string-equal | 4201 | (string-equal |
| 4203 | (format "%s\n" (car (process-lines "tput" "cols"))) | 4202 | (format "%s\n" (car (process-lines "tput" "cols"))) |
| 4204 | (tramp--test-shell-command-to-string-asynchronously | 4203 | (tramp--test-shell-command-to-string-asynchronously |
| 4205 | "tput cols"))) | 4204 | "tput cols"))) |
| 4206 | (setq shell-command-width 1024) | 4205 | (setq async-shell-command-width 1024) |
| 4207 | (should | 4206 | (should |
| 4208 | (string-equal | 4207 | (string-equal |
| 4209 | "1024\n" | 4208 | "1024\n" |