diff options
| author | Michael Albinus | 2018-06-20 12:13:56 +0200 |
|---|---|---|
| committer | Michael Albinus | 2018-06-20 12:13:56 +0200 |
| commit | 6f649e77b8512f73b17f03fd795beea9965c4029 (patch) | |
| tree | c52a6a8413dab1e9af36d975869f16019230ad53 | |
| parent | 3a47f3921bdaaf7b7d80dc3be05a5f1b1f2501eb (diff) | |
| download | emacs-6f649e77b8512f73b17f03fd795beea9965c4029.tar.gz emacs-6f649e77b8512f73b17f03fd795beea9965c4029.zip | |
Implement command completion in remote shells. (Bug#31704)
* doc/lispref/files.texi (Locating Files): Describe optional
argument REMOTE of `executable-find'.
(Magic File Names): Add `exec-path'.
* doc/lispref/processes.texi (Subprocess Creation): Describe
function `exec-path'.
* doc/misc/tramp.texi (Remote programs): Explain refresh of search
paths by `tramp-cleanup-this-connection'.
* etc/NEWS: Mention 'exec-path' and 'executable-find'.
* lisp/files.el (exec-path): New defun.
(executable-find): Add optional argument REMOTE.
* lisp/shell.el (shell-completion-vars): Set `comint-file-name-prefix'.
(shell--command-completion-data): Use `(exec-path)'. (Bug#31704)
* lisp/net/ange-ftp.el (exec-path):
* lisp/net/tramp.el (tramp-file-name-for-operation):
* lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
* lisp/net/tramp-archive.el (tramp-archive-file-name-handler-alist):
* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
* lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist):
* lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist)
<exec-path>: Add handler.
* lisp/net/tramp-adb.el (tramp-adb-handle-exec-path): New defun.
(tramp-adb-maybe-open-connection): Do not set "remote-path"
connection property.
* lisp/net/tramp-compat.el (tramp-compat-exec-path): New defun.
* lisp/net/tramp-sh.el (tramp-sh-handle-exec-path): New defun.
* lisp/net/tramp.el (tramp-eshell-directory-change): Use it.
* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test38-make-nearby-temp-file)
(tramp-archive-test41-file-system-info)
(tramp-archive-test43-auto-load)
(tramp-archive-test43-delay-load): Rename.
* test/lisp/net/tramp-tests.el (tramp-test34-exec-path): New test.
(tramp-test36-make-auto-save-file-name)
(tramp-test37-find-backup-file-name)
(tramp-test38-make-nearby-temp-file)
(tramp-test39-special-characters)
(tramp-test39-special-characters-with-stat)
(tramp-test39-special-characters-with-perl)
(tramp-test39-special-characters-with-ls, tramp-test40-utf8)
(tramp-test40-utf8-with-stat, tramp-test40-utf8-with-perl)
(tramp-test40-utf8-with-ls, tramp-test41-file-system-info)
(tramp-test42-asynchronous-requests, tramp-test43-auto-load)
(tramp-test43-delay-load, tramp-test43-recursive-load)
(tramp-test43-remote-load-path, tramp-test44-unload): Rename.
| -rw-r--r-- | doc/lispref/files.texi | 13 | ||||
| -rw-r--r-- | doc/lispref/processes.texi | 8 | ||||
| -rw-r--r-- | doc/misc/tramp.texi | 6 | ||||
| -rw-r--r-- | etc/NEWS | 18 | ||||
| -rw-r--r-- | lisp/files.el | 30 | ||||
| -rw-r--r-- | lisp/net/ange-ftp.el | 1 | ||||
| -rw-r--r-- | lisp/net/tramp-adb.el | 28 | ||||
| -rw-r--r-- | lisp/net/tramp-archive.el | 1 | ||||
| -rw-r--r-- | lisp/net/tramp-compat.el | 11 | ||||
| -rw-r--r-- | lisp/net/tramp-gvfs.el | 1 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 8 | ||||
| -rw-r--r-- | lisp/net/tramp-smb.el | 1 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 18 | ||||
| -rw-r--r-- | lisp/shell.el | 11 | ||||
| -rw-r--r-- | test/lisp/net/tramp-archive-tests.el | 8 | ||||
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 86 |
16 files changed, 175 insertions, 74 deletions
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index f4678ddd846..068cf054437 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi | |||
| @@ -1567,13 +1567,16 @@ For compatibility, @var{predicate} can also be one of the symbols | |||
| 1567 | a list of one or more of these symbols. | 1567 | a list of one or more of these symbols. |
| 1568 | @end defun | 1568 | @end defun |
| 1569 | 1569 | ||
| 1570 | @defun executable-find program | 1570 | @defun executable-find program &optional remote |
| 1571 | This function searches for the executable file of the named | 1571 | This function searches for the executable file of the named |
| 1572 | @var{program} and returns the absolute file name of the executable, | 1572 | @var{program} and returns the absolute file name of the executable, |
| 1573 | including its file-name extensions, if any. It returns @code{nil} if | 1573 | including its file-name extensions, if any. It returns @code{nil} if |
| 1574 | the file is not found. The functions searches in all the directories | 1574 | the file is not found. The function searches in all the directories |
| 1575 | in @code{exec-path}, and tries all the file-name extensions in | 1575 | in @code{exec-path}, and tries all the file-name extensions in |
| 1576 | @code{exec-suffixes} (@pxref{Subprocess Creation}). | 1576 | @code{exec-suffixes} (@pxref{Subprocess Creation}). |
| 1577 | |||
| 1578 | If @var{remote} is non-@code{nil}, and @code{default-directory} is a | ||
| 1579 | remote directory, @var{program} is searched on the respective remote host. | ||
| 1577 | @end defun | 1580 | @end defun |
| 1578 | 1581 | ||
| 1579 | @node Changing Files | 1582 | @node Changing Files |
| @@ -3137,8 +3140,8 @@ first, before handlers for jobs such as remote file access. | |||
| 3137 | @code{directory-file-name}, | 3140 | @code{directory-file-name}, |
| 3138 | @code{directory-files}, | 3141 | @code{directory-files}, |
| 3139 | @code{directory-files-and-attributes}, | 3142 | @code{directory-files-and-attributes}, |
| 3140 | @code{dired-compress-file}, @code{dired-uncache},@* | 3143 | @code{dired-compress-file}, @code{dired-uncache}, |
| 3141 | @code{expand-file-name}, | 3144 | @code{exec-path}, @code{expand-file-name},@* |
| 3142 | @code{file-accessible-directory-p}, | 3145 | @code{file-accessible-directory-p}, |
| 3143 | @code{file-acl}, | 3146 | @code{file-acl}, |
| 3144 | @code{file-attributes}, | 3147 | @code{file-attributes}, |
| @@ -3195,7 +3198,7 @@ first, before handlers for jobs such as remote file access. | |||
| 3195 | @code{directory-files}, | 3198 | @code{directory-files}, |
| 3196 | @code{directory-files-and-at@discretionary{}{}{}tributes}, | 3199 | @code{directory-files-and-at@discretionary{}{}{}tributes}, |
| 3197 | @code{dired-compress-file}, @code{dired-uncache}, | 3200 | @code{dired-compress-file}, @code{dired-uncache}, |
| 3198 | @code{expand-file-name}, | 3201 | @code{exec-path}, @code{expand-file-name}, |
| 3199 | @code{file-accessible-direc@discretionary{}{}{}tory-p}, | 3202 | @code{file-accessible-direc@discretionary{}{}{}tory-p}, |
| 3200 | @code{file-acl}, | 3203 | @code{file-acl}, |
| 3201 | @code{file-attributes}, | 3204 | @code{file-attributes}, |
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi index 3e26f577982..f78d8485e4e 100644 --- a/doc/lispref/processes.texi +++ b/doc/lispref/processes.texi | |||
| @@ -177,6 +177,14 @@ before starting Emacs. Trying to modify @code{exec-path} | |||
| 177 | independently of @env{PATH} can lead to confusing results. | 177 | independently of @env{PATH} can lead to confusing results. |
| 178 | @end defopt | 178 | @end defopt |
| 179 | 179 | ||
| 180 | @defun exec-path | ||
| 181 | The function @code{exec-path} is an extension of the respective | ||
| 182 | variable. If @code{default-directory} indicates a remote directory, | ||
| 183 | it returns a list of directories used for searching programs on the | ||
| 184 | respective remote host. In case of a local @code{default-directory}, | ||
| 185 | the function returns just the value of the variable @code{exec-path}. | ||
| 186 | @end defun | ||
| 187 | |||
| 180 | @node Shell Arguments | 188 | @node Shell Arguments |
| 181 | @section Shell Arguments | 189 | @section Shell Arguments |
| 182 | @cindex arguments for shell commands | 190 | @cindex arguments for shell commands |
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 420fef7164c..a9de1fddc66 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi | |||
| @@ -1816,9 +1816,9 @@ shell supports the login argument @samp{-l}. | |||
| 1816 | @end defopt | 1816 | @end defopt |
| 1817 | 1817 | ||
| 1818 | When remote search paths are changed, local @value{tramp} caches must | 1818 | When remote search paths are changed, local @value{tramp} caches must |
| 1819 | be recomputed. To force @value{tramp} to recompute afresh, exit | 1819 | be recomputed. To force @value{tramp} to recompute afresh, call |
| 1820 | Emacs, remove the persistent file (@pxref{Connection caching}), and | 1820 | @kbd{M-x tramp-cleanup-this-connection @key{RET}} or friends |
| 1821 | restart Emacs. | 1821 | (@pxref{Cleanup remote connections}). |
| 1822 | 1822 | ||
| 1823 | 1823 | ||
| 1824 | @node Remote shell setup | 1824 | @node Remote shell setup |
| @@ -145,6 +145,14 @@ regular expression was previously invalid, but is now accepted: | |||
| 145 | --- | 145 | --- |
| 146 | ** The German prefix and postfix input methods now support Capital sharp S. | 146 | ** The German prefix and postfix input methods now support Capital sharp S. |
| 147 | 147 | ||
| 148 | +++ | ||
| 149 | ** The new function 'exec-path' returns a directory list from a remote host. | ||
| 150 | |||
| 151 | +++ | ||
| 152 | ** Function 'executable-find' supports an optional argument REMOTE. | ||
| 153 | This triggers to search a program name on the remote host indicated by | ||
| 154 | 'default-directory'. | ||
| 155 | |||
| 148 | 156 | ||
| 149 | * Editing Changes in Emacs 27.1 | 157 | * Editing Changes in Emacs 27.1 |
| 150 | 158 | ||
| @@ -436,7 +444,6 @@ It can be used to set any buffer as the next one to be used by | |||
| 436 | This means that pressing C-M-SPACE now selects the entire tree by | 444 | This means that pressing C-M-SPACE now selects the entire tree by |
| 437 | default, and not just the opening element. | 445 | default, and not just the opening element. |
| 438 | 446 | ||
| 439 | |||
| 440 | ** Eshell | 447 | ** Eshell |
| 441 | 448 | ||
| 442 | --- | 449 | --- |
| @@ -454,11 +461,15 @@ To restore the old behavior, use | |||
| 454 | Previously eshell/kill would fail if provided a kill signal to send to the | 461 | Previously eshell/kill would fail if provided a kill signal to send to the |
| 455 | process. It now accepts signals specified either by name or by its number. | 462 | process. It now accepts signals specified either by name or by its number. |
| 456 | 463 | ||
| 464 | ** Shell | ||
| 465 | |||
| 466 | --- | ||
| 467 | *** Program name completion inside remote shells works now as expected. | ||
| 468 | |||
| 457 | ** Pcomplete | 469 | ** Pcomplete |
| 458 | *** The function 'pcomplete-uniquify-list' has been renamed from | 470 | *** The function 'pcomplete-uniquify-list' has been renamed from |
| 459 | 'pcomplete-uniqify-list'. | 471 | 'pcomplete-uniqify-list'. |
| 460 | 472 | ||
| 461 | |||
| 462 | ** Auth-source | 473 | ** Auth-source |
| 463 | 474 | ||
| 464 | --- | 475 | --- |
| @@ -755,7 +766,6 @@ will be chosen even if you have an entry for image/* in your | |||
| 755 | overrides all system and Emacs-provided defaults. To get the old | 766 | overrides all system and Emacs-provided defaults. To get the old |
| 756 | method back, set 'mailcap-prefer-mailcap-viewers' to nil. | 767 | method back, set 'mailcap-prefer-mailcap-viewers' to nil. |
| 757 | 768 | ||
| 758 | |||
| 759 | ** URL | 769 | ** URL |
| 760 | 770 | ||
| 761 | *** The file: handler no longer looks for index.html in directories if | 771 | *** The file: handler no longer looks for index.html in directories if |
| @@ -763,14 +773,12 @@ you ask it for a file:///dir URL. Since this is a low-level library, | |||
| 763 | such decisions (if they are to be made at all) are left to | 773 | such decisions (if they are to be made at all) are left to |
| 764 | higher-level functions. | 774 | higher-level functions. |
| 765 | 775 | ||
| 766 | |||
| 767 | ** image-mode | 776 | ** image-mode |
| 768 | 777 | ||
| 769 | *** image-mode started using ImageMagick by default for all images | 778 | *** image-mode started using ImageMagick by default for all images |
| 770 | some years back. It now respects 'imagemagick-types-inhibit' as a way | 779 | some years back. It now respects 'imagemagick-types-inhibit' as a way |
| 771 | to disable that. | 780 | to disable that. |
| 772 | 781 | ||
| 773 | |||
| 774 | +++ | 782 | +++ |
| 775 | ** The new function 'read-answer' accepts either long or short answers | 783 | ** The new function 'read-answer' accepts either long or short answers |
| 776 | depending on the new customizable variable 'read-answer-short'. | 784 | depending on the new customizable variable 'read-answer-short'. |
diff --git a/lisp/files.el b/lisp/files.el index c4a68d04407..d0804b000a6 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -1024,13 +1024,33 @@ customize the variable `user-emacs-directory-warning'." | |||
| 1024 | errtype user-emacs-directory))))) | 1024 | errtype user-emacs-directory))))) |
| 1025 | bestname)))) | 1025 | bestname)))) |
| 1026 | 1026 | ||
| 1027 | (defun exec-path () | ||
| 1028 | "List of directories to search programs to run in remote subprocesses. | ||
| 1029 | The remote host is identified by `default-directory'. For remote | ||
| 1030 | hosts which do not support subprocesses, this returns `nil'. | ||
| 1031 | If `default-directory' is a local directory, the value of the variable | ||
| 1032 | `exec-path' is returned." | ||
| 1033 | (let ((handler (find-file-name-handler default-directory 'exec-path))) | ||
| 1034 | (if handler | ||
| 1035 | (funcall handler 'exec-path) | ||
| 1036 | exec-path))) | ||
| 1027 | 1037 | ||
| 1028 | (defun executable-find (command) | 1038 | (defun executable-find (command &optional remote) |
| 1029 | "Search for COMMAND in `exec-path' and return the absolute file name. | 1039 | "Search for COMMAND in `exec-path' and return the absolute file name. |
| 1030 | Return nil if COMMAND is not found anywhere in `exec-path'." | 1040 | Return nil if COMMAND is not found anywhere in `exec-path'. If |
| 1031 | ;; Use 1 rather than file-executable-p to better match the behavior of | 1041 | REMOTE is non-nil, search on the remote host indicated by |
| 1032 | ;; call-process. | 1042 | `default-directory' instead." |
| 1033 | (locate-file command exec-path exec-suffixes 1)) | 1043 | (if (and remote (file-remote-p default-directory)) |
| 1044 | (let ((res (locate-file | ||
| 1045 | command | ||
| 1046 | (mapcar | ||
| 1047 | (lambda (x) (concat (file-remote-p default-directory) x)) | ||
| 1048 | (exec-path)) | ||
| 1049 | exec-suffixes 'file-executable-p))) | ||
| 1050 | (when (stringp res) (file-local-name res))) | ||
| 1051 | ;; Use 1 rather than file-executable-p to better match the | ||
| 1052 | ;; behavior of call-process. | ||
| 1053 | (locate-file command exec-path exec-suffixes 1))) | ||
| 1034 | 1054 | ||
| 1035 | (defun load-library (library) | 1055 | (defun load-library (library) |
| 1036 | "Load the Emacs Lisp library named LIBRARY. | 1056 | "Load the Emacs Lisp library named LIBRARY. |
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index cf9667ac628..2fc7ac251ec 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el | |||
| @@ -4439,6 +4439,7 @@ NEWNAME should be the name to give the new compressed or uncompressed file.") | |||
| 4439 | (put 'process-file 'ange-ftp 'ange-ftp-process-file) | 4439 | (put 'process-file 'ange-ftp 'ange-ftp-process-file) |
| 4440 | (put 'start-file-process 'ange-ftp 'ignore) | 4440 | (put 'start-file-process 'ange-ftp 'ignore) |
| 4441 | (put 'shell-command 'ange-ftp 'ange-ftp-shell-command) | 4441 | (put 'shell-command 'ange-ftp 'ange-ftp-shell-command) |
| 4442 | (put 'exec-path 'ange-ftp 'ignore) | ||
| 4442 | 4443 | ||
| 4443 | ;;; Define ways of getting at unmodified Emacs primitives, | 4444 | ;;; Define ways of getting at unmodified Emacs primitives, |
| 4444 | ;;; turning off our handler. | 4445 | ;;; turning off our handler. |
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index df2160770b1..7cb61adde80 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el | |||
| @@ -107,6 +107,7 @@ It is used for TCP/IP devices." | |||
| 107 | . tramp-adb-handle-directory-files-and-attributes) | 107 | . tramp-adb-handle-directory-files-and-attributes) |
| 108 | (dired-compress-file . ignore) | 108 | (dired-compress-file . ignore) |
| 109 | (dired-uncache . tramp-handle-dired-uncache) | 109 | (dired-uncache . tramp-handle-dired-uncache) |
| 110 | (exec-path . tramp-adb-handle-exec-path) | ||
| 110 | (expand-file-name . tramp-adb-handle-expand-file-name) | 111 | (expand-file-name . tramp-adb-handle-expand-file-name) |
| 111 | (file-accessible-directory-p . tramp-handle-file-accessible-directory-p) | 112 | (file-accessible-directory-p . tramp-handle-file-accessible-directory-p) |
| 112 | (file-acl . ignore) | 113 | (file-acl . ignore) |
| @@ -1116,6 +1117,21 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 1116 | (tramp-flush-connection-property v "process-name") | 1117 | (tramp-flush-connection-property v "process-name") |
| 1117 | (tramp-flush-connection-property v "process-buffer")))))) | 1118 | (tramp-flush-connection-property v "process-buffer")))))) |
| 1118 | 1119 | ||
| 1120 | (defun tramp-adb-handle-exec-path () | ||
| 1121 | "Like `exec-path' for Tramp files." | ||
| 1122 | (append | ||
| 1123 | (with-parsed-tramp-file-name default-directory nil | ||
| 1124 | (with-tramp-connection-property v "remote-path" | ||
| 1125 | (tramp-adb-send-command v "echo \\\"$PATH\\\"") | ||
| 1126 | (split-string | ||
| 1127 | (with-current-buffer (tramp-get-connection-buffer v) | ||
| 1128 | ;; Read the expression. | ||
| 1129 | (goto-char (point-min)) | ||
| 1130 | (read (current-buffer))) | ||
| 1131 | ":" 'omit))) | ||
| 1132 | ;; The equivalent to `exec-directory'. | ||
| 1133 | `(,(file-local-name default-directory)))) | ||
| 1134 | |||
| 1119 | (defun tramp-adb-get-device (vec) | 1135 | (defun tramp-adb-get-device (vec) |
| 1120 | "Return full host name from VEC to be used in shell execution. | 1136 | "Return full host name from VEC to be used in shell execution. |
| 1121 | E.g. a host name \"192.168.1.1#5555\" returns \"192.168.1.1:5555\" | 1137 | E.g. a host name \"192.168.1.1#5555\" returns \"192.168.1.1:5555\" |
| @@ -1340,18 +1356,6 @@ connection if a previous connection has died for some reason." | |||
| 1340 | (tramp-error | 1356 | (tramp-error |
| 1341 | vec 'file-error "Cannot switch to user `%s'" user))) | 1357 | vec 'file-error "Cannot switch to user `%s'" user))) |
| 1342 | 1358 | ||
| 1343 | ;; Set "remote-path" connection property. This is needed | ||
| 1344 | ;; for eshell. | ||
| 1345 | (tramp-adb-send-command vec "echo \\\"$PATH\\\"") | ||
| 1346 | (tramp-set-connection-property | ||
| 1347 | vec "remote-path" | ||
| 1348 | (split-string | ||
| 1349 | (with-current-buffer (tramp-get-connection-buffer vec) | ||
| 1350 | ;; Read the expression. | ||
| 1351 | (goto-char (point-min)) | ||
| 1352 | (read (current-buffer))) | ||
| 1353 | ":" 'omit)) | ||
| 1354 | |||
| 1355 | ;; Set connection-local variables. | 1359 | ;; Set connection-local variables. |
| 1356 | (tramp-set-connection-local-variables vec) | 1360 | (tramp-set-connection-local-variables vec) |
| 1357 | 1361 | ||
diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el index 42c3d40c1bb..5d7562f707e 100644 --- a/lisp/net/tramp-archive.el +++ b/lisp/net/tramp-archive.el | |||
| @@ -220,6 +220,7 @@ It must be supported by libarchive(3).") | |||
| 220 | . tramp-handle-directory-files-and-attributes) | 220 | . tramp-handle-directory-files-and-attributes) |
| 221 | (dired-compress-file . tramp-archive-handle-not-implemented) | 221 | (dired-compress-file . tramp-archive-handle-not-implemented) |
| 222 | (dired-uncache . tramp-archive-handle-dired-uncache) | 222 | (dired-uncache . tramp-archive-handle-dired-uncache) |
| 223 | (exec-path . ignore) | ||
| 223 | ;; `expand-file-name' performed by default handler. | 224 | ;; `expand-file-name' performed by default handler. |
| 224 | (file-accessible-directory-p . tramp-handle-file-accessible-directory-p) | 225 | (file-accessible-directory-p . tramp-handle-file-accessible-directory-p) |
| 225 | (file-acl . ignore) | 226 | (file-acl . ignore) |
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index aa0c99bf9cf..9af57fb0755 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el | |||
| @@ -236,6 +236,17 @@ If NAME is a remote file name, the local part of NAME is unquoted." | |||
| 236 | (defconst tramp-compat-use-url-tramp-p (fboundp 'temporary-file-directory) | 236 | (defconst tramp-compat-use-url-tramp-p (fboundp 'temporary-file-directory) |
| 237 | "Whether to use url-tramp.el.") | 237 | "Whether to use url-tramp.el.") |
| 238 | 238 | ||
| 239 | ;; `exec-path' is new in Emacs 27.1. | ||
| 240 | (eval-and-compile | ||
| 241 | (if (fboundp 'exec-path) | ||
| 242 | (defalias 'tramp-compat-exec-path 'exec-path) | ||
| 243 | (defun tramp-compat-exec-path () | ||
| 244 | "List of directories to search programs to run in remote subprocesses." | ||
| 245 | (let ((handler (find-file-name-handler default-directory 'exec-path))) | ||
| 246 | (if handler | ||
| 247 | (funcall handler 'exec-path) | ||
| 248 | exec-path))))) | ||
| 249 | |||
| 239 | (add-hook 'tramp-unload-hook | 250 | (add-hook 'tramp-unload-hook |
| 240 | (lambda () | 251 | (lambda () |
| 241 | (unload-feature 'tramp-loaddefs 'force) | 252 | (unload-feature 'tramp-loaddefs 'force) |
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 87c0c796b69..a30d7ef7138 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el | |||
| @@ -536,6 +536,7 @@ It has been changed in GVFS 1.14.") | |||
| 536 | . tramp-handle-directory-files-and-attributes) | 536 | . tramp-handle-directory-files-and-attributes) |
| 537 | (dired-compress-file . ignore) | 537 | (dired-compress-file . ignore) |
| 538 | (dired-uncache . tramp-handle-dired-uncache) | 538 | (dired-uncache . tramp-handle-dired-uncache) |
| 539 | (exec-path . ignore) | ||
| 539 | (expand-file-name . tramp-gvfs-handle-expand-file-name) | 540 | (expand-file-name . tramp-gvfs-handle-expand-file-name) |
| 540 | (file-accessible-directory-p . tramp-handle-file-accessible-directory-p) | 541 | (file-accessible-directory-p . tramp-handle-file-accessible-directory-p) |
| 541 | (file-acl . ignore) | 542 | (file-acl . ignore) |
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 76dae9cea5e..0b3c12333f2 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -990,6 +990,7 @@ of command line.") | |||
| 990 | . tramp-sh-handle-directory-files-and-attributes) | 990 | . tramp-sh-handle-directory-files-and-attributes) |
| 991 | (dired-compress-file . tramp-sh-handle-dired-compress-file) | 991 | (dired-compress-file . tramp-sh-handle-dired-compress-file) |
| 992 | (dired-uncache . tramp-handle-dired-uncache) | 992 | (dired-uncache . tramp-handle-dired-uncache) |
| 993 | (exec-path . tramp-sh-handle-exec-path) | ||
| 993 | (expand-file-name . tramp-sh-handle-expand-file-name) | 994 | (expand-file-name . tramp-sh-handle-expand-file-name) |
| 994 | (file-accessible-directory-p . tramp-handle-file-accessible-directory-p) | 995 | (file-accessible-directory-p . tramp-handle-file-accessible-directory-p) |
| 995 | (file-acl . tramp-sh-handle-file-acl) | 996 | (file-acl . tramp-sh-handle-file-acl) |
| @@ -3083,6 +3084,13 @@ the result will be a local, non-Tramp, file name." | |||
| 3083 | (keyboard-quit) | 3084 | (keyboard-quit) |
| 3084 | ret)))) | 3085 | ret)))) |
| 3085 | 3086 | ||
| 3087 | (defun tramp-sh-handle-exec-path () | ||
| 3088 | "Like `exec-path' for Tramp files." | ||
| 3089 | (append | ||
| 3090 | (tramp-get-remote-path (tramp-dissect-file-name default-directory)) | ||
| 3091 | ;; The equivalent to `exec-directory'. | ||
| 3092 | `(,(file-local-name default-directory)))) | ||
| 3093 | |||
| 3086 | (defun tramp-sh-handle-file-local-copy (filename) | 3094 | (defun tramp-sh-handle-file-local-copy (filename) |
| 3087 | "Like `file-local-copy' for Tramp files." | 3095 | "Like `file-local-copy' for Tramp files." |
| 3088 | (with-parsed-tramp-file-name filename nil | 3096 | (with-parsed-tramp-file-name filename nil |
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 0334f052a07..335f05cfce0 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el | |||
| @@ -229,6 +229,7 @@ See `tramp-actions-before-shell' for more info.") | |||
| 229 | . tramp-handle-directory-files-and-attributes) | 229 | . tramp-handle-directory-files-and-attributes) |
| 230 | (dired-compress-file . ignore) | 230 | (dired-compress-file . ignore) |
| 231 | (dired-uncache . tramp-handle-dired-uncache) | 231 | (dired-uncache . tramp-handle-dired-uncache) |
| 232 | (exec-path . ignore) | ||
| 232 | (expand-file-name . tramp-smb-handle-expand-file-name) | 233 | (expand-file-name . tramp-smb-handle-expand-file-name) |
| 233 | (file-accessible-directory-p . tramp-handle-file-accessible-directory-p) | 234 | (file-accessible-directory-p . tramp-handle-file-accessible-directory-p) |
| 234 | (file-acl . tramp-smb-handle-file-acl) | 235 | (file-acl . tramp-smb-handle-file-acl) |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 1d6e0146c4d..d56b09a604d 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -2163,7 +2163,9 @@ ARGS are the arguments OPERATION has been called with." | |||
| 2163 | ((member operation | 2163 | ((member operation |
| 2164 | '(process-file shell-command start-file-process | 2164 | '(process-file shell-command start-file-process |
| 2165 | ;; Emacs 26+ only. | 2165 | ;; Emacs 26+ only. |
| 2166 | make-nearby-temp-file temporary-file-directory)) | 2166 | make-nearby-temp-file temporary-file-directory |
| 2167 | ;; Emacs 27+ only. | ||
| 2168 | exec-path)) | ||
| 2167 | default-directory) | 2169 | default-directory) |
| 2168 | ;; PROC. | 2170 | ;; PROC. |
| 2169 | ((member operation | 2171 | ((member operation |
| @@ -4616,19 +4618,9 @@ Only works for Bourne-like shells." | |||
| 4616 | ;; when `default-directory' points to another host. | 4618 | ;; when `default-directory' points to another host. |
| 4617 | (defun tramp-eshell-directory-change () | 4619 | (defun tramp-eshell-directory-change () |
| 4618 | "Set `eshell-path-env' to $PATH of the host related to `default-directory'." | 4620 | "Set `eshell-path-env' to $PATH of the host related to `default-directory'." |
| 4621 | ;; Remove last element of `(exec-path)', which is `exec-directory'. | ||
| 4619 | (setq eshell-path-env | 4622 | (setq eshell-path-env |
| 4620 | (if (tramp-tramp-file-p default-directory) | 4623 | (mapconcat 'identity (butlast (tramp-compat-exec-path)) ":"))) |
| 4621 | (with-parsed-tramp-file-name default-directory nil | ||
| 4622 | (mapconcat | ||
| 4623 | 'identity | ||
| 4624 | (or | ||
| 4625 | ;; When `tramp-own-remote-path' is in `tramp-remote-path', | ||
| 4626 | ;; the remote path is only set in the session cache. | ||
| 4627 | (tramp-get-connection-property | ||
| 4628 | (tramp-get-connection-process v) "remote-path" nil) | ||
| 4629 | (tramp-get-connection-property v "remote-path" nil)) | ||
| 4630 | ":")) | ||
| 4631 | (getenv "PATH")))) | ||
| 4632 | 4624 | ||
| 4633 | (eval-after-load "esh-util" | 4625 | (eval-after-load "esh-util" |
| 4634 | '(progn | 4626 | '(progn |
diff --git a/lisp/shell.el b/lisp/shell.el index 232186083d5..91c65ed171e 100644 --- a/lisp/shell.el +++ b/lisp/shell.el | |||
| @@ -468,6 +468,8 @@ Shell buffers. It implements `shell-completion-execonly' for | |||
| 468 | (set (make-local-variable 'comint-file-name-chars) shell-file-name-chars) | 468 | (set (make-local-variable 'comint-file-name-chars) shell-file-name-chars) |
| 469 | (set (make-local-variable 'comint-file-name-quote-list) | 469 | (set (make-local-variable 'comint-file-name-quote-list) |
| 470 | shell-file-name-quote-list) | 470 | shell-file-name-quote-list) |
| 471 | (set (make-local-variable 'comint-file-name-prefix) | ||
| 472 | (file-remote-p default-directory)) | ||
| 471 | (set (make-local-variable 'comint-dynamic-complete-functions) | 473 | (set (make-local-variable 'comint-dynamic-complete-functions) |
| 472 | shell-dynamic-complete-functions) | 474 | shell-dynamic-complete-functions) |
| 473 | (setq-local comint-unquote-function #'shell--unquote-argument) | 475 | (setq-local comint-unquote-function #'shell--unquote-argument) |
| @@ -1170,9 +1172,12 @@ Returns t if successful." | |||
| 1170 | (start (if (zerop (length filename)) (point) (match-beginning 0))) | 1172 | (start (if (zerop (length filename)) (point) (match-beginning 0))) |
| 1171 | (end (if (zerop (length filename)) (point) (match-end 0))) | 1173 | (end (if (zerop (length filename)) (point) (match-end 0))) |
| 1172 | (filenondir (file-name-nondirectory filename)) | 1174 | (filenondir (file-name-nondirectory filename)) |
| 1173 | ; why cdr? see `shell-dynamic-complete-command' | 1175 | (path-dirs |
| 1174 | (path-dirs (append (cdr (reverse exec-path)) | 1176 | ;; Ignore `exec-directory', the last entry in `exec-path'. |
| 1175 | (if (memq system-type '(windows-nt ms-dos)) '(".")))) | 1177 | (append (cdr (reverse (exec-path))) |
| 1178 | (if (and (memq system-type '(windows-nt ms-dos)) | ||
| 1179 | (not (file-remote-p default-directory))) | ||
| 1180 | '(".")))) | ||
| 1176 | (cwd (file-name-as-directory (expand-file-name default-directory))) | 1181 | (cwd (file-name-as-directory (expand-file-name default-directory))) |
| 1177 | (ignored-extensions | 1182 | (ignored-extensions |
| 1178 | (and comint-completion-fignore | 1183 | (and comint-completion-fignore |
diff --git a/test/lisp/net/tramp-archive-tests.el b/test/lisp/net/tramp-archive-tests.el index b327e64818b..0a8716be0d7 100644 --- a/test/lisp/net/tramp-archive-tests.el +++ b/test/lisp/net/tramp-archive-tests.el | |||
| @@ -748,7 +748,7 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'." | |||
| 748 | (tramp-archive-cleanup-hash)))) | 748 | (tramp-archive-cleanup-hash)))) |
| 749 | 749 | ||
| 750 | ;; The functions were introduced in Emacs 26.1. | 750 | ;; The functions were introduced in Emacs 26.1. |
| 751 | (ert-deftest tramp-archive-test37-make-nearby-temp-file () | 751 | (ert-deftest tramp-archive-test38-make-nearby-temp-file () |
| 752 | "Check `make-nearby-temp-file' and `temporary-file-directory'." | 752 | "Check `make-nearby-temp-file' and `temporary-file-directory'." |
| 753 | (skip-unless tramp-archive-enabled) | 753 | (skip-unless tramp-archive-enabled) |
| 754 | ;; Since Emacs 26.1. | 754 | ;; Since Emacs 26.1. |
| @@ -785,7 +785,7 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'." | |||
| 785 | (delete-directory tmp-file) | 785 | (delete-directory tmp-file) |
| 786 | (should-not (file-exists-p tmp-file)))) | 786 | (should-not (file-exists-p tmp-file)))) |
| 787 | 787 | ||
| 788 | (ert-deftest tramp-archive-test40-file-system-info () | 788 | (ert-deftest tramp-archive-test41-file-system-info () |
| 789 | "Check that `file-system-info' returns proper values." | 789 | "Check that `file-system-info' returns proper values." |
| 790 | (skip-unless tramp-archive-enabled) | 790 | (skip-unless tramp-archive-enabled) |
| 791 | ;; Since Emacs 27.1. | 791 | ;; Since Emacs 27.1. |
| @@ -802,7 +802,7 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'." | |||
| 802 | (zerop (nth 1 fsi)) | 802 | (zerop (nth 1 fsi)) |
| 803 | (zerop (nth 2 fsi)))))) | 803 | (zerop (nth 2 fsi)))))) |
| 804 | 804 | ||
| 805 | (ert-deftest tramp-archive-test42-auto-load () | 805 | (ert-deftest tramp-archive-test43-auto-load () |
| 806 | "Check that `tramp-archive' autoloads properly." | 806 | "Check that `tramp-archive' autoloads properly." |
| 807 | (skip-unless tramp-archive-enabled) | 807 | (skip-unless tramp-archive-enabled) |
| 808 | ;; Autoloading tramp-archive works since Emacs 27.1. | 808 | ;; Autoloading tramp-archive works since Emacs 27.1. |
| @@ -832,7 +832,7 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'." | |||
| 832 | (mapconcat 'shell-quote-argument load-path " -L ") | 832 | (mapconcat 'shell-quote-argument load-path " -L ") |
| 833 | (shell-quote-argument (format code file))))))))) | 833 | (shell-quote-argument (format code file))))))))) |
| 834 | 834 | ||
| 835 | (ert-deftest tramp-archive-test42-delay-load () | 835 | (ert-deftest tramp-archive-test43-delay-load () |
| 836 | "Check that `tramp-archive' is loaded lazily, only when needed." | 836 | "Check that `tramp-archive' is loaded lazily, only when needed." |
| 837 | (skip-unless tramp-archive-enabled) | 837 | (skip-unless tramp-archive-enabled) |
| 838 | ;; Autoloading tramp-archive works since Emacs 27.1. | 838 | ;; Autoloading tramp-archive works since Emacs 27.1. |
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index c5cb4cb43eb..df07a8f1b89 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -33,7 +33,7 @@ | |||
| 33 | ;; remote host, set this environment variable to "/dev/null" or | 33 | ;; remote host, set this environment variable to "/dev/null" or |
| 34 | ;; whatever is appropriate on your system. | 34 | ;; whatever is appropriate on your system. |
| 35 | 35 | ||
| 36 | ;; For slow remote connections, `tramp-test41-asynchronous-requests' | 36 | ;; For slow remote connections, `tramp-test42-asynchronous-requests' |
| 37 | ;; might be too heavy. Setting $REMOTE_PARALLEL_PROCESSES to a proper | 37 | ;; might be too heavy. Setting $REMOTE_PARALLEL_PROCESSES to a proper |
| 38 | ;; value less than 10 could help. | 38 | ;; value less than 10 could help. |
| 39 | 39 | ||
| @@ -4021,7 +4021,45 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 4021 | (put 'explicit-shell-file-name 'permanent-local nil) | 4021 | (put 'explicit-shell-file-name 'permanent-local nil) |
| 4022 | (kill-buffer "*shell*")))) | 4022 | (kill-buffer "*shell*")))) |
| 4023 | 4023 | ||
| 4024 | (ert-deftest tramp-test34-vc-registered () | 4024 | ;; The function was introduced in Emacs 27.1. |
| 4025 | (ert-deftest tramp-test34-exec-path () | ||
| 4026 | "Check `exec-path' and `executable-find'." | ||
| 4027 | (skip-unless (tramp--test-enabled)) | ||
| 4028 | (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p))) | ||
| 4029 | ;; Since Emacs 27.1. | ||
| 4030 | (skip-unless (boundp 'exec-path)) | ||
| 4031 | |||
| 4032 | (let ((tmp-name (tramp--test-make-temp-name)) | ||
| 4033 | (default-directory tramp-test-temporary-file-directory)) | ||
| 4034 | (unwind-protect | ||
| 4035 | (progn | ||
| 4036 | (should (consp (with-no-warnings (exec-path)))) | ||
| 4037 | ;; Last element is the `exec-directory'. | ||
| 4038 | (should | ||
| 4039 | (string-equal | ||
| 4040 | (car (last (with-no-warnings (exec-path)))) | ||
| 4041 | (file-local-name default-directory))) | ||
| 4042 | ;; The shell "sh" shall always exist. | ||
| 4043 | (should (executable-find "sh" 'remote)) | ||
| 4044 | ;; Since the last element in `exec-path' is the current | ||
| 4045 | ;; directory, an executable file in that directory will be | ||
| 4046 | ;; found. | ||
| 4047 | (write-region "foo" nil tmp-name) | ||
| 4048 | (should (file-exists-p tmp-name)) | ||
| 4049 | (set-file-modes tmp-name #o777) | ||
| 4050 | (should (file-executable-p tmp-name)) | ||
| 4051 | (should | ||
| 4052 | (string-equal | ||
| 4053 | (executable-find (file-name-nondirectory tmp-name) 'remote) | ||
| 4054 | (file-local-name tmp-name))) | ||
| 4055 | (should-not | ||
| 4056 | (executable-find | ||
| 4057 | (concat (file-name-nondirectory tmp-name) "foo") 'remote))) | ||
| 4058 | |||
| 4059 | ;; Cleanup. | ||
| 4060 | (ignore-errors (delete-file tmp-name))))) | ||
| 4061 | |||
| 4062 | (ert-deftest tramp-test35-vc-registered () | ||
| 4025 | "Check `vc-registered'." | 4063 | "Check `vc-registered'." |
| 4026 | :tags '(:expensive-test) | 4064 | :tags '(:expensive-test) |
| 4027 | (skip-unless (tramp--test-enabled)) | 4065 | (skip-unless (tramp--test-enabled)) |
| @@ -4091,7 +4129,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 4091 | ;; Cleanup. | 4129 | ;; Cleanup. |
| 4092 | (ignore-errors (delete-directory tmp-name1 'recursive)))))) | 4130 | (ignore-errors (delete-directory tmp-name1 'recursive)))))) |
| 4093 | 4131 | ||
| 4094 | (ert-deftest tramp-test35-make-auto-save-file-name () | 4132 | (ert-deftest tramp-test36-make-auto-save-file-name () |
| 4095 | "Check `make-auto-save-file-name'." | 4133 | "Check `make-auto-save-file-name'." |
| 4096 | (skip-unless (tramp--test-enabled)) | 4134 | (skip-unless (tramp--test-enabled)) |
| 4097 | 4135 | ||
| @@ -4182,7 +4220,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 4182 | (ignore-errors (delete-file tmp-name1)) | 4220 | (ignore-errors (delete-file tmp-name1)) |
| 4183 | (ignore-errors (delete-directory tmp-name2 'recursive)))))) | 4221 | (ignore-errors (delete-directory tmp-name2 'recursive)))))) |
| 4184 | 4222 | ||
| 4185 | (ert-deftest tramp-test36-find-backup-file-name () | 4223 | (ert-deftest tramp-test37-find-backup-file-name () |
| 4186 | "Check `find-backup-file-name'." | 4224 | "Check `find-backup-file-name'." |
| 4187 | (skip-unless (tramp--test-enabled)) | 4225 | (skip-unless (tramp--test-enabled)) |
| 4188 | 4226 | ||
| @@ -4293,7 +4331,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 4293 | (ignore-errors (delete-directory tmp-name2 'recursive)))))) | 4331 | (ignore-errors (delete-directory tmp-name2 'recursive)))))) |
| 4294 | 4332 | ||
| 4295 | ;; The functions were introduced in Emacs 26.1. | 4333 | ;; The functions were introduced in Emacs 26.1. |
| 4296 | (ert-deftest tramp-test37-make-nearby-temp-file () | 4334 | (ert-deftest tramp-test38-make-nearby-temp-file () |
| 4297 | "Check `make-nearby-temp-file' and `temporary-file-directory'." | 4335 | "Check `make-nearby-temp-file' and `temporary-file-directory'." |
| 4298 | (skip-unless (tramp--test-enabled)) | 4336 | (skip-unless (tramp--test-enabled)) |
| 4299 | ;; Since Emacs 26.1. | 4337 | ;; Since Emacs 26.1. |
| @@ -4586,7 +4624,7 @@ This requires restrictions of file name syntax." | |||
| 4586 | (ignore-errors (delete-directory tmp-name2 'recursive)))))) | 4624 | (ignore-errors (delete-directory tmp-name2 'recursive)))))) |
| 4587 | 4625 | ||
| 4588 | (defun tramp--test-special-characters () | 4626 | (defun tramp--test-special-characters () |
| 4589 | "Perform the test in `tramp-test38-special-characters*'." | 4627 | "Perform the test in `tramp-test39-special-characters*'." |
| 4590 | ;; Newlines, slashes and backslashes in file names are not | 4628 | ;; Newlines, slashes and backslashes in file names are not |
| 4591 | ;; supported. So we don't test. And we don't test the tab | 4629 | ;; supported. So we don't test. And we don't test the tab |
| 4592 | ;; character on Windows or Cygwin, because the backslash is | 4630 | ;; character on Windows or Cygwin, because the backslash is |
| @@ -4634,7 +4672,7 @@ This requires restrictions of file name syntax." | |||
| 4634 | files (list (mapconcat 'identity files "")))))) | 4672 | files (list (mapconcat 'identity files "")))))) |
| 4635 | 4673 | ||
| 4636 | ;; These tests are inspired by Bug#17238. | 4674 | ;; These tests are inspired by Bug#17238. |
| 4637 | (ert-deftest tramp-test38-special-characters () | 4675 | (ert-deftest tramp-test39-special-characters () |
| 4638 | "Check special characters in file names." | 4676 | "Check special characters in file names." |
| 4639 | (skip-unless (tramp--test-enabled)) | 4677 | (skip-unless (tramp--test-enabled)) |
| 4640 | (skip-unless (not (tramp--test-rsync-p))) | 4678 | (skip-unless (not (tramp--test-rsync-p))) |
| @@ -4642,7 +4680,7 @@ This requires restrictions of file name syntax." | |||
| 4642 | 4680 | ||
| 4643 | (tramp--test-special-characters)) | 4681 | (tramp--test-special-characters)) |
| 4644 | 4682 | ||
| 4645 | (ert-deftest tramp-test38-special-characters-with-stat () | 4683 | (ert-deftest tramp-test39-special-characters-with-stat () |
| 4646 | "Check special characters in file names. | 4684 | "Check special characters in file names. |
| 4647 | Use the `stat' command." | 4685 | Use the `stat' command." |
| 4648 | :tags '(:expensive-test) | 4686 | :tags '(:expensive-test) |
| @@ -4660,7 +4698,7 @@ Use the `stat' command." | |||
| 4660 | tramp-connection-properties))) | 4698 | tramp-connection-properties))) |
| 4661 | (tramp--test-special-characters))) | 4699 | (tramp--test-special-characters))) |
| 4662 | 4700 | ||
| 4663 | (ert-deftest tramp-test38-special-characters-with-perl () | 4701 | (ert-deftest tramp-test39-special-characters-with-perl () |
| 4664 | "Check special characters in file names. | 4702 | "Check special characters in file names. |
| 4665 | Use the `perl' command." | 4703 | Use the `perl' command." |
| 4666 | :tags '(:expensive-test) | 4704 | :tags '(:expensive-test) |
| @@ -4681,7 +4719,7 @@ Use the `perl' command." | |||
| 4681 | tramp-connection-properties))) | 4719 | tramp-connection-properties))) |
| 4682 | (tramp--test-special-characters))) | 4720 | (tramp--test-special-characters))) |
| 4683 | 4721 | ||
| 4684 | (ert-deftest tramp-test38-special-characters-with-ls () | 4722 | (ert-deftest tramp-test39-special-characters-with-ls () |
| 4685 | "Check special characters in file names. | 4723 | "Check special characters in file names. |
| 4686 | Use the `ls' command." | 4724 | Use the `ls' command." |
| 4687 | :tags '(:expensive-test) | 4725 | :tags '(:expensive-test) |
| @@ -4704,7 +4742,7 @@ Use the `ls' command." | |||
| 4704 | (tramp--test-special-characters))) | 4742 | (tramp--test-special-characters))) |
| 4705 | 4743 | ||
| 4706 | (defun tramp--test-utf8 () | 4744 | (defun tramp--test-utf8 () |
| 4707 | "Perform the test in `tramp-test39-utf8*'." | 4745 | "Perform the test in `tramp-test40-utf8*'." |
| 4708 | (let* ((utf8 (if (and (eq system-type 'darwin) | 4746 | (let* ((utf8 (if (and (eq system-type 'darwin) |
| 4709 | (memq 'utf-8-hfs (coding-system-list))) | 4747 | (memq 'utf-8-hfs (coding-system-list))) |
| 4710 | 'utf-8-hfs 'utf-8)) | 4748 | 'utf-8-hfs 'utf-8)) |
| @@ -4739,7 +4777,7 @@ Use the `ls' command." | |||
| 4739 | (replace-regexp-in-string "[\t\n/.?]" "" x))) | 4777 | (replace-regexp-in-string "[\t\n/.?]" "" x))) |
| 4740 | language-info-alist))))))) | 4778 | language-info-alist))))))) |
| 4741 | 4779 | ||
| 4742 | (ert-deftest tramp-test39-utf8 () | 4780 | (ert-deftest tramp-test40-utf8 () |
| 4743 | "Check UTF8 encoding in file names and file contents." | 4781 | "Check UTF8 encoding in file names and file contents." |
| 4744 | (skip-unless (tramp--test-enabled)) | 4782 | (skip-unless (tramp--test-enabled)) |
| 4745 | (skip-unless (not (tramp--test-docker-p))) | 4783 | (skip-unless (not (tramp--test-docker-p))) |
| @@ -4749,7 +4787,7 @@ Use the `ls' command." | |||
| 4749 | 4787 | ||
| 4750 | (tramp--test-utf8)) | 4788 | (tramp--test-utf8)) |
| 4751 | 4789 | ||
| 4752 | (ert-deftest tramp-test39-utf8-with-stat () | 4790 | (ert-deftest tramp-test40-utf8-with-stat () |
| 4753 | "Check UTF8 encoding in file names and file contents. | 4791 | "Check UTF8 encoding in file names and file contents. |
| 4754 | Use the `stat' command." | 4792 | Use the `stat' command." |
| 4755 | :tags '(:expensive-test) | 4793 | :tags '(:expensive-test) |
| @@ -4769,7 +4807,7 @@ Use the `stat' command." | |||
| 4769 | tramp-connection-properties))) | 4807 | tramp-connection-properties))) |
| 4770 | (tramp--test-utf8))) | 4808 | (tramp--test-utf8))) |
| 4771 | 4809 | ||
| 4772 | (ert-deftest tramp-test39-utf8-with-perl () | 4810 | (ert-deftest tramp-test40-utf8-with-perl () |
| 4773 | "Check UTF8 encoding in file names and file contents. | 4811 | "Check UTF8 encoding in file names and file contents. |
| 4774 | Use the `perl' command." | 4812 | Use the `perl' command." |
| 4775 | :tags '(:expensive-test) | 4813 | :tags '(:expensive-test) |
| @@ -4792,7 +4830,7 @@ Use the `perl' command." | |||
| 4792 | tramp-connection-properties))) | 4830 | tramp-connection-properties))) |
| 4793 | (tramp--test-utf8))) | 4831 | (tramp--test-utf8))) |
| 4794 | 4832 | ||
| 4795 | (ert-deftest tramp-test39-utf8-with-ls () | 4833 | (ert-deftest tramp-test40-utf8-with-ls () |
| 4796 | "Check UTF8 encoding in file names and file contents. | 4834 | "Check UTF8 encoding in file names and file contents. |
| 4797 | Use the `ls' command." | 4835 | Use the `ls' command." |
| 4798 | :tags '(:expensive-test) | 4836 | :tags '(:expensive-test) |
| @@ -4815,7 +4853,7 @@ Use the `ls' command." | |||
| 4815 | tramp-connection-properties))) | 4853 | tramp-connection-properties))) |
| 4816 | (tramp--test-utf8))) | 4854 | (tramp--test-utf8))) |
| 4817 | 4855 | ||
| 4818 | (ert-deftest tramp-test40-file-system-info () | 4856 | (ert-deftest tramp-test41-file-system-info () |
| 4819 | "Check that `file-system-info' returns proper values." | 4857 | "Check that `file-system-info' returns proper values." |
| 4820 | (skip-unless (tramp--test-enabled)) | 4858 | (skip-unless (tramp--test-enabled)) |
| 4821 | ;; Since Emacs 27.1. | 4859 | ;; Since Emacs 27.1. |
| @@ -4837,7 +4875,7 @@ Use the `ls' command." | |||
| 4837 | (ert-fail (format "`%s' timed out" (ert-test-name (ert-running-test))))) | 4875 | (ert-fail (format "`%s' timed out" (ert-test-name (ert-running-test))))) |
| 4838 | 4876 | ||
| 4839 | ;; This test is inspired by Bug#16928. | 4877 | ;; This test is inspired by Bug#16928. |
| 4840 | (ert-deftest tramp-test41-asynchronous-requests () | 4878 | (ert-deftest tramp-test42-asynchronous-requests () |
| 4841 | "Check parallel asynchronous requests. | 4879 | "Check parallel asynchronous requests. |
| 4842 | Such requests could arrive from timers, process filters and | 4880 | Such requests could arrive from timers, process filters and |
| 4843 | process sentinels. They shall not disturb each other." | 4881 | process sentinels. They shall not disturb each other." |
| @@ -5012,7 +5050,7 @@ process sentinels. They shall not disturb each other." | |||
| 5012 | (ignore-errors (delete-directory tmp-name 'recursive))))))) | 5050 | (ignore-errors (delete-directory tmp-name 'recursive))))))) |
| 5013 | 5051 | ||
| 5014 | ;; This test is inspired by Bug#29163. | 5052 | ;; This test is inspired by Bug#29163. |
| 5015 | (ert-deftest tramp-test42-auto-load () | 5053 | (ert-deftest tramp-test43-auto-load () |
| 5016 | "Check that Tramp autoloads properly." | 5054 | "Check that Tramp autoloads properly." |
| 5017 | (let ((default-directory (expand-file-name temporary-file-directory)) | 5055 | (let ((default-directory (expand-file-name temporary-file-directory)) |
| 5018 | (code | 5056 | (code |
| @@ -5030,7 +5068,7 @@ process sentinels. They shall not disturb each other." | |||
| 5030 | (mapconcat 'shell-quote-argument load-path " -L ") | 5068 | (mapconcat 'shell-quote-argument load-path " -L ") |
| 5031 | (shell-quote-argument code))))))) | 5069 | (shell-quote-argument code))))))) |
| 5032 | 5070 | ||
| 5033 | (ert-deftest tramp-test42-delay-load () | 5071 | (ert-deftest tramp-test43-delay-load () |
| 5034 | "Check that Tramp is loaded lazily, only when needed." | 5072 | "Check that Tramp is loaded lazily, only when needed." |
| 5035 | ;; The autoloaded Tramp objects are different since Emacs 26.1. We | 5073 | ;; The autoloaded Tramp objects are different since Emacs 26.1. We |
| 5036 | ;; cannot test older Emacsen, therefore. | 5074 | ;; cannot test older Emacsen, therefore. |
| @@ -5063,7 +5101,7 @@ process sentinels. They shall not disturb each other." | |||
| 5063 | (mapconcat 'shell-quote-argument load-path " -L ") | 5101 | (mapconcat 'shell-quote-argument load-path " -L ") |
| 5064 | (shell-quote-argument (format code tm))))))))) | 5102 | (shell-quote-argument (format code tm))))))))) |
| 5065 | 5103 | ||
| 5066 | (ert-deftest tramp-test42-recursive-load () | 5104 | (ert-deftest tramp-test43-recursive-load () |
| 5067 | "Check that Tramp does not fail due to recursive load." | 5105 | "Check that Tramp does not fail due to recursive load." |
| 5068 | (skip-unless (tramp--test-enabled)) | 5106 | (skip-unless (tramp--test-enabled)) |
| 5069 | 5107 | ||
| @@ -5087,7 +5125,7 @@ process sentinels. They shall not disturb each other." | |||
| 5087 | (mapconcat 'shell-quote-argument load-path " -L ") | 5125 | (mapconcat 'shell-quote-argument load-path " -L ") |
| 5088 | (shell-quote-argument code)))))))) | 5126 | (shell-quote-argument code)))))))) |
| 5089 | 5127 | ||
| 5090 | (ert-deftest tramp-test42-remote-load-path () | 5128 | (ert-deftest tramp-test43-remote-load-path () |
| 5091 | "Check that Tramp autoloads its packages with remote `load-path'." | 5129 | "Check that Tramp autoloads its packages with remote `load-path'." |
| 5092 | ;; The autoloaded Tramp objects are different since Emacs 26.1. We | 5130 | ;; The autoloaded Tramp objects are different since Emacs 26.1. We |
| 5093 | ;; cannot test older Emacsen, therefore. | 5131 | ;; cannot test older Emacsen, therefore. |
| @@ -5115,7 +5153,7 @@ process sentinels. They shall not disturb each other." | |||
| 5115 | (mapconcat 'shell-quote-argument load-path " -L ") | 5153 | (mapconcat 'shell-quote-argument load-path " -L ") |
| 5116 | (shell-quote-argument code))))))) | 5154 | (shell-quote-argument code))))))) |
| 5117 | 5155 | ||
| 5118 | (ert-deftest tramp-test43-unload () | 5156 | (ert-deftest tramp-test44-unload () |
| 5119 | "Check that Tramp and its subpackages unload completely. | 5157 | "Check that Tramp and its subpackages unload completely. |
| 5120 | Since it unloads Tramp, it shall be the last test to run." | 5158 | Since it unloads Tramp, it shall be the last test to run." |
| 5121 | :tags '(:expensive-test) | 5159 | :tags '(:expensive-test) |
| @@ -5176,14 +5214,14 @@ Since it unloads Tramp, it shall be the last test to run." | |||
| 5176 | ;; * file-name-case-insensitive-p | 5214 | ;; * file-name-case-insensitive-p |
| 5177 | 5215 | ||
| 5178 | ;; * Work on skipped tests. Make a comment, when it is impossible. | 5216 | ;; * Work on skipped tests. Make a comment, when it is impossible. |
| 5179 | ;; * Revisit expensive tests, once problems in tramp-error are solved. | 5217 | ;; * Revisit expensive tests, once problems in `tramp-error' are solved. |
| 5180 | ;; * Fix `tramp-test05-expand-file-name-relative' in `expand-file-name'. | 5218 | ;; * Fix `tramp-test05-expand-file-name-relative' in `expand-file-name'. |
| 5181 | ;; * Fix `tramp-test06-directory-file-name' for `ftp'. | 5219 | ;; * Fix `tramp-test06-directory-file-name' for `ftp'. |
| 5182 | ;; * Investigate, why `tramp-test11-copy-file' and `tramp-test12-rename-file' | 5220 | ;; * Investigate, why `tramp-test11-copy-file' and `tramp-test12-rename-file' |
| 5183 | ;; do not work properly for `owncloud'. | 5221 | ;; do not work properly for `owncloud'. |
| 5184 | ;; * Fix `tramp-test29-start-file-process' on MS Windows (`process-send-eof'?). | 5222 | ;; * Fix `tramp-test29-start-file-process' on MS Windows (`process-send-eof'?). |
| 5185 | ;; * Fix `tramp-test30-interrupt-process', timeout doesn't work reliably. | 5223 | ;; * Fix `tramp-test30-interrupt-process', timeout doesn't work reliably. |
| 5186 | ;; * Fix Bug#16928 in `tramp-test41-asynchronous-requests'. | 5224 | ;; * Fix Bug#16928 in `tramp-test42-asynchronous-requests'. |
| 5187 | 5225 | ||
| 5188 | (provide 'tramp-tests) | 5226 | (provide 'tramp-tests) |
| 5189 | ;;; tramp-tests.el ends here | 5227 | ;;; tramp-tests.el ends here |