diff options
| author | Michael Albinus | 2020-05-16 14:04:07 +0200 |
|---|---|---|
| committer | Michael Albinus | 2020-05-16 14:04:07 +0200 |
| commit | bbbab82a7117e08a77433f5ad39b34f5e03a014c (patch) | |
| tree | 52ce224c6f704873ebbb2c50d9203592c2baea5f /doc | |
| parent | dba8f3783b209fef5be2589528ed43a99a8bab6a (diff) | |
| download | emacs-bbbab82a7117e08a77433f5ad39b34f5e03a014c.tar.gz emacs-bbbab82a7117e08a77433f5ad39b34f5e03a014c.zip | |
Introduce process-file-return-signal-string
* doc/lispref/processes.texi (Synchronous Processes):
Describe `process-file-return-signal-string'.
* doc/misc/tramp.texi: Adapt Tramp and Emacs version numbers.
(Remote processes): Describe `process-file-return-signal-string'
and $INSIDE_EMACS.
* etc/NEWS: Describe `process-file-return-signal-string'. Fix typos.
* lisp/simple.el (process-file-return-signal-string): New user option.
* lisp/net/tramp-adb.el (tramp-adb-handle-process-file):
* lisp/net/tramp-sh.el (tramp-sh-handle-process-file): Use it.
* lisp/net/tramp.el (tramp-get-signal-strings): New defun.
* test/lisp/net/tramp-tests.el (tramp-test28-process-file): Adapt test.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/lispref/processes.texi | 16 | ||||
| -rw-r--r-- | doc/misc/tramp.texi | 47 |
2 files changed, 49 insertions, 14 deletions
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi index c6e735a9b1e..22c50936185 100644 --- a/doc/lispref/processes.texi +++ b/doc/lispref/processes.texi | |||
| @@ -477,6 +477,22 @@ You should only ever change this variable with a let-binding; never | |||
| 477 | with @code{setq}. | 477 | with @code{setq}. |
| 478 | @end defvar | 478 | @end defvar |
| 479 | 479 | ||
| 480 | @defopt process-file-return-signal-string | ||
| 481 | This user option indicates whether a call of @code{process-file} | ||
| 482 | returns a string describing the signal interrupting a remote process. | ||
| 483 | |||
| 484 | When a process returns an exit code greater than 128, it is | ||
| 485 | interpreted as a signal. @code{process-file} requires to return a | ||
| 486 | string describing this signal. | ||
| 487 | |||
| 488 | Since there are processes violating this rule, returning exit codes | ||
| 489 | greater than 128 which are not bound to a signal, @code{process-file} | ||
| 490 | returns always the exit code as natural number for remote processes. | ||
| 491 | Setting this user option to non-nil forces @code{process-file} to | ||
| 492 | interpret such exit codes as signals, and to return a corresponding | ||
| 493 | string. | ||
| 494 | @end defopt | ||
| 495 | |||
| 480 | @defun call-process-region start end program &optional delete destination display &rest args | 496 | @defun call-process-region start end program &optional delete destination display &rest args |
| 481 | This function sends the text from @var{start} to @var{end} as | 497 | This function sends the text from @var{start} to @var{end} as |
| 482 | standard input to a process running @var{program}. It deletes the text | 498 | standard input to a process running @var{program}. It deletes the text |
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 0b13c17dbcf..d1688deb1b7 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi | |||
| @@ -318,14 +318,14 @@ behind the scenes when you open a file with @value{tramp}. | |||
| 318 | @uref{https://ftp.gnu.org/gnu/tramp/}. The version number of | 318 | @uref{https://ftp.gnu.org/gnu/tramp/}. The version number of |
| 319 | @value{tramp} can be obtained by the variable @code{tramp-version}. | 319 | @value{tramp} can be obtained by the variable @code{tramp-version}. |
| 320 | For released @value{tramp} versions, this is a three-number string | 320 | For released @value{tramp} versions, this is a three-number string |
| 321 | like ``2.4.2''. | 321 | like ``2.4.3''. |
| 322 | 322 | ||
| 323 | A @value{tramp} release, which is packaged with Emacs, could differ | 323 | A @value{tramp} release, which is packaged with Emacs, could differ |
| 324 | slightly from the corresponding standalone release. This is because | 324 | slightly from the corresponding standalone release. This is because |
| 325 | it isn't always possible to synchronize release dates between Emacs | 325 | it isn't always possible to synchronize release dates between Emacs |
| 326 | and @value{tramp}. Such version numbers have the Emacs version number | 326 | and @value{tramp}. Such version numbers have the Emacs version number |
| 327 | as suffix, like ``2.3.5.26.3''. This means @w{@value{tramp} 2.3.5} as | 327 | as suffix, like ``2.4.3.27.1''. This means @w{@value{tramp} 2.4.3} as |
| 328 | integrated in @w{Emacs 26.3}. A complete list of @value{tramp} | 328 | integrated in @w{Emacs 27.1}. A complete list of @value{tramp} |
| 329 | versions packaged with Emacs can be retrieved by | 329 | versions packaged with Emacs can be retrieved by |
| 330 | 330 | ||
| 331 | @vindex customize-package-emacs-version-alist | 331 | @vindex customize-package-emacs-version-alist |
| @@ -337,12 +337,12 @@ versions packaged with Emacs can be retrieved by | |||
| 337 | ELPA} package. Besides the standalone releases, further minor version | 337 | ELPA} package. Besides the standalone releases, further minor version |
| 338 | of @value{tramp} will appear on GNU ELPA, until the next @value{tramp} | 338 | of @value{tramp} will appear on GNU ELPA, until the next @value{tramp} |
| 339 | release appears. These minor versions have a four-number string, like | 339 | release appears. These minor versions have a four-number string, like |
| 340 | ``2.4.2.1''. | 340 | ``2.4.3.1''. |
| 341 | 341 | ||
| 342 | @value{tramp} development versions are available on Git servers. | 342 | @value{tramp} development versions are available on Git servers. |
| 343 | Development versions contain new and incomplete features. The | 343 | Development versions contain new and incomplete features. The |
| 344 | development version of @value{tramp} is always the version number of | 344 | development version of @value{tramp} is always the version number of |
| 345 | the next release, plus the suffix ``-pre'', like ``2.4.3-pre''. | 345 | the next release, plus the suffix ``-pre'', like ``2.4.4-pre''. |
| 346 | 346 | ||
| 347 | One way to obtain @value{tramp} from Git server is to visit the | 347 | One way to obtain @value{tramp} from Git server is to visit the |
| 348 | Savannah project page at the following URL and then clicking on the | 348 | Savannah project page at the following URL and then clicking on the |
| @@ -2315,7 +2315,7 @@ string of that environment variable looks always like | |||
| 2315 | @example | 2315 | @example |
| 2316 | @group | 2316 | @group |
| 2317 | echo $INSIDE_EMACS | 2317 | echo $INSIDE_EMACS |
| 2318 | @result{} 26.2,tramp:2.3.4 | 2318 | @result{} 27.1,tramp:2.4.3 |
| 2319 | @end group | 2319 | @end group |
| 2320 | @end example | 2320 | @end example |
| 2321 | 2321 | ||
| @@ -3050,6 +3050,17 @@ host when the variable @code{default-directory} is remote: | |||
| 3050 | @end group | 3050 | @end group |
| 3051 | @end lisp | 3051 | @end lisp |
| 3052 | 3052 | ||
| 3053 | @vindex process-file-return-signal-string | ||
| 3054 | @code{process-file} shall return either the exit code of the process, | ||
| 3055 | or a string describing the signal, when the process has been | ||
| 3056 | interrupted. Since it cannot be determined reliably whether a remote | ||
| 3057 | process has been interrupted, @code{process-file} returns always the | ||
| 3058 | exit code. When the user option | ||
| 3059 | @code{process-file-return-signal-string} is non-nil, | ||
| 3060 | @code{process-file} regards all exit codes greater than 128 as an | ||
| 3061 | indication that the process has been interrupted, and returns a | ||
| 3062 | respective string. | ||
| 3063 | |||
| 3053 | Remote processes do not apply to @acronym{GVFS} (see @ref{GVFS-based | 3064 | Remote processes do not apply to @acronym{GVFS} (see @ref{GVFS-based |
| 3054 | methods}) because the remote file system is mounted on the local host | 3065 | methods}) because the remote file system is mounted on the local host |
| 3055 | and @value{tramp} just accesses by changing the | 3066 | and @value{tramp} just accesses by changing the |
| @@ -3057,9 +3068,17 @@ and @value{tramp} just accesses by changing the | |||
| 3057 | 3068 | ||
| 3058 | @value{tramp} starts a remote process when a command is executed in a | 3069 | @value{tramp} starts a remote process when a command is executed in a |
| 3059 | remote file or directory buffer. As of now, these packages have been | 3070 | remote file or directory buffer. As of now, these packages have been |
| 3060 | integrated to work with @value{tramp}: @file{compile.el} (commands | 3071 | integrated to work with @value{tramp}: @file{shell.el}, |
| 3061 | like @code{compile} and @code{grep}) and @file{gud.el} (@code{gdb} or | 3072 | @file{eshell.el}, @file{compile.el} (commands like @code{compile} and |
| 3062 | @code{perldb}). | 3073 | @code{grep}) and @file{gud.el} (@code{gdb} or @code{perldb}). |
| 3074 | |||
| 3075 | @vindex INSIDE_EMACS@r{, environment variable} | ||
| 3076 | @value{tramp} always modifies the @env{INSIDE_EMACS} environment | ||
| 3077 | variable for remote processes. Per default, this environment variable | ||
| 3078 | shows the Emacs version. @value{tramp} adds its own version string, | ||
| 3079 | so it looks like @samp{27.1,tramp:2.4.3.1}. However, other packages | ||
| 3080 | might also add their name to this environment variable, like | ||
| 3081 | @samp{27.1,comint,tramp:2.4.3.1}. | ||
| 3063 | 3082 | ||
| 3064 | For @value{tramp} to find the command on the remote, it must be | 3083 | For @value{tramp} to find the command on the remote, it must be |
| 3065 | accessible through the default search path as setup by @value{tramp} | 3084 | accessible through the default search path as setup by @value{tramp} |
| @@ -3254,7 +3273,7 @@ variables. | |||
| 3254 | @vindex async-shell-command-width | 3273 | @vindex async-shell-command-width |
| 3255 | @vindex COLUMNS@r{, environment variable} | 3274 | @vindex COLUMNS@r{, environment variable} |
| 3256 | If Emacs supports the variable @code{async-shell-command-width} (since | 3275 | If Emacs supports the variable @code{async-shell-command-width} (since |
| 3257 | @w{Emacs 27.1}), @value{tramp} cares about its value for asynchronous | 3276 | @w{Emacs 27}), @value{tramp} cares about its value for asynchronous |
| 3258 | shell commands. It specifies the number of display columns for | 3277 | shell commands. It specifies the number of display columns for |
| 3259 | command output. For synchronous shell commands, a similar effect can | 3278 | command output. For synchronous shell commands, a similar effect can |
| 3260 | be achieved by adding the environment variable @env{COLUMNS} to | 3279 | be achieved by adding the environment variable @env{COLUMNS} to |
| @@ -3741,7 +3760,7 @@ row are possible, like @file{/path/to/dir/file.tar.gz.uu/dir/file}. | |||
| 3741 | 3760 | ||
| 3742 | @vindex tramp-archive-all-gvfs-methods | 3761 | @vindex tramp-archive-all-gvfs-methods |
| 3743 | An archive file name could be a remote file name, as in | 3762 | An archive file name could be a remote file name, as in |
| 3744 | @file{/ftp:anonymous@@ftp.gnu.org:/gnu/tramp/tramp-2.3.2.tar.gz/INSTALL}. | 3763 | @file{/ftp:anonymous@@ftp.gnu.org:/gnu/tramp/tramp-2.4.3.tar.gz/INSTALL}. |
| 3745 | Since all file operations are mapped internally to @acronym{GVFS} | 3764 | Since all file operations are mapped internally to @acronym{GVFS} |
| 3746 | operations, remote file names supported by @code{tramp-gvfs} perform | 3765 | operations, remote file names supported by @code{tramp-gvfs} perform |
| 3747 | better, because no local copy of the file archive must be downloaded | 3766 | better, because no local copy of the file archive must be downloaded |
| @@ -3752,7 +3771,7 @@ the similar @samp{/scp:user@@host:...}. See the constant | |||
| 3752 | 3771 | ||
| 3753 | If @code{url-handler-mode} is enabled, archives could be visited via | 3772 | If @code{url-handler-mode} is enabled, archives could be visited via |
| 3754 | URLs, like | 3773 | URLs, like |
| 3755 | @file{https://ftp.gnu.org/gnu/tramp/tramp-2.3.2.tar.gz/INSTALL}. This | 3774 | @file{https://ftp.gnu.org/gnu/tramp/tramp-2.4.3.tar.gz/INSTALL}. This |
| 3756 | allows complex file operations like | 3775 | allows complex file operations like |
| 3757 | 3776 | ||
| 3758 | @lisp | 3777 | @lisp |
| @@ -3760,8 +3779,8 @@ allows complex file operations like | |||
| 3760 | (progn | 3779 | (progn |
| 3761 | (url-handler-mode 1) | 3780 | (url-handler-mode 1) |
| 3762 | (ediff-directories | 3781 | (ediff-directories |
| 3763 | "https://ftp.gnu.org/gnu/tramp/tramp-2.3.1.tar.gz/tramp-2.3.1" | 3782 | "https://ftp.gnu.org/gnu/tramp/tramp-2.4.2.tar.gz/tramp-2.4.2" |
| 3764 | "https://ftp.gnu.org/gnu/tramp/tramp-2.3.2.tar.gz/tramp-2.3.2" "")) | 3783 | "https://ftp.gnu.org/gnu/tramp/tramp-2.4.3.tar.gz/tramp-2.4.3" "")) |
| 3765 | @end group | 3784 | @end group |
| 3766 | @end lisp | 3785 | @end lisp |
| 3767 | 3786 | ||