diff options
| author | Michael Albinus | 2019-11-13 13:10:58 +0100 |
|---|---|---|
| committer | Michael Albinus | 2019-11-13 13:10:58 +0100 |
| commit | d3438460ef2e41815b01632781bfc1e4697f70eb (patch) | |
| tree | 907b2fa31d8f98ec3ac79dc3119ffaf4a4e62720 | |
| parent | bf7debec3b2cdc4a5bc00c62046a6cb24c3f32af (diff) | |
| download | emacs-d3438460ef2e41815b01632781bfc1e4697f70eb.tar.gz emacs-d3438460ef2e41815b01632781bfc1e4697f70eb.zip | |
Adapt Tramp docstrings according to checkdoc
* lisp/net/tramp.el (tramp-backup-directory-alist)
(tramp-echoed-echo-mark-regexp, tramp-syntax-values)
(tramp-lookup-syntax, tramp-build-prefix-format)
(tramp-build-prefix-regexp, tramp-build-method-regexp)
(tramp-build-postfix-method-format)
(tramp-build-postfix-method-regexp)
(tramp-build-prefix-ipv6-format, tramp-build-prefix-ipv6-regexp)
(tramp-build-postfix-ipv6-format)
(tramp-build-postfix-ipv6-regexp)
(tramp-build-postfix-host-format)
(tramp-build-postfix-host-regexp, tramp-unknown-id-string)
(tramp-unknown-id-integer, tramp-build-file-name-regexp)
(tramp-build-completion-file-name-regexp, tramp-chunksize)
(tramp-find-method, tramp-find-user, tramp-find-host)
(tramp-dissect-file-name, tramp-get-buffer)
(tramp-get-connection-buffer, tramp-debug-message, tramp-error)
(with-tramp-connection-property, tramp-run-real-handler)
(tramp-file-name-for-operation, tramp-file-name-handler)
(tramp-completion-file-name-handler)
(tramp-completion-handle-file-name-completion)
(tramp-completion-dissect-file-name)
(tramp-completion-dissect-file-name1)
(tramp-handle-file-name-as-directory)
(tramp-handle-file-name-directory)
(tramp-handle-file-name-nondirectory, tramp-mode-string-to-int)
(tramp-file-mode-from-int):
* lisp/net/tramp-adb.el (tramp-adb-file-name-p):
* lisp/net/tramp-archive.el (tramp-archive-run-real-handler)
(tramp-archive-file-name-handler)
(tramp-archive-dissect-file-name)
(with-parsed-tramp-archive-file-name)
(tramp-archive-gvfs-file-name, tramp-archive-handle-access-file):
* lisp/net/tramp-cmds.el (tramp-list-remote-buffers):
* lisp/net/tramp-compat.el (tramp-unload-file-name-handlers)
(tramp-compat-funcall, tramp-compat-tramp-file-name-slots):
* lisp/net/tramp-ftp.el (tramp-ftp-file-name-handler)
(tramp-ftp-file-name-p):
* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-p)
(tramp-gvfs-file-name-handler)
(tramp-gvfs-stringify-dbus-message)
(tramp-gvfs-monitor-process-filter)
(tramp-gvfs-handler-mounted-unmounted):
* lisp/net/tramp-integration.el
(tramp-rfn-eshadow-update-overlay-regexp):
* lisp/net/tramp-rclone.el (tramp-rclone-file-name-p)
(tramp-rclone-file-name-handler, tramp-rclone-send-command):
* lisp/net/tramp-sh.el (tramp-sh--quoting-style-options)
(tramp-sh-gio-monitor-process-filter)
(tramp-sh-gvfs-monitor-dir-process-filter)
(tramp-sh-inotifywait-process-filter, tramp-find-executable)
(tramp-set-remote-path, tramp-open-shell, tramp-find-shell)
(tramp-send-command-and-check, tramp-shell-case-fold)
(tramp-get-remote-path):
* lisp/net/tramp-smb.el (tramp-smb-file-name-p)
(tramp-smb-file-name-handler)
(tramp-smb-do-file-attributes-with-stat)
(tramp-smb-handle-substitute-in-file-name)
(tramp-smb-get-stat-capability, tramp-smb-shell-quote-argument):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-p)
(tramp-sudoedit-file-name-handler)
(tramp-sudoedit-send-command-string):
* test/lisp/net/tramp-archive-tests.el (tramp-archive-test-all):
* test/lisp/net/tramp-tests.el (tramp--test-gvfs-p)
(tramp--test-with-proper-process-name-and-buffer)
(tramp-test-all): Adapt docstrings according to `checkdoc'.
| -rw-r--r-- | lisp/net/tramp-adb.el | 2 | ||||
| -rw-r--r-- | lisp/net/tramp-archive.el | 16 | ||||
| -rw-r--r-- | lisp/net/tramp-cache.el | 2 | ||||
| -rw-r--r-- | lisp/net/tramp-cmds.el | 2 | ||||
| -rw-r--r-- | lisp/net/tramp-compat.el | 5 | ||||
| -rw-r--r-- | lisp/net/tramp-ftp.el | 4 | ||||
| -rw-r--r-- | lisp/net/tramp-gvfs.el | 10 | ||||
| -rw-r--r-- | lisp/net/tramp-integration.el | 1 | ||||
| -rw-r--r-- | lisp/net/tramp-rclone.el | 7 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 29 | ||||
| -rw-r--r-- | lisp/net/tramp-smb.el | 12 | ||||
| -rw-r--r-- | lisp/net/tramp-sudoedit.el | 9 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 82 | ||||
| -rw-r--r-- | lisp/net/trampver.el | 5 | ||||
| -rw-r--r-- | test/lisp/net/tramp-archive-tests.el | 7 | ||||
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 7 |
16 files changed, 118 insertions, 82 deletions
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index cfbda0824e7..b56ffdd7bc0 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el | |||
| @@ -171,7 +171,7 @@ It is used for TCP/IP devices." | |||
| 171 | ;; tramp-loaddefs.el. Otherwise, there would be recursive autoloading. | 171 | ;; tramp-loaddefs.el. Otherwise, there would be recursive autoloading. |
| 172 | ;;;###tramp-autoload | 172 | ;;;###tramp-autoload |
| 173 | (defsubst tramp-adb-file-name-p (filename) | 173 | (defsubst tramp-adb-file-name-p (filename) |
| 174 | "Check if it's a filename for ADB." | 174 | "Check if it's a FILENAME for ADB." |
| 175 | (and (tramp-tramp-file-p filename) | 175 | (and (tramp-tramp-file-p filename) |
| 176 | (string= (tramp-file-name-method (tramp-dissect-file-name filename)) | 176 | (string= (tramp-file-name-method (tramp-dissect-file-name filename)) |
| 177 | tramp-adb-method))) | 177 | tramp-adb-method))) |
diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el index 84dba32cb62..1158b03b516 100644 --- a/lisp/net/tramp-archive.el +++ b/lisp/net/tramp-archive.el | |||
| @@ -295,8 +295,8 @@ Operations not mentioned here will be handled by the default Emacs primitives.") | |||
| 295 | 295 | ||
| 296 | (defun tramp-archive-run-real-handler (operation args) | 296 | (defun tramp-archive-run-real-handler (operation args) |
| 297 | "Invoke normal file name handler for OPERATION. | 297 | "Invoke normal file name handler for OPERATION. |
| 298 | First arg specifies the OPERATION, second arg is a list of arguments to | 298 | First arg specifies the OPERATION, second arg ARGS is a list of |
| 299 | pass to the OPERATION." | 299 | arguments to pass to the OPERATION." |
| 300 | (let* ((inhibit-file-name-handlers | 300 | (let* ((inhibit-file-name-handlers |
| 301 | `(tramp-archive-file-name-handler | 301 | `(tramp-archive-file-name-handler |
| 302 | . | 302 | . |
| @@ -308,8 +308,8 @@ pass to the OPERATION." | |||
| 308 | ;;;###tramp-autoload | 308 | ;;;###tramp-autoload |
| 309 | (defun tramp-archive-file-name-handler (operation &rest args) | 309 | (defun tramp-archive-file-name-handler (operation &rest args) |
| 310 | "Invoke the file archive related OPERATION. | 310 | "Invoke the file archive related OPERATION. |
| 311 | First arg specifies the OPERATION, second arg is a list of arguments to | 311 | First arg specifies the OPERATION, second arg ARGS is a list of |
| 312 | pass to the OPERATION." | 312 | arguments to pass to the OPERATION." |
| 313 | (if (not tramp-archive-enabled) | 313 | (if (not tramp-archive-enabled) |
| 314 | ;; Unregister `tramp-archive-file-name-handler'. | 314 | ;; Unregister `tramp-archive-file-name-handler'. |
| 315 | (progn | 315 | (progn |
| @@ -413,7 +413,7 @@ name of a local copy, if any.") | |||
| 413 | (url-hexify-string (tramp-gvfs-url-file-name archive))) | 413 | (url-hexify-string (tramp-gvfs-url-file-name archive))) |
| 414 | 414 | ||
| 415 | (defun tramp-archive-dissect-file-name (name) | 415 | (defun tramp-archive-dissect-file-name (name) |
| 416 | "Return a `tramp-file-name' structure. | 416 | "Return a `tramp-file-name' structure for NAME. |
| 417 | The structure consists of the `tramp-archive-method' method, the | 417 | The structure consists of the `tramp-archive-method' method, the |
| 418 | hexified archive name as host, and the localname. The archive | 418 | hexified archive name as host, and the localname. The archive |
| 419 | name is kept in slot `hop'" | 419 | name is kept in slot `hop'" |
| @@ -507,7 +507,7 @@ archive name is extracted from the hop part of the VEC structure." | |||
| 507 | (tramp-file-name-hop vec))) | 507 | (tramp-file-name-hop vec))) |
| 508 | 508 | ||
| 509 | (defmacro with-parsed-tramp-archive-file-name (filename var &rest body) | 509 | (defmacro with-parsed-tramp-archive-file-name (filename var &rest body) |
| 510 | "Parse an archive filename and make components available in the body. | 510 | "Parse an archive filename and make components available in the BODY. |
| 511 | This works exactly as `with-parsed-tramp-file-name' for the Tramp | 511 | This works exactly as `with-parsed-tramp-file-name' for the Tramp |
| 512 | file name structure returned by `tramp-archive-dissect-file-name'. | 512 | file name structure returned by `tramp-archive-dissect-file-name'. |
| 513 | A variable `foo-archive' (or `archive') will be bound to the | 513 | A variable `foo-archive' (or `archive') will be bound to the |
| @@ -533,7 +533,7 @@ offered." | |||
| 533 | ,@body))) | 533 | ,@body))) |
| 534 | 534 | ||
| 535 | (defun tramp-archive-gvfs-file-name (name) | 535 | (defun tramp-archive-gvfs-file-name (name) |
| 536 | "Return FILENAME in GVFS syntax." | 536 | "Return NAME in GVFS syntax." |
| 537 | (tramp-make-tramp-file-name | 537 | (tramp-make-tramp-file-name |
| 538 | (tramp-archive-dissect-file-name name) nil 'nohop)) | 538 | (tramp-archive-dissect-file-name name) nil 'nohop)) |
| 539 | 539 | ||
| @@ -541,7 +541,7 @@ offered." | |||
| 541 | ;; File name primitives. | 541 | ;; File name primitives. |
| 542 | 542 | ||
| 543 | (defun tramp-archive-handle-access-file (filename string) | 543 | (defun tramp-archive-handle-access-file (filename string) |
| 544 | "Like `access-file' for Tramp files." | 544 | "Like `access-file' for file archives." |
| 545 | (access-file (tramp-archive-gvfs-file-name filename) string)) | 545 | (access-file (tramp-archive-gvfs-file-name filename) string)) |
| 546 | 546 | ||
| 547 | (defun tramp-archive-handle-copy-file | 547 | (defun tramp-archive-handle-copy-file |
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index 0f7e14b704a..ae3fdcb777f 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el | |||
| @@ -28,7 +28,7 @@ | |||
| 28 | ;; An implementation of information caching for remote files. | 28 | ;; An implementation of information caching for remote files. |
| 29 | 29 | ||
| 30 | ;; Each connection, identified by a `tramp-file-name' structure or by | 30 | ;; Each connection, identified by a `tramp-file-name' structure or by |
| 31 | ;; a process, has a unique cache. We distinguish 4 kind of caches, | 31 | ;; a process, has a unique cache. We distinguish 4 kind of caches, |
| 32 | ;; depending on the key: | 32 | ;; depending on the key: |
| 33 | ;; | 33 | ;; |
| 34 | ;; - localname is NIL. This are reusable properties. Examples: | 34 | ;; - localname is NIL. This are reusable properties. Examples: |
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index 35bb85b82d9..56ccf738070 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el | |||
| @@ -60,7 +60,7 @@ SYNTAX can be one of the symbols `default' (default), | |||
| 60 | "*debug tramp" (mapcar #'list (mapcar #'buffer-name (buffer-list)))))) | 60 | "*debug tramp" (mapcar #'list (mapcar #'buffer-name (buffer-list)))))) |
| 61 | 61 | ||
| 62 | (defun tramp-list-remote-buffers () | 62 | (defun tramp-list-remote-buffers () |
| 63 | "Return a list of all buffers with remote default-directory." | 63 | "Return a list of all buffers with remote `default-directory'." |
| 64 | (delq | 64 | (delq |
| 65 | nil | 65 | nil |
| 66 | (mapcar | 66 | (mapcar |
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 232230f8697..1c414372207 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el | |||
| @@ -32,7 +32,7 @@ | |||
| 32 | ;; In Emacs 24 and 25, `tramp-unload-file-name-handlers' is not | 32 | ;; In Emacs 24 and 25, `tramp-unload-file-name-handlers' is not |
| 33 | ;; autoloaded. So we declare it here in order to avoid recursive | 33 | ;; autoloaded. So we declare it here in order to avoid recursive |
| 34 | ;; load. This will be overwritten in tramp.el. | 34 | ;; load. This will be overwritten in tramp.el. |
| 35 | (defun tramp-unload-file-name-handlers ()) | 35 | (defun tramp-unload-file-name-handlers () ".") |
| 36 | 36 | ||
| 37 | (require 'auth-source) | 37 | (require 'auth-source) |
| 38 | (require 'format-spec) | 38 | (require 'format-spec) |
| @@ -47,7 +47,7 @@ | |||
| 47 | ;; changed argument list, there are compiler warnings. We want to | 47 | ;; changed argument list, there are compiler warnings. We want to |
| 48 | ;; avoid them in cases we know what we do. | 48 | ;; avoid them in cases we know what we do. |
| 49 | (defmacro tramp-compat-funcall (function &rest arguments) | 49 | (defmacro tramp-compat-funcall (function &rest arguments) |
| 50 | "Call FUNCTION if it exists. Do not raise compiler warnings." | 50 | "Call FUNCTION with ARGUMENTS if it exists. Do not raise compiler warnings." |
| 51 | `(when (functionp ,function) | 51 | `(when (functionp ,function) |
| 52 | (with-no-warnings (funcall ,function ,@arguments)))) | 52 | (with-no-warnings (funcall ,function ,@arguments)))) |
| 53 | 53 | ||
| @@ -267,6 +267,7 @@ NAME is unquoted." | |||
| 267 | 267 | ||
| 268 | ;; `cl-struct-slot-info' has been introduced with Emacs 25. | 268 | ;; `cl-struct-slot-info' has been introduced with Emacs 25. |
| 269 | (defmacro tramp-compat-tramp-file-name-slots () | 269 | (defmacro tramp-compat-tramp-file-name-slots () |
| 270 | "Return a list of slot names." | ||
| 270 | (if (fboundp 'cl-struct-slot-info) | 271 | (if (fboundp 'cl-struct-slot-info) |
| 271 | '(cdr (mapcar #'car (cl-struct-slot-info 'tramp-file-name))) | 272 | '(cdr (mapcar #'car (cl-struct-slot-info 'tramp-file-name))) |
| 272 | '(cdr (mapcar #'car (get 'tramp-file-name 'cl-struct-slots))))) | 273 | '(cdr (mapcar #'car (get 'tramp-file-name 'cl-struct-slots))))) |
diff --git a/lisp/net/tramp-ftp.el b/lisp/net/tramp-ftp.el index 2a4fccf57e7..69646c7df55 100644 --- a/lisp/net/tramp-ftp.el +++ b/lisp/net/tramp-ftp.el | |||
| @@ -110,7 +110,7 @@ present for backward compatibility." | |||
| 110 | 110 | ||
| 111 | ;;;###tramp-autoload | 111 | ;;;###tramp-autoload |
| 112 | (defun tramp-ftp-file-name-handler (operation &rest args) | 112 | (defun tramp-ftp-file-name-handler (operation &rest args) |
| 113 | "Invoke the Ange-FTP handler for OPERATION. | 113 | "Invoke the Ange-FTP handler for OPERATION and ARGS. |
| 114 | First arg specifies the OPERATION, second arg is a list of arguments to | 114 | First arg specifies the OPERATION, second arg is a list of arguments to |
| 115 | pass to the OPERATION." | 115 | pass to the OPERATION." |
| 116 | (save-match-data | 116 | (save-match-data |
| @@ -178,7 +178,7 @@ pass to the OPERATION." | |||
| 178 | ;; tramp-loaddefs.el. Otherwise, there would be recursive autoloading. | 178 | ;; tramp-loaddefs.el. Otherwise, there would be recursive autoloading. |
| 179 | ;;;###tramp-autoload | 179 | ;;;###tramp-autoload |
| 180 | (defsubst tramp-ftp-file-name-p (filename) | 180 | (defsubst tramp-ftp-file-name-p (filename) |
| 181 | "Check if it's a filename that should be forwarded to Ange-FTP." | 181 | "Check if it's a FILENAME that should be forwarded to Ange-FTP." |
| 182 | (and (tramp-tramp-file-p filename) | 182 | (and (tramp-tramp-file-p filename) |
| 183 | (string= (tramp-file-name-method (tramp-dissect-file-name filename)) | 183 | (string= (tramp-file-name-method (tramp-dissect-file-name filename)) |
| 184 | tramp-ftp-method))) | 184 | tramp-ftp-method))) |
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index f13564c544e..1b87e34aa3d 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el | |||
| @@ -612,7 +612,7 @@ Operations not mentioned here will be handled by the default Emacs primitives.") | |||
| 612 | ;; tramp-loaddefs.el. Otherwise, there would be recursive autoloading. | 612 | ;; tramp-loaddefs.el. Otherwise, there would be recursive autoloading. |
| 613 | ;;;###tramp-autoload | 613 | ;;;###tramp-autoload |
| 614 | (defsubst tramp-gvfs-file-name-p (filename) | 614 | (defsubst tramp-gvfs-file-name-p (filename) |
| 615 | "Check if it's a filename handled by the GVFS daemon." | 615 | "Check if it's a FILENAME handled by the GVFS daemon." |
| 616 | (and (tramp-tramp-file-p filename) | 616 | (and (tramp-tramp-file-p filename) |
| 617 | (let ((method | 617 | (let ((method |
| 618 | (tramp-file-name-method (tramp-dissect-file-name filename)))) | 618 | (tramp-file-name-method (tramp-dissect-file-name filename)))) |
| @@ -620,7 +620,7 @@ Operations not mentioned here will be handled by the default Emacs primitives.") | |||
| 620 | 620 | ||
| 621 | ;;;###tramp-autoload | 621 | ;;;###tramp-autoload |
| 622 | (defun tramp-gvfs-file-name-handler (operation &rest args) | 622 | (defun tramp-gvfs-file-name-handler (operation &rest args) |
| 623 | "Invoke the GVFS related OPERATION. | 623 | "Invoke the GVFS related OPERATION and ARGS. |
| 624 | First arg specifies the OPERATION, second arg is a list of arguments to | 624 | First arg specifies the OPERATION, second arg is a list of arguments to |
| 625 | pass to the OPERATION." | 625 | pass to the OPERATION." |
| 626 | (unless tramp-gvfs-enabled | 626 | (unless tramp-gvfs-enabled |
| @@ -658,7 +658,7 @@ Return nil for null BYTE-ARRAY." | |||
| 658 | (butlast byte-array) byte-array))))) | 658 | (butlast byte-array) byte-array))))) |
| 659 | 659 | ||
| 660 | (defun tramp-gvfs-stringify-dbus-message (message) | 660 | (defun tramp-gvfs-stringify-dbus-message (message) |
| 661 | "Convert a D-Bus message into readable UTF8 strings, used for traces." | 661 | "Convert a D-Bus MESSAGE into readable UTF8 strings, used for traces." |
| 662 | (cond | 662 | (cond |
| 663 | ((and (consp message) (characterp (car message))) | 663 | ((and (consp message) (characterp (car message))) |
| 664 | (format "%S" (tramp-gvfs-dbus-byte-array-to-string message))) | 664 | (format "%S" (tramp-gvfs-dbus-byte-array-to-string message))) |
| @@ -1208,7 +1208,7 @@ If FILE-SYSTEM is non-nil, return file system attributes." | |||
| 1208 | 1208 | ||
| 1209 | (defun tramp-gvfs-monitor-process-filter (proc string) | 1209 | (defun tramp-gvfs-monitor-process-filter (proc string) |
| 1210 | "Read output from \"gvfs-monitor-file\" and add corresponding \ | 1210 | "Read output from \"gvfs-monitor-file\" and add corresponding \ |
| 1211 | file-notify events." | 1211 | `file-notify' events." |
| 1212 | (let* ((events (process-get proc 'events)) | 1212 | (let* ((events (process-get proc 'events)) |
| 1213 | (rest-string (process-get proc 'rest-string)) | 1213 | (rest-string (process-get proc 'rest-string)) |
| 1214 | (dd (with-current-buffer (process-buffer proc) default-directory)) | 1214 | (dd (with-current-buffer (process-buffer proc) default-directory)) |
| @@ -1524,7 +1524,7 @@ file-notify events." | |||
| 1524 | result)))) | 1524 | result)))) |
| 1525 | 1525 | ||
| 1526 | (defun tramp-gvfs-handler-mounted-unmounted (mount-info) | 1526 | (defun tramp-gvfs-handler-mounted-unmounted (mount-info) |
| 1527 | "Signal handler for the \"org.gtk.vfs.MountTracker.mounted\" and | 1527 | "Signal handler for the \"org.gtk.vfs.MountTracker.mounted\" and \ |
| 1528 | \"org.gtk.vfs.MountTracker.unmounted\" signals." | 1528 | \"org.gtk.vfs.MountTracker.unmounted\" signals." |
| 1529 | (ignore-errors | 1529 | (ignore-errors |
| 1530 | (let ((signal-name (dbus-event-member-name last-input-event)) | 1530 | (let ((signal-name (dbus-event-member-name last-input-event)) |
diff --git a/lisp/net/tramp-integration.el b/lisp/net/tramp-integration.el index 0c706da1ca1..0bb19ed9c4d 100644 --- a/lisp/net/tramp-integration.el +++ b/lisp/net/tramp-integration.el | |||
| @@ -69,6 +69,7 @@ special handling of `substitute-in-file-name'." | |||
| 69 | #'tramp-rfn-eshadow-setup-minibuffer))) | 69 | #'tramp-rfn-eshadow-setup-minibuffer))) |
| 70 | 70 | ||
| 71 | (defun tramp-rfn-eshadow-update-overlay-regexp () | 71 | (defun tramp-rfn-eshadow-update-overlay-regexp () |
| 72 | "An overlay covering the shadowed part of the filename." | ||
| 72 | (format "[^%s/~]*\\(/\\|~\\)" tramp-postfix-host-format)) | 73 | (format "[^%s/~]*\\(/\\|~\\)" tramp-postfix-host-format)) |
| 73 | 74 | ||
| 74 | ;; Package rfn-eshadow is preloaded in Emacs, but for some reason, | 75 | ;; Package rfn-eshadow is preloaded in Emacs, but for some reason, |
diff --git a/lisp/net/tramp-rclone.el b/lisp/net/tramp-rclone.el index 56afdba7421..109d8c5c4a6 100644 --- a/lisp/net/tramp-rclone.el +++ b/lisp/net/tramp-rclone.el | |||
| @@ -147,14 +147,14 @@ Operations not mentioned here will be handled by the default Emacs primitives.") | |||
| 147 | ;; tramp-loaddefs.el. Otherwise, there would be recursive autoloading. | 147 | ;; tramp-loaddefs.el. Otherwise, there would be recursive autoloading. |
| 148 | ;;;###tramp-autoload | 148 | ;;;###tramp-autoload |
| 149 | (defsubst tramp-rclone-file-name-p (filename) | 149 | (defsubst tramp-rclone-file-name-p (filename) |
| 150 | "Check if it's a filename for rclone." | 150 | "Check if it's a FILENAME for rclone." |
| 151 | (and (tramp-tramp-file-p filename) | 151 | (and (tramp-tramp-file-p filename) |
| 152 | (string= (tramp-file-name-method (tramp-dissect-file-name filename)) | 152 | (string= (tramp-file-name-method (tramp-dissect-file-name filename)) |
| 153 | tramp-rclone-method))) | 153 | tramp-rclone-method))) |
| 154 | 154 | ||
| 155 | ;;;###tramp-autoload | 155 | ;;;###tramp-autoload |
| 156 | (defun tramp-rclone-file-name-handler (operation &rest args) | 156 | (defun tramp-rclone-file-name-handler (operation &rest args) |
| 157 | "Invoke the rclone handler for OPERATION. | 157 | "Invoke the rclone handler for OPERATION and ARGS. |
| 158 | First arg specifies the OPERATION, second arg is a list of arguments to | 158 | First arg specifies the OPERATION, second arg is a list of arguments to |
| 159 | pass to the OPERATION." | 159 | pass to the OPERATION." |
| 160 | (let ((fn (assoc operation tramp-rclone-file-name-handler-alist))) | 160 | (let ((fn (assoc operation tramp-rclone-file-name-handler-alist))) |
| @@ -583,7 +583,8 @@ connection if a previous connection has died for some reason." | |||
| 583 | vec "gid-string" (tramp-get-local-gid 'string))) | 583 | vec "gid-string" (tramp-get-local-gid 'string))) |
| 584 | 584 | ||
| 585 | (defun tramp-rclone-send-command (vec &rest args) | 585 | (defun tramp-rclone-send-command (vec &rest args) |
| 586 | "Send the COMMAND to connection VEC." | 586 | "Send a command to connection VEC. |
| 587 | The command is the list of strings ARGS." | ||
| 587 | (with-current-buffer (tramp-get-connection-buffer vec) | 588 | (with-current-buffer (tramp-get-connection-buffer vec) |
| 588 | (erase-buffer) | 589 | (erase-buffer) |
| 589 | (let ((flags (tramp-get-method-parameter | 590 | (let ((flags (tramp-get-method-parameter |
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 76bb10a277f..59a93a839e0 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -25,6 +25,10 @@ | |||
| 25 | ;; You should have received a copy of the GNU General Public License | 25 | ;; You should have received a copy of the GNU General Public License |
| 26 | ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. | 26 | ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. |
| 27 | 27 | ||
| 28 | ;;; Commentary: | ||
| 29 | |||
| 30 | ;; The file name handler implementation for ssh-alike remote connections. | ||
| 31 | |||
| 28 | ;;; Code: | 32 | ;;; Code: |
| 29 | 33 | ||
| 30 | (eval-when-compile (require 'cl-lib)) | 34 | (eval-when-compile (require 'cl-lib)) |
| @@ -1249,6 +1253,7 @@ component is used as the target of the symlink." | |||
| 1249 | (tramp-do-file-attributes-with-ls v localname id-format)))))))) | 1253 | (tramp-do-file-attributes-with-ls v localname id-format)))))))) |
| 1250 | 1254 | ||
| 1251 | (defun tramp-sh--quoting-style-options (vec) | 1255 | (defun tramp-sh--quoting-style-options (vec) |
| 1256 | "Quoting style options to be used for VEC." | ||
| 1252 | (or | 1257 | (or |
| 1253 | (tramp-get-ls-command-with | 1258 | (tramp-get-ls-command-with |
| 1254 | vec "--quoting-style=literal --show-control-chars") | 1259 | vec "--quoting-style=literal --show-control-chars") |
| @@ -3676,7 +3681,7 @@ Fall back to normal file name handler if no Tramp handler exists." | |||
| 3676 | p)))) | 3681 | p)))) |
| 3677 | 3682 | ||
| 3678 | (defun tramp-sh-gio-monitor-process-filter (proc string) | 3683 | (defun tramp-sh-gio-monitor-process-filter (proc string) |
| 3679 | "Read output from \"gio monitor\" and add corresponding file-notify events." | 3684 | "Read output from \"gio monitor\" and add corresponding `file-notify' events." |
| 3680 | (let ((events (process-get proc 'events)) | 3685 | (let ((events (process-get proc 'events)) |
| 3681 | (remote-prefix | 3686 | (remote-prefix |
| 3682 | (with-current-buffer (process-buffer proc) | 3687 | (with-current-buffer (process-buffer proc) |
| @@ -3736,7 +3741,7 @@ Fall back to normal file name handler if no Tramp handler exists." | |||
| 3736 | 3741 | ||
| 3737 | (defun tramp-sh-gvfs-monitor-dir-process-filter (proc string) | 3742 | (defun tramp-sh-gvfs-monitor-dir-process-filter (proc string) |
| 3738 | "Read output from \"gvfs-monitor-dir\" and add corresponding \ | 3743 | "Read output from \"gvfs-monitor-dir\" and add corresponding \ |
| 3739 | file-notify events." | 3744 | `file-notify' events." |
| 3740 | (let ((events (process-get proc 'events)) | 3745 | (let ((events (process-get proc 'events)) |
| 3741 | (remote-prefix | 3746 | (remote-prefix |
| 3742 | (with-current-buffer (process-buffer proc) | 3747 | (with-current-buffer (process-buffer proc) |
| @@ -3786,7 +3791,7 @@ file-notify events." | |||
| 3786 | (process-put proc 'rest-string string))) | 3791 | (process-put proc 'rest-string string))) |
| 3787 | 3792 | ||
| 3788 | (defun tramp-sh-inotifywait-process-filter (proc string) | 3793 | (defun tramp-sh-inotifywait-process-filter (proc string) |
| 3789 | "Read output from \"inotifywait\" and add corresponding file-notify events." | 3794 | "Read output from \"inotifywait\" and add corresponding `file-notify' events." |
| 3790 | (let ((events (process-get proc 'events))) | 3795 | (let ((events (process-get proc 'events))) |
| 3791 | (tramp-message proc 6 "%S\n%s" proc string) | 3796 | (tramp-message proc 6 "%S\n%s" proc string) |
| 3792 | (dolist (line (split-string string "[\n\r]+" 'omit)) | 3797 | (dolist (line (split-string string "[\n\r]+" 'omit)) |
| @@ -3906,11 +3911,11 @@ hosts, or files, disagree." | |||
| 3906 | 3911 | ||
| 3907 | (defun tramp-find-executable | 3912 | (defun tramp-find-executable |
| 3908 | (vec progname dirlist &optional ignore-tilde ignore-path) | 3913 | (vec progname dirlist &optional ignore-tilde ignore-path) |
| 3909 | "Searches for PROGNAME in $PATH and all directories mentioned in DIRLIST. | 3914 | "Search for PROGNAME in $PATH and all directories mentioned in DIRLIST. |
| 3910 | First arg VEC specifies the connection, PROGNAME is the program | 3915 | First arg VEC specifies the connection, PROGNAME is the program |
| 3911 | to search for, and DIRLIST gives the list of directories to | 3916 | to search for, and DIRLIST gives the list of directories to |
| 3912 | search. If IGNORE-TILDE is non-nil, directory names starting | 3917 | search. If IGNORE-TILDE is non-nil, directory names starting |
| 3913 | with `~' will be ignored. If IGNORE-PATH is non-nil, searches | 3918 | with `~' will be ignored. If IGNORE-PATH is non-nil, searches |
| 3914 | only in DIRLIST. | 3919 | only in DIRLIST. |
| 3915 | 3920 | ||
| 3916 | Returns the absolute file name of PROGNAME, if found, and nil otherwise. | 3921 | Returns the absolute file name of PROGNAME, if found, and nil otherwise. |
| @@ -3964,7 +3969,7 @@ This function expects to be in the right *tramp* buffer." | |||
| 3964 | ;; send it. This is likely not due to PATH_MAX, but PIPE_BUF. We | 3969 | ;; send it. This is likely not due to PATH_MAX, but PIPE_BUF. We |
| 3965 | ;; check it, and use a temporary file in case of. See Bug#33781. | 3970 | ;; check it, and use a temporary file in case of. See Bug#33781. |
| 3966 | (defun tramp-set-remote-path (vec) | 3971 | (defun tramp-set-remote-path (vec) |
| 3967 | "Sets the remote environment PATH to existing directories. | 3972 | "Set the remote environment PATH to existing directories. |
| 3968 | I.e., for each directory in `tramp-remote-path', it is tested | 3973 | I.e., for each directory in `tramp-remote-path', it is tested |
| 3969 | whether it exists and if so, it is added to the environment | 3974 | whether it exists and if so, it is added to the environment |
| 3970 | variable PATH." | 3975 | variable PATH." |
| @@ -4057,7 +4062,7 @@ file exists and nonzero exit status otherwise." | |||
| 4057 | extra-args)) | 4062 | extra-args)) |
| 4058 | 4063 | ||
| 4059 | (defun tramp-open-shell (vec shell) | 4064 | (defun tramp-open-shell (vec shell) |
| 4060 | "Opens shell SHELL." | 4065 | "Open shell SHELL." |
| 4061 | (with-tramp-progress-reporter | 4066 | (with-tramp-progress-reporter |
| 4062 | vec 5 (format-message "Opening remote shell `%s'" shell) | 4067 | vec 5 (format-message "Opening remote shell `%s'" shell) |
| 4063 | ;; Find arguments for this shell. | 4068 | ;; Find arguments for this shell. |
| @@ -4111,7 +4116,7 @@ file exists and nonzero exit status otherwise." | |||
| 4111 | (tramp-get-connection-process vec) "remote-shell" shell))) | 4116 | (tramp-get-connection-process vec) "remote-shell" shell))) |
| 4112 | 4117 | ||
| 4113 | (defun tramp-find-shell (vec) | 4118 | (defun tramp-find-shell (vec) |
| 4114 | "Opens a shell on the remote host which groks tilde expansion." | 4119 | "Open a shell on the remote host which groks tilde expansion." |
| 4115 | (with-current-buffer (tramp-get-buffer vec) | 4120 | (with-current-buffer (tramp-get-buffer vec) |
| 4116 | (let ((default-shell (tramp-get-method-parameter vec 'tramp-remote-shell)) | 4121 | (let ((default-shell (tramp-get-method-parameter vec 'tramp-remote-shell)) |
| 4117 | shell) | 4122 | shell) |
| @@ -5108,8 +5113,8 @@ function waits for output unless NOOUTPUT is set." | |||
| 5108 | (defun tramp-send-command-and-check | 5113 | (defun tramp-send-command-and-check |
| 5109 | (vec command &optional subshell dont-suppress-err) | 5114 | (vec command &optional subshell dont-suppress-err) |
| 5110 | "Run COMMAND and check its exit status. | 5115 | "Run COMMAND and check its exit status. |
| 5111 | Sends `echo $?' along with the COMMAND for checking the exit status. | 5116 | Send `echo $?' along with the COMMAND for checking the exit status. |
| 5112 | If COMMAND is nil, just sends `echo $?'. Returns t if the exit | 5117 | If COMMAND is nil, just send `echo $?'. Return t if the exit |
| 5113 | status is 0, and nil otherwise. | 5118 | status is 0, and nil otherwise. |
| 5114 | 5119 | ||
| 5115 | If the optional argument SUBSHELL is non-nil, the command is | 5120 | If the optional argument SUBSHELL is non-nil, the command is |
| @@ -5261,7 +5266,7 @@ Return ATTR." | |||
| 5261 | attr)) | 5266 | attr)) |
| 5262 | 5267 | ||
| 5263 | (defun tramp-shell-case-fold (string) | 5268 | (defun tramp-shell-case-fold (string) |
| 5264 | "Converts STRING to shell glob pattern which ignores case." | 5269 | "Convert STRING to shell glob pattern which ignores case." |
| 5265 | (mapconcat | 5270 | (mapconcat |
| 5266 | (lambda (c) | 5271 | (lambda (c) |
| 5267 | (if (equal (downcase c) (upcase c)) | 5272 | (if (equal (downcase c) (upcase c)) |
| @@ -5305,7 +5310,7 @@ Return ATTR." | |||
| 5305 | ;; Variables local to connection. | 5310 | ;; Variables local to connection. |
| 5306 | 5311 | ||
| 5307 | (defun tramp-get-remote-path (vec) | 5312 | (defun tramp-get-remote-path (vec) |
| 5308 | "Compile list of remote directories for $PATH. | 5313 | "Compile list of remote directories for PATH. |
| 5309 | Nonexistent directories are removed from spec." | 5314 | Nonexistent directories are removed from spec." |
| 5310 | (with-current-buffer (tramp-get-connection-buffer vec) | 5315 | (with-current-buffer (tramp-get-connection-buffer vec) |
| 5311 | ;; Expand connection-local variables. | 5316 | ;; Expand connection-local variables. |
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 95cdb4cbffe..38149da6643 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el | |||
| @@ -319,14 +319,14 @@ This can be used to disable echo etc." | |||
| 319 | ;; tramp-loaddefs.el. Otherwise, there would be recursive autoloading. | 319 | ;; tramp-loaddefs.el. Otherwise, there would be recursive autoloading. |
| 320 | ;;;###tramp-autoload | 320 | ;;;###tramp-autoload |
| 321 | (defsubst tramp-smb-file-name-p (filename) | 321 | (defsubst tramp-smb-file-name-p (filename) |
| 322 | "Check if it's a filename for SMB servers." | 322 | "Check if it's a FILENAME for SMB servers." |
| 323 | (and (tramp-tramp-file-p filename) | 323 | (and (tramp-tramp-file-p filename) |
| 324 | (string= (tramp-file-name-method (tramp-dissect-file-name filename)) | 324 | (string= (tramp-file-name-method (tramp-dissect-file-name filename)) |
| 325 | tramp-smb-method))) | 325 | tramp-smb-method))) |
| 326 | 326 | ||
| 327 | ;;;###tramp-autoload | 327 | ;;;###tramp-autoload |
| 328 | (defun tramp-smb-file-name-handler (operation &rest args) | 328 | (defun tramp-smb-file-name-handler (operation &rest args) |
| 329 | "Invoke the SMB related OPERATION. | 329 | "Invoke the SMB related OPERATION and ARGS. |
| 330 | First arg specifies the OPERATION, second arg is a list of arguments to | 330 | First arg specifies the OPERATION, second arg is a list of arguments to |
| 331 | pass to the OPERATION." | 331 | pass to the OPERATION." |
| 332 | (let ((fn (assoc operation tramp-smb-file-name-handler-alist))) | 332 | (let ((fn (assoc operation tramp-smb-file-name-handler-alist))) |
| @@ -844,7 +844,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 844 | device)))))))) ;11 file system number | 844 | device)))))))) ;11 file system number |
| 845 | 845 | ||
| 846 | (defun tramp-smb-do-file-attributes-with-stat (vec &optional id-format) | 846 | (defun tramp-smb-do-file-attributes-with-stat (vec &optional id-format) |
| 847 | "Implement `file-attributes' for Tramp files using stat command." | 847 | "Implement `file-attributes' for Tramp files using `stat' command." |
| 848 | (tramp-message | 848 | (tramp-message |
| 849 | vec 5 "file attributes with stat: %s" (tramp-file-name-localname vec)) | 849 | vec 5 "file attributes with stat: %s" (tramp-file-name-localname vec)) |
| 850 | (let* (size id link uid gid atime mtime ctime mode inode) | 850 | (let* (size id link uid gid atime mtime ctime mode inode) |
| @@ -1530,7 +1530,7 @@ component is used as the target of the symlink." | |||
| 1530 | (tramp-flush-connection-property v "process-buffer"))))) | 1530 | (tramp-flush-connection-property v "process-buffer"))))) |
| 1531 | 1531 | ||
| 1532 | (defun tramp-smb-handle-substitute-in-file-name (filename) | 1532 | (defun tramp-smb-handle-substitute-in-file-name (filename) |
| 1533 | "Like `handle-substitute-in-file-name' for Tramp files. | 1533 | "Like `substitute-in-file-name' for Tramp files. |
| 1534 | \"//\" substitutes only in the local filename part. Catches | 1534 | \"//\" substitutes only in the local filename part. Catches |
| 1535 | errors for shares like \"C$/\", which are common in Microsoft Windows." | 1535 | errors for shares like \"C$/\", which are common in Microsoft Windows." |
| 1536 | ;; Check, whether the local part is a quoted file name. | 1536 | ;; Check, whether the local part is a quoted file name. |
| @@ -1858,7 +1858,7 @@ are listed. Result is the list (LOCALNAME MODE SIZE MTIME)." | |||
| 1858 | (buffer-substring (point) (point-at-eol)) nil 'omit))))))))) | 1858 | (buffer-substring (point) (point-at-eol)) nil 'omit))))))))) |
| 1859 | 1859 | ||
| 1860 | (defun tramp-smb-get-stat-capability (vec) | 1860 | (defun tramp-smb-get-stat-capability (vec) |
| 1861 | "Check whether the SMB server supports the STAT command." | 1861 | "Check whether the SMB server supports the `stat' command." |
| 1862 | ;; When we are not logged in yet, we return nil. | 1862 | ;; When we are not logged in yet, we return nil. |
| 1863 | (if (and (tramp-smb-get-share vec) | 1863 | (if (and (tramp-smb-get-share vec) |
| 1864 | (process-live-p (tramp-get-connection-process vec))) | 1864 | (process-live-p (tramp-get-connection-process vec))) |
| @@ -2117,7 +2117,7 @@ Removes smb prompt. Returns nil if an error message has appeared." | |||
| 2117 | (tramp-smb-send-command vec "$rawui.WindowSize = $winsize")) | 2117 | (tramp-smb-send-command vec "$rawui.WindowSize = $winsize")) |
| 2118 | 2118 | ||
| 2119 | (defun tramp-smb-shell-quote-argument (s) | 2119 | (defun tramp-smb-shell-quote-argument (s) |
| 2120 | "Similar to `shell-quote-argument', but uses windows cmd syntax." | 2120 | "Similar to `shell-quote-argument', but uses Windows cmd syntax." |
| 2121 | (let ((system-type 'ms-dos)) | 2121 | (let ((system-type 'ms-dos)) |
| 2122 | (tramp-unquote-shell-quote-argument s))) | 2122 | (tramp-unquote-shell-quote-argument s))) |
| 2123 | 2123 | ||
diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el index 43ac6ff66b3..2a588f7b193 100644 --- a/lisp/net/tramp-sudoedit.el +++ b/lisp/net/tramp-sudoedit.el | |||
| @@ -143,14 +143,14 @@ See `tramp-actions-before-shell' for more info.") | |||
| 143 | ;; tramp-loaddefs.el. Otherwise, there would be recursive autoloading. | 143 | ;; tramp-loaddefs.el. Otherwise, there would be recursive autoloading. |
| 144 | ;;;###tramp-autoload | 144 | ;;;###tramp-autoload |
| 145 | (defsubst tramp-sudoedit-file-name-p (filename) | 145 | (defsubst tramp-sudoedit-file-name-p (filename) |
| 146 | "Check if it's a filename for SUDOEDIT." | 146 | "Check if it's a FILENAME for SUDOEDIT." |
| 147 | (and (tramp-tramp-file-p filename) | 147 | (and (tramp-tramp-file-p filename) |
| 148 | (string= (tramp-file-name-method (tramp-dissect-file-name filename)) | 148 | (string= (tramp-file-name-method (tramp-dissect-file-name filename)) |
| 149 | tramp-sudoedit-method))) | 149 | tramp-sudoedit-method))) |
| 150 | 150 | ||
| 151 | ;;;###tramp-autoload | 151 | ;;;###tramp-autoload |
| 152 | (defun tramp-sudoedit-file-name-handler (operation &rest args) | 152 | (defun tramp-sudoedit-file-name-handler (operation &rest args) |
| 153 | "Invoke the SUDOEDIT handler for OPERATION. | 153 | "Invoke the SUDOEDIT handler for OPERATION and ARGS. |
| 154 | First arg specifies the OPERATION, second arg is a list of arguments to | 154 | First arg specifies the OPERATION, second arg is a list of arguments to |
| 155 | pass to the OPERATION." | 155 | pass to the OPERATION." |
| 156 | (let ((fn (assoc operation tramp-sudoedit-file-name-handler-alist))) | 156 | (let ((fn (assoc operation tramp-sudoedit-file-name-handler-alist))) |
| @@ -749,8 +749,7 @@ ID-FORMAT valid values are `string' and `integer'." | |||
| 749 | 749 | ||
| 750 | ;; Used in `tramp-sudoedit-sudo-actions'. | 750 | ;; Used in `tramp-sudoedit-sudo-actions'. |
| 751 | (defun tramp-sudoedit-action-sudo (proc vec) | 751 | (defun tramp-sudoedit-action-sudo (proc vec) |
| 752 | "Check, whether a sudo process has finished. | 752 | "Check, whether a sudo process has finished. Remove unneeded output." |
| 753 | Remove unneeded output." | ||
| 754 | ;; There might be pending output for the exit status. | 753 | ;; There might be pending output for the exit status. |
| 755 | (unless (process-live-p proc) | 754 | (unless (process-live-p proc) |
| 756 | (while (tramp-accept-process-output proc 0)) | 755 | (while (tramp-accept-process-output proc 0)) |
| @@ -866,7 +865,7 @@ In case there is no valid Lisp expression, it raises an error." | |||
| 866 | (car args) (buffer-string))))))) | 865 | (car args) (buffer-string))))))) |
| 867 | 866 | ||
| 868 | (defun tramp-sudoedit-send-command-string (vec &rest args) | 867 | (defun tramp-sudoedit-send-command-string (vec &rest args) |
| 869 | "Run command ARGS and return the output as astring." | 868 | "Run command ARGS and return the output as a string." |
| 870 | (when (apply #'tramp-sudoedit-send-command vec args) | 869 | (when (apply #'tramp-sudoedit-send-command vec args) |
| 871 | (with-current-buffer (tramp-get-connection-buffer vec) | 870 | (with-current-buffer (tramp-get-connection-buffer vec) |
| 872 | (tramp-message vec 6 "\n%s" (buffer-string)) | 871 | (tramp-message vec 6 "\n%s" (buffer-string)) |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 50f8c5d9915..ba8b9aa5c4c 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -116,7 +116,7 @@ in `backup-directory-alist'. If a Tramp file is backed up, and DIRECTORY | |||
| 116 | is a local file name, the backup directory is prepended with Tramp file | 116 | is a local file name, the backup directory is prepended with Tramp file |
| 117 | name prefix \(method, user, host) of file. | 117 | name prefix \(method, user, host) of file. |
| 118 | 118 | ||
| 119 | \(setq tramp-backup-directory-alist backup-directory-alist) | 119 | (setq tramp-backup-directory-alist backup-directory-alist) |
| 120 | 120 | ||
| 121 | gives the same backup policy for Tramp files on their hosts like the | 121 | gives the same backup policy for Tramp files on their hosts like the |
| 122 | policy for local files." | 122 | policy for local files." |
| @@ -528,7 +528,7 @@ usually suffice.") | |||
| 528 | (defconst tramp-echoed-echo-mark-regexp | 528 | (defconst tramp-echoed-echo-mark-regexp |
| 529 | (format "%s\\(\b\\( \b\\)?\\)\\{%d\\}" | 529 | (format "%s\\(\b\\( \b\\)?\\)\\{%d\\}" |
| 530 | tramp-echo-mark-marker tramp-echo-mark-marker-length) | 530 | tramp-echo-mark-marker tramp-echo-mark-marker-length) |
| 531 | "Regexp which matches `tramp-echo-mark' as it gets echoed by | 531 | "Regexp which matches `tramp-echo-mark' as it gets echoed by \ |
| 532 | the remote shell.") | 532 | the remote shell.") |
| 533 | 533 | ||
| 534 | (defcustom tramp-local-end-of-line | 534 | (defcustom tramp-local-end-of-line |
| @@ -760,14 +760,14 @@ to be set, depending on VALUE." | |||
| 760 | (tramp-set-syntax 'tramp-syntax (tramp-compat-tramp-syntax))) | 760 | (tramp-set-syntax 'tramp-syntax (tramp-compat-tramp-syntax))) |
| 761 | 761 | ||
| 762 | (defun tramp-syntax-values () | 762 | (defun tramp-syntax-values () |
| 763 | "Return possible values of `tramp-syntax', a list" | 763 | "Return possible values of `tramp-syntax', a list." |
| 764 | (let ((values (cdr (get 'tramp-syntax 'custom-type)))) | 764 | (let ((values (cdr (get 'tramp-syntax 'custom-type)))) |
| 765 | (setq values (mapcar #'last values) | 765 | (setq values (mapcar #'last values) |
| 766 | values (mapcar #'car values)) | 766 | values (mapcar #'car values)) |
| 767 | values)) | 767 | values)) |
| 768 | 768 | ||
| 769 | (defun tramp-lookup-syntax (alist) | 769 | (defun tramp-lookup-syntax (alist) |
| 770 | "Look up a syntax string in ALIST according to `tramp-compat-tramp-syntax.' | 770 | "Look up a syntax string in ALIST according to `tramp-compat-tramp-syntax'. |
| 771 | Raise an error if `tramp-syntax' is invalid." | 771 | Raise an error if `tramp-syntax' is invalid." |
| 772 | (or (cdr (assq (tramp-compat-tramp-syntax) alist)) | 772 | (or (cdr (assq (tramp-compat-tramp-syntax) alist)) |
| 773 | (error "Wrong `tramp-syntax' %s" tramp-syntax))) | 773 | (error "Wrong `tramp-syntax' %s" tramp-syntax))) |
| @@ -779,6 +779,7 @@ Raise an error if `tramp-syntax' is invalid." | |||
| 779 | "Alist mapping Tramp syntax to strings beginning Tramp file names.") | 779 | "Alist mapping Tramp syntax to strings beginning Tramp file names.") |
| 780 | 780 | ||
| 781 | (defun tramp-build-prefix-format () | 781 | (defun tramp-build-prefix-format () |
| 782 | "Return `tramp-prefix-format' according to `tramp-syntax'." | ||
| 782 | (tramp-lookup-syntax tramp-prefix-format-alist)) | 783 | (tramp-lookup-syntax tramp-prefix-format-alist)) |
| 783 | 784 | ||
| 784 | (defvar tramp-prefix-format nil ;Initialized when defining `tramp-syntax'! | 785 | (defvar tramp-prefix-format nil ;Initialized when defining `tramp-syntax'! |
| @@ -786,6 +787,7 @@ Raise an error if `tramp-syntax' is invalid." | |||
| 786 | Used in `tramp-make-tramp-file-name'.") | 787 | Used in `tramp-make-tramp-file-name'.") |
| 787 | 788 | ||
| 788 | (defun tramp-build-prefix-regexp () | 789 | (defun tramp-build-prefix-regexp () |
| 790 | "Return `tramp-prefix-regexp'." | ||
| 789 | (concat "^" (regexp-quote tramp-prefix-format))) | 791 | (concat "^" (regexp-quote tramp-prefix-format))) |
| 790 | 792 | ||
| 791 | (defvar tramp-prefix-regexp nil ;Initialized when defining `tramp-syntax'! | 793 | (defvar tramp-prefix-regexp nil ;Initialized when defining `tramp-syntax'! |
| @@ -799,6 +801,7 @@ Should always start with \"^\". Derived from `tramp-prefix-format'.") | |||
| 799 | "Alist mapping Tramp syntax to regexps matching methods identifiers.") | 801 | "Alist mapping Tramp syntax to regexps matching methods identifiers.") |
| 800 | 802 | ||
| 801 | (defun tramp-build-method-regexp () | 803 | (defun tramp-build-method-regexp () |
| 804 | "Return `tramp-method-regexp' according to `tramp-syntax'." | ||
| 802 | (tramp-lookup-syntax tramp-method-regexp-alist)) | 805 | (tramp-lookup-syntax tramp-method-regexp-alist)) |
| 803 | 806 | ||
| 804 | (defvar tramp-method-regexp nil ;Initialized when defining `tramp-syntax'! | 807 | (defvar tramp-method-regexp nil ;Initialized when defining `tramp-syntax'! |
| @@ -812,6 +815,7 @@ The `ftp' syntax does not support methods.") | |||
| 812 | "Alist mapping Tramp syntax to the delimiter after the method.") | 815 | "Alist mapping Tramp syntax to the delimiter after the method.") |
| 813 | 816 | ||
| 814 | (defun tramp-build-postfix-method-format () | 817 | (defun tramp-build-postfix-method-format () |
| 818 | "Return `tramp-postfix-method-format' according to `tramp-syntax'." | ||
| 815 | (tramp-lookup-syntax tramp-postfix-method-format-alist)) | 819 | (tramp-lookup-syntax tramp-postfix-method-format-alist)) |
| 816 | 820 | ||
| 817 | (defvar tramp-postfix-method-format nil ;Init'd when defining `tramp-syntax'! | 821 | (defvar tramp-postfix-method-format nil ;Init'd when defining `tramp-syntax'! |
| @@ -820,6 +824,7 @@ The `ftp' syntax does not support methods. | |||
| 820 | Used in `tramp-make-tramp-file-name'.") | 824 | Used in `tramp-make-tramp-file-name'.") |
| 821 | 825 | ||
| 822 | (defun tramp-build-postfix-method-regexp () | 826 | (defun tramp-build-postfix-method-regexp () |
| 827 | "Return `tramp-postfix-method-regexp'." | ||
| 823 | (regexp-quote tramp-postfix-method-format)) | 828 | (regexp-quote tramp-postfix-method-format)) |
| 824 | 829 | ||
| 825 | (defvar tramp-postfix-method-regexp nil ;Init'd when defining `tramp-syntax'! | 830 | (defvar tramp-postfix-method-regexp nil ;Init'd when defining `tramp-syntax'! |
| @@ -863,6 +868,7 @@ Derived from `tramp-postfix-user-format'.") | |||
| 863 | "Alist mapping Tramp syntax to strings prefixing IPv6 addresses.") | 868 | "Alist mapping Tramp syntax to strings prefixing IPv6 addresses.") |
| 864 | 869 | ||
| 865 | (defun tramp-build-prefix-ipv6-format () | 870 | (defun tramp-build-prefix-ipv6-format () |
| 871 | "Return `tramp-prefix-ipv6-format' according to `tramp-syntax'." | ||
| 866 | (tramp-lookup-syntax tramp-prefix-ipv6-format-alist)) | 872 | (tramp-lookup-syntax tramp-prefix-ipv6-format-alist)) |
| 867 | 873 | ||
| 868 | (defvar tramp-prefix-ipv6-format nil ;Initialized when defining `tramp-syntax'! | 874 | (defvar tramp-prefix-ipv6-format nil ;Initialized when defining `tramp-syntax'! |
| @@ -870,6 +876,7 @@ Derived from `tramp-postfix-user-format'.") | |||
| 870 | Used in `tramp-make-tramp-file-name'.") | 876 | Used in `tramp-make-tramp-file-name'.") |
| 871 | 877 | ||
| 872 | (defun tramp-build-prefix-ipv6-regexp () | 878 | (defun tramp-build-prefix-ipv6-regexp () |
| 879 | "Return `tramp-prefix-ipv6-regexp'." | ||
| 873 | (regexp-quote tramp-prefix-ipv6-format)) | 880 | (regexp-quote tramp-prefix-ipv6-format)) |
| 874 | 881 | ||
| 875 | (defvar tramp-prefix-ipv6-regexp nil ;Initialized when defining `tramp-syntax'! | 882 | (defvar tramp-prefix-ipv6-regexp nil ;Initialized when defining `tramp-syntax'! |
| @@ -889,6 +896,7 @@ Derived from `tramp-prefix-ipv6-format'.") | |||
| 889 | "Alist mapping Tramp syntax to suffix for IPv6 addresses.") | 896 | "Alist mapping Tramp syntax to suffix for IPv6 addresses.") |
| 890 | 897 | ||
| 891 | (defun tramp-build-postfix-ipv6-format () | 898 | (defun tramp-build-postfix-ipv6-format () |
| 899 | "Return `tramp-postfix-ipv6-format' according to `tramp-syntax'." | ||
| 892 | (tramp-lookup-syntax tramp-postfix-ipv6-format-alist)) | 900 | (tramp-lookup-syntax tramp-postfix-ipv6-format-alist)) |
| 893 | 901 | ||
| 894 | (defvar tramp-postfix-ipv6-format nil ;Initialized when defining `tramp-syntax'! | 902 | (defvar tramp-postfix-ipv6-format nil ;Initialized when defining `tramp-syntax'! |
| @@ -896,6 +904,7 @@ Derived from `tramp-prefix-ipv6-format'.") | |||
| 896 | Used in `tramp-make-tramp-file-name'.") | 904 | Used in `tramp-make-tramp-file-name'.") |
| 897 | 905 | ||
| 898 | (defun tramp-build-postfix-ipv6-regexp () | 906 | (defun tramp-build-postfix-ipv6-regexp () |
| 907 | "Return `tramp-postfix-ipv6-regexp'." | ||
| 899 | (regexp-quote tramp-postfix-ipv6-format)) | 908 | (regexp-quote tramp-postfix-ipv6-format)) |
| 900 | 909 | ||
| 901 | (defvar tramp-postfix-ipv6-regexp nil ;Initialized when defining `tramp-syntax'! | 910 | (defvar tramp-postfix-ipv6-regexp nil ;Initialized when defining `tramp-syntax'! |
| @@ -932,6 +941,7 @@ Derived from `tramp-postfix-hop-format'.") | |||
| 932 | "Alist mapping Tramp syntax to strings between host and local names.") | 941 | "Alist mapping Tramp syntax to strings between host and local names.") |
| 933 | 942 | ||
| 934 | (defun tramp-build-postfix-host-format () | 943 | (defun tramp-build-postfix-host-format () |
| 944 | "Return `tramp-postfix-host-format' according to `tramp-syntax'." | ||
| 935 | (tramp-lookup-syntax tramp-postfix-host-format-alist)) | 945 | (tramp-lookup-syntax tramp-postfix-host-format-alist)) |
| 936 | 946 | ||
| 937 | (defvar tramp-postfix-host-format nil ;Initialized when defining `tramp-syntax'! | 947 | (defvar tramp-postfix-host-format nil ;Initialized when defining `tramp-syntax'! |
| @@ -939,6 +949,7 @@ Derived from `tramp-postfix-hop-format'.") | |||
| 939 | Used in `tramp-make-tramp-file-name'.") | 949 | Used in `tramp-make-tramp-file-name'.") |
| 940 | 950 | ||
| 941 | (defun tramp-build-postfix-host-regexp () | 951 | (defun tramp-build-postfix-host-regexp () |
| 952 | "Return `tramp-postfix-host-regexp'." | ||
| 942 | (regexp-quote tramp-postfix-host-format)) | 953 | (regexp-quote tramp-postfix-host-format)) |
| 943 | 954 | ||
| 944 | (defvar tramp-postfix-host-regexp nil ;Initialized when defining `tramp-syntax'! | 955 | (defvar tramp-postfix-host-regexp nil ;Initialized when defining `tramp-syntax'! |
| @@ -949,10 +960,10 @@ Derived from `tramp-postfix-host-format'.") | |||
| 949 | "Regexp matching localnames.") | 960 | "Regexp matching localnames.") |
| 950 | 961 | ||
| 951 | (defconst tramp-unknown-id-string "UNKNOWN" | 962 | (defconst tramp-unknown-id-string "UNKNOWN" |
| 952 | "String used to denote an unknown user or group") | 963 | "String used to denote an unknown user or group.") |
| 953 | 964 | ||
| 954 | (defconst tramp-unknown-id-integer -1 | 965 | (defconst tramp-unknown-id-integer -1 |
| 955 | "Integer used to denote an unknown user or group") | 966 | "Integer used to denote an unknown user or group.") |
| 956 | 967 | ||
| 957 | ;;; File name format: | 968 | ;;; File name format: |
| 958 | 969 | ||
| @@ -1005,6 +1016,7 @@ means the opening parentheses are counted to identify the pair. | |||
| 1005 | See also `tramp-file-name-regexp'.") | 1016 | See also `tramp-file-name-regexp'.") |
| 1006 | 1017 | ||
| 1007 | (defun tramp-build-file-name-regexp () | 1018 | (defun tramp-build-file-name-regexp () |
| 1019 | "Return `tramp-file-name-regexp'." | ||
| 1008 | (car tramp-file-name-structure)) | 1020 | (car tramp-file-name-structure)) |
| 1009 | 1021 | ||
| 1010 | ;;;###autoload | 1022 | ;;;###autoload |
| @@ -1073,6 +1085,7 @@ See `tramp-file-name-structure' for more explanations.") | |||
| 1073 | "Alist mapping incomplete Tramp file names.") | 1085 | "Alist mapping incomplete Tramp file names.") |
| 1074 | 1086 | ||
| 1075 | (defun tramp-build-completion-file-name-regexp () | 1087 | (defun tramp-build-completion-file-name-regexp () |
| 1088 | "Return `tramp-completion-file-name-regexp' according to `tramp-syntax'." | ||
| 1076 | (tramp-lookup-syntax tramp-completion-file-name-regexp-alist)) | 1089 | (tramp-lookup-syntax tramp-completion-file-name-regexp-alist)) |
| 1077 | 1090 | ||
| 1078 | (defvar tramp-completion-file-name-regexp | 1091 | (defvar tramp-completion-file-name-regexp |
| @@ -1147,13 +1160,13 @@ checked via the following code: | |||
| 1147 | In the Emacs normally running Tramp, evaluate the above code | 1160 | In the Emacs normally running Tramp, evaluate the above code |
| 1148 | \(replace \"xxx\" and \"yyy\" by the remote user and host name, | 1161 | \(replace \"xxx\" and \"yyy\" by the remote user and host name, |
| 1149 | respectively). You can do this, for example, by pasting it into | 1162 | respectively). You can do this, for example, by pasting it into |
| 1150 | the `*scratch*' buffer and then hitting C-j with the cursor after the | 1163 | the `*scratch*' buffer and then hitting `C-j' with the cursor after the |
| 1151 | last closing parenthesis. Note that it works only if you have configured | 1164 | last closing parenthesis. Note that it works only if you have configured |
| 1152 | \"ssh\" to run without password query, see ssh-agent(1). | 1165 | \"ssh\" to run without password query, see ssh-agent(1). |
| 1153 | 1166 | ||
| 1154 | You will see the number of bytes sent successfully to the remote host. | 1167 | You will see the number of bytes sent successfully to the remote host. |
| 1155 | If that number exceeds 1000, you can stop the execution by hitting | 1168 | If that number exceeds 1000, you can stop the execution by hitting |
| 1156 | C-g, because your Emacs is likely clean. | 1169 | `C-g', because your Emacs is likely clean. |
| 1157 | 1170 | ||
| 1158 | When it is necessary to set `tramp-chunksize', you might consider to | 1171 | When it is necessary to set `tramp-chunksize', you might consider to |
| 1159 | use an out-of-the-band method \(like \"scp\") instead of an internal one | 1172 | use an out-of-the-band method \(like \"scp\") instead of an internal one |
| @@ -1165,7 +1178,7 @@ about the value `tramp-chunksize' should be set. Maybe you could just | |||
| 1165 | experiment a bit, e.g. changing the values of `init' and `step' | 1178 | experiment a bit, e.g. changing the values of `init' and `step' |
| 1166 | in the third line of the code. | 1179 | in the third line of the code. |
| 1167 | 1180 | ||
| 1168 | Please raise a bug report via \"M-x tramp-bug\" if your system needs | 1181 | Please raise a bug report via \\[tramp-bug] if your system needs |
| 1169 | this variable to be set as well." | 1182 | this variable to be set as well." |
| 1170 | :type '(choice (const nil) integer)) | 1183 | :type '(choice (const nil) integer)) |
| 1171 | 1184 | ||
| @@ -1317,8 +1330,8 @@ entry does not exist, return nil." | |||
| 1317 | t)) | 1330 | t)) |
| 1318 | 1331 | ||
| 1319 | (defun tramp-find-method (method user host) | 1332 | (defun tramp-find-method (method user host) |
| 1320 | "Return the right method string to use. | 1333 | "Return the right method string to use depending on USER and HOST. |
| 1321 | This is METHOD, if non-nil. Otherwise, do a lookup in | 1334 | This is METHOD, if non-nil. Otherwise, do a lookup in |
| 1322 | `tramp-default-method-alist' and `tramp-default-method'." | 1335 | `tramp-default-method-alist' and `tramp-default-method'." |
| 1323 | (when (and method | 1336 | (when (and method |
| 1324 | (or (string-equal method "") | 1337 | (or (string-equal method "") |
| @@ -1342,8 +1355,8 @@ This is METHOD, if non-nil. Otherwise, do a lookup in | |||
| 1342 | (propertize result 'tramp-default t)))) | 1355 | (propertize result 'tramp-default t)))) |
| 1343 | 1356 | ||
| 1344 | (defun tramp-find-user (method user host) | 1357 | (defun tramp-find-user (method user host) |
| 1345 | "Return the right user string to use. | 1358 | "Return the right user string to use depending on METHOD and HOST. |
| 1346 | This is USER, if non-nil. Otherwise, do a lookup in | 1359 | This is USER, if non-nil. Otherwise, do a lookup in |
| 1347 | `tramp-default-user-alist' and `tramp-default-user'." | 1360 | `tramp-default-user-alist' and `tramp-default-user'." |
| 1348 | (let ((result | 1361 | (let ((result |
| 1349 | (or user | 1362 | (or user |
| @@ -1363,8 +1376,8 @@ This is USER, if non-nil. Otherwise, do a lookup in | |||
| 1363 | (propertize result 'tramp-default t)))) | 1376 | (propertize result 'tramp-default t)))) |
| 1364 | 1377 | ||
| 1365 | (defun tramp-find-host (method user host) | 1378 | (defun tramp-find-host (method user host) |
| 1366 | "Return the right host string to use. | 1379 | "Return the right host string to use depending on METHOD and USER. |
| 1367 | This is HOST, if non-nil. Otherwise, do a lookup in | 1380 | This is HOST, if non-nil. Otherwise, do a lookup in |
| 1368 | `tramp-default-host-alist' and `tramp-default-host'." | 1381 | `tramp-default-host-alist' and `tramp-default-host'." |
| 1369 | (let ((result | 1382 | (let ((result |
| 1370 | (or (and (> (length host) 0) host) | 1383 | (or (and (> (length host) 0) host) |
| @@ -1389,7 +1402,7 @@ The structure consists of method, user, domain, host, port, | |||
| 1389 | localname (file name on remote host), and hop. | 1402 | localname (file name on remote host), and hop. |
| 1390 | 1403 | ||
| 1391 | Unless NODEFAULT is non-nil, method, user and host are expanded | 1404 | Unless NODEFAULT is non-nil, method, user and host are expanded |
| 1392 | to their default values. For the other file name parts, no | 1405 | to their default values. For the other file name parts, no |
| 1393 | default values are used." | 1406 | default values are used." |
| 1394 | (save-match-data | 1407 | (save-match-data |
| 1395 | (unless (tramp-tramp-file-p name) | 1408 | (unless (tramp-tramp-file-p name) |
| @@ -1564,7 +1577,8 @@ necessary only. This function will be used in file name completion." | |||
| 1564 | (when localname localname))) | 1577 | (when localname localname))) |
| 1565 | 1578 | ||
| 1566 | (defun tramp-get-buffer (vec &optional dont-create) | 1579 | (defun tramp-get-buffer (vec &optional dont-create) |
| 1567 | "Get the connection buffer to be used for VEC." | 1580 | "Get the connection buffer to be used for VEC. |
| 1581 | Unless DONT-CREATE, the buffer is created when it doesn't exist yet." | ||
| 1568 | (or (get-buffer (tramp-buffer-name vec)) | 1582 | (or (get-buffer (tramp-buffer-name vec)) |
| 1569 | (unless dont-create | 1583 | (unless dont-create |
| 1570 | (with-current-buffer (get-buffer-create (tramp-buffer-name vec)) | 1584 | (with-current-buffer (get-buffer-create (tramp-buffer-name vec)) |
| @@ -1580,6 +1594,7 @@ necessary only. This function will be used in file name completion." | |||
| 1580 | 1594 | ||
| 1581 | (defun tramp-get-connection-buffer (vec &optional dont-create) | 1595 | (defun tramp-get-connection-buffer (vec &optional dont-create) |
| 1582 | "Get the connection buffer to be used for VEC. | 1596 | "Get the connection buffer to be used for VEC. |
| 1597 | Unless DONT-CREATE, the buffer is created when it doesn't exist yet. | ||
| 1583 | In case a second asynchronous communication has been started, it is different | 1598 | In case a second asynchronous communication has been started, it is different |
| 1584 | from `tramp-get-buffer'." | 1599 | from `tramp-get-buffer'." |
| 1585 | (or (tramp-get-connection-property vec "process-buffer" nil) | 1600 | (or (tramp-get-connection-property vec "process-buffer" nil) |
| @@ -1666,7 +1681,7 @@ The outline level is equal to the verbosity of the Tramp message." | |||
| 1666 | (current-buffer))) | 1681 | (current-buffer))) |
| 1667 | 1682 | ||
| 1668 | (defsubst tramp-debug-message (vec fmt-string &rest arguments) | 1683 | (defsubst tramp-debug-message (vec fmt-string &rest arguments) |
| 1669 | "Append message to debug buffer. | 1684 | "Append message to debug buffer of VEC. |
| 1670 | Message is formatted with FMT-STRING as control string and the remaining | 1685 | Message is formatted with FMT-STRING as control string and the remaining |
| 1671 | ARGUMENTS to actually emit the message (if applicable)." | 1686 | ARGUMENTS to actually emit the message (if applicable)." |
| 1672 | (with-current-buffer (tramp-get-debug-buffer vec) | 1687 | (with-current-buffer (tramp-get-debug-buffer vec) |
| @@ -1803,7 +1818,8 @@ function is meant for debugging purposes." | |||
| 1803 | "Emit an error. | 1818 | "Emit an error. |
| 1804 | VEC-OR-PROC identifies the connection to use, SIGNAL is the | 1819 | VEC-OR-PROC identifies the connection to use, SIGNAL is the |
| 1805 | signal identifier to be raised, remaining arguments passed to | 1820 | signal identifier to be raised, remaining arguments passed to |
| 1806 | `tramp-message'. Finally, signal SIGNAL is raised." | 1821 | `tramp-message'. Finally, signal SIGNAL is raised with |
| 1822 | FMT-STRING and ARGUMENTS." | ||
| 1807 | (let (tramp-message-show-message signal-hook-function) | 1823 | (let (tramp-message-show-message signal-hook-function) |
| 1808 | (tramp-backtrace vec-or-proc) | 1824 | (tramp-backtrace vec-or-proc) |
| 1809 | (unless arguments | 1825 | (unless arguments |
| @@ -1989,7 +2005,7 @@ FILE must be a local file name on a connection identified via VEC." | |||
| 1989 | (font-lock-add-keywords 'emacs-lisp-mode '("\\<with-tramp-file-property\\>")) | 2005 | (font-lock-add-keywords 'emacs-lisp-mode '("\\<with-tramp-file-property\\>")) |
| 1990 | 2006 | ||
| 1991 | (defmacro with-tramp-connection-property (key property &rest body) | 2007 | (defmacro with-tramp-connection-property (key property &rest body) |
| 1992 | "Check in Tramp for property PROPERTY, otherwise executes BODY and set." | 2008 | "Check in Tramp for property PROPERTY, otherwise execute BODY and set." |
| 1993 | `(let ((value (tramp-get-connection-property ,key ,property 'undef))) | 2009 | `(let ((value (tramp-get-connection-property ,key ,property 'undef))) |
| 1994 | (when (eq value 'undef) | 2010 | (when (eq value 'undef) |
| 1995 | ;; We cannot pass ,@body as parameter to | 2011 | ;; We cannot pass ,@body as parameter to |
| @@ -2120,8 +2136,8 @@ coding system might not be determined. This function repairs it." | |||
| 2120 | 2136 | ||
| 2121 | (defun tramp-run-real-handler (operation args) | 2137 | (defun tramp-run-real-handler (operation args) |
| 2122 | "Invoke normal file name handler for OPERATION. | 2138 | "Invoke normal file name handler for OPERATION. |
| 2123 | First arg specifies the OPERATION, second arg is a list of arguments to | 2139 | First arg specifies the OPERATION, second arg ARGS is a list of |
| 2124 | pass to the OPERATION." | 2140 | arguments to pass to the OPERATION." |
| 2125 | (let* ((inhibit-file-name-handlers | 2141 | (let* ((inhibit-file-name-handlers |
| 2126 | `(tramp-file-name-handler | 2142 | `(tramp-file-name-handler |
| 2127 | tramp-vc-file-name-handler | 2143 | tramp-vc-file-name-handler |
| @@ -2228,7 +2244,7 @@ Must be handled by the callers." | |||
| 2228 | (with-current-buffer (process-buffer (nth 0 args)) | 2244 | (with-current-buffer (process-buffer (nth 0 args)) |
| 2229 | default-directory))) | 2245 | default-directory))) |
| 2230 | ;; Unknown file primitive. | 2246 | ;; Unknown file primitive. |
| 2231 | (t (error "unknown file I/O primitive: %s" operation)))) | 2247 | (t (error "Unknown file I/O primitive: %s" operation)))) |
| 2232 | 2248 | ||
| 2233 | (defun tramp-find-foreign-file-name-handler (filename &optional _operation) | 2249 | (defun tramp-find-foreign-file-name-handler (filename &optional _operation) |
| 2234 | "Return foreign file name handler if exists." | 2250 | "Return foreign file name handler if exists." |
| @@ -2272,7 +2288,7 @@ preventing reentrant calls of Tramp.") | |||
| 2272 | 2288 | ||
| 2273 | ;; Main function. | 2289 | ;; Main function. |
| 2274 | (defun tramp-file-name-handler (operation &rest args) | 2290 | (defun tramp-file-name-handler (operation &rest args) |
| 2275 | "Invoke Tramp file name handler. | 2291 | "Invoke Tramp file name handler for OPERATION and ARGS. |
| 2276 | Fall back to normal file name handler if no Tramp file name handler exists." | 2292 | Fall back to normal file name handler if no Tramp file name handler exists." |
| 2277 | (let ((filename (apply #'tramp-file-name-for-operation operation args)) | 2293 | (let ((filename (apply #'tramp-file-name-for-operation operation args)) |
| 2278 | ;; `file-remote-p' is called for everything, even for symbolic | 2294 | ;; `file-remote-p' is called for everything, even for symbolic |
| @@ -2370,7 +2386,7 @@ Fall back to normal file name handler if no Tramp file name handler exists." | |||
| 2370 | (tramp-run-real-handler operation args)))) | 2386 | (tramp-run-real-handler operation args)))) |
| 2371 | 2387 | ||
| 2372 | (defun tramp-completion-file-name-handler (operation &rest args) | 2388 | (defun tramp-completion-file-name-handler (operation &rest args) |
| 2373 | "Invoke Tramp file name completion handler. | 2389 | "Invoke Tramp file name completion handler for OPERATION and ARGS. |
| 2374 | Falls back to normal file name handler if no Tramp file name handler exists." | 2390 | Falls back to normal file name handler if no Tramp file name handler exists." |
| 2375 | (let ((fn (assoc operation tramp-completion-file-name-handler-alist))) | 2391 | (let ((fn (assoc operation tramp-completion-file-name-handler-alist))) |
| 2376 | (if (and fn tramp-mode) | 2392 | (if (and fn tramp-mode) |
| @@ -2614,7 +2630,7 @@ not in completion mode." | |||
| 2614 | ;; Method, host name and user name completion for a file. | 2630 | ;; Method, host name and user name completion for a file. |
| 2615 | (defun tramp-completion-handle-file-name-completion | 2631 | (defun tramp-completion-handle-file-name-completion |
| 2616 | (filename directory &optional predicate) | 2632 | (filename directory &optional predicate) |
| 2617 | "Like `file-name-completion' for Tramp files." | 2633 | "Like `file-name-completion' for partial Tramp files." |
| 2618 | ;; Suppress eager completion on not connected hosts. | 2634 | ;; Suppress eager completion on not connected hosts. |
| 2619 | (let ((non-essential t)) | 2635 | (let ((non-essential t)) |
| 2620 | (try-completion | 2636 | (try-completion |
| @@ -2641,7 +2657,7 @@ not in completion mode." | |||
| 2641 | ;; "/x:y@""/[x/y@" "/x:y@z" "/[x/y@z" "/x:y@z:" "/[x/y@z]" | 2657 | ;; "/x:y@""/[x/y@" "/x:y@z" "/[x/y@z" "/x:y@z:" "/[x/y@z]" |
| 2642 | ;;["x" "y" nil nil] ["x" "y" "z" nil] ["x" "y" "z" ""] | 2658 | ;;["x" "y" nil nil] ["x" "y" "z" nil] ["x" "y" "z" ""] |
| 2643 | (defun tramp-completion-dissect-file-name (name) | 2659 | (defun tramp-completion-dissect-file-name (name) |
| 2644 | "Return a list of `tramp-file-name' structures. | 2660 | "Return a list of `tramp-file-name' structures for NAME. |
| 2645 | They are collected by `tramp-completion-dissect-file-name1'." | 2661 | They are collected by `tramp-completion-dissect-file-name1'." |
| 2646 | (let* ((x-nil "\\|\\(\\)") | 2662 | (let* ((x-nil "\\|\\(\\)") |
| 2647 | (tramp-completion-ipv6-regexp | 2663 | (tramp-completion-ipv6-regexp |
| @@ -2714,7 +2730,7 @@ They are collected by `tramp-completion-dissect-file-name1'." | |||
| 2714 | tramp-completion-file-name-structure6))))) | 2730 | tramp-completion-file-name-structure6))))) |
| 2715 | 2731 | ||
| 2716 | (defun tramp-completion-dissect-file-name1 (structure name) | 2732 | (defun tramp-completion-dissect-file-name1 (structure name) |
| 2717 | "Return a `tramp-file-name' structure matching STRUCTURE. | 2733 | "Return a `tramp-file-name' structure for NAME matching STRUCTURE. |
| 2718 | The structure consists of remote method, remote user, | 2734 | The structure consists of remote method, remote user, |
| 2719 | remote host and localname (filename on remote host)." | 2735 | remote host and localname (filename on remote host)." |
| 2720 | (save-match-data | 2736 | (save-match-data |
| @@ -3161,7 +3177,7 @@ User is always nil." | |||
| 3161 | 3177 | ||
| 3162 | ;; Localname manipulation functions that grok Tramp localnames... | 3178 | ;; Localname manipulation functions that grok Tramp localnames... |
| 3163 | (defun tramp-handle-file-name-as-directory (file) | 3179 | (defun tramp-handle-file-name-as-directory (file) |
| 3164 | "Like `file-name-as-directory' but aware of Tramp files." | 3180 | "Like `file-name-as-directory' for Tramp files." |
| 3165 | ;; `file-name-as-directory' would be sufficient except localname is | 3181 | ;; `file-name-as-directory' would be sufficient except localname is |
| 3166 | ;; the empty string. | 3182 | ;; the empty string. |
| 3167 | (let ((v (tramp-dissect-file-name file t))) | 3183 | (let ((v (tramp-dissect-file-name file t))) |
| @@ -3248,7 +3264,7 @@ User is always nil." | |||
| 3248 | (try-completion filename hits-ignored-extensions)))) | 3264 | (try-completion filename hits-ignored-extensions)))) |
| 3249 | 3265 | ||
| 3250 | (defun tramp-handle-file-name-directory (file) | 3266 | (defun tramp-handle-file-name-directory (file) |
| 3251 | "Like `file-name-directory' but aware of Tramp files." | 3267 | "Like `file-name-directory' for Tramp files." |
| 3252 | ;; Everything except the last filename thing is the directory. We | 3268 | ;; Everything except the last filename thing is the directory. We |
| 3253 | ;; cannot apply `with-parsed-tramp-file-name', because this expands | 3269 | ;; cannot apply `with-parsed-tramp-file-name', because this expands |
| 3254 | ;; the remote file name parts. | 3270 | ;; the remote file name parts. |
| @@ -3261,7 +3277,7 @@ User is always nil." | |||
| 3261 | 'noloc)))) | 3277 | 'noloc)))) |
| 3262 | 3278 | ||
| 3263 | (defun tramp-handle-file-name-nondirectory (file) | 3279 | (defun tramp-handle-file-name-nondirectory (file) |
| 3264 | "Like `file-name-nondirectory' but aware of Tramp files." | 3280 | "Like `file-name-nondirectory' for Tramp files." |
| 3265 | (with-parsed-tramp-file-name file nil | 3281 | (with-parsed-tramp-file-name file nil |
| 3266 | (tramp-run-real-handler #'file-name-nondirectory (list localname)))) | 3282 | (tramp-run-real-handler #'file-name-nondirectory (list localname)))) |
| 3267 | 3283 | ||
| @@ -4291,7 +4307,7 @@ If both files are local, the function returns t." | |||
| 4291 | (string-equal (file-remote-p file1) (file-remote-p file2))))) | 4307 | (string-equal (file-remote-p file1) (file-remote-p file2))))) |
| 4292 | 4308 | ||
| 4293 | (defun tramp-mode-string-to-int (mode-string) | 4309 | (defun tramp-mode-string-to-int (mode-string) |
| 4294 | "Convert a ten-letter `drwxrwxrwx'-style mode string into mode bits." | 4310 | "Convert a ten-letter \"drwxrwxrwx\"-style MODE-STRING into mode bits." |
| 4295 | (let* (case-fold-search | 4311 | (let* (case-fold-search |
| 4296 | (mode-chars (string-to-vector mode-string)) | 4312 | (mode-chars (string-to-vector mode-string)) |
| 4297 | (owner-read (aref mode-chars 1)) | 4313 | (owner-read (aref mode-chars 1)) |
| @@ -4370,7 +4386,7 @@ If both files are local, the function returns t." | |||
| 4370 | This is used to map a mode number to a permission string.") | 4386 | This is used to map a mode number to a permission string.") |
| 4371 | 4387 | ||
| 4372 | (defun tramp-file-mode-from-int (mode) | 4388 | (defun tramp-file-mode-from-int (mode) |
| 4373 | "Turn an integer representing a file mode into an ls(1)-like string." | 4389 | "Turn an integer representing a file MODE into an ls(1)-like string." |
| 4374 | (let ((type (cdr | 4390 | (let ((type (cdr |
| 4375 | (assoc (logand (ash mode -12) 15) tramp-file-mode-type-map))) | 4391 | (assoc (logand (ash mode -12) 15) tramp-file-mode-type-map))) |
| 4376 | (user (logand (ash mode -6) 7)) | 4392 | (user (logand (ash mode -6) 7)) |
diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index 9fe848dbbe2..64df1eeb8ba 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el | |||
| @@ -23,6 +23,11 @@ | |||
| 23 | ;; You should have received a copy of the GNU General Public License | 23 | ;; You should have received a copy of the GNU General Public License |
| 24 | ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. | 24 | ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. |
| 25 | 25 | ||
| 26 | ;;; Commentary: | ||
| 27 | |||
| 28 | ;; Convenience functions around the Tramp version. Partly generated | ||
| 29 | ;; during Tramp configuration. | ||
| 30 | |||
| 26 | ;;; Code: | 31 | ;;; Code: |
| 27 | 32 | ||
| 28 | ;; In the Tramp GIT, the version number is auto-frobbed from tramp.el, | 33 | ;; In the Tramp GIT, the version number is auto-frobbed from tramp.el, |
diff --git a/test/lisp/net/tramp-archive-tests.el b/test/lisp/net/tramp-archive-tests.el index 00d3b4a478a..80bc9ccaae2 100644 --- a/test/lisp/net/tramp-archive-tests.el +++ b/test/lisp/net/tramp-archive-tests.el | |||
| @@ -17,6 +17,10 @@ | |||
| 17 | ;; You should have received a copy of the GNU General Public License | 17 | ;; You should have received a copy of the GNU General Public License |
| 18 | ;; along with this program. If not, see `https://www.gnu.org/licenses/'. | 18 | ;; along with this program. If not, see `https://www.gnu.org/licenses/'. |
| 19 | 19 | ||
| 20 | ;;; Commentary: | ||
| 21 | |||
| 22 | ;; A testsuite for testing file archives. | ||
| 23 | |||
| 20 | ;;; Code: | 24 | ;;; Code: |
| 21 | 25 | ||
| 22 | ;; The `tramp-archive-testnn-*' tests correspond to the respective | 26 | ;; The `tramp-archive-testnn-*' tests correspond to the respective |
| @@ -959,7 +963,8 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'." | |||
| 959 | (tramp-archive-cleanup-hash))) | 963 | (tramp-archive-cleanup-hash))) |
| 960 | 964 | ||
| 961 | (defun tramp-archive-test-all (&optional interactive) | 965 | (defun tramp-archive-test-all (&optional interactive) |
| 962 | "Run all tests for \\[tramp-archive]." | 966 | "Run all tests for \\[tramp-archive]. |
| 967 | If INTERACTIVE is non-nil, the tests are run interactively." | ||
| 963 | (interactive "p") | 968 | (interactive "p") |
| 964 | (funcall | 969 | (funcall |
| 965 | (if interactive #'ert-run-tests-interactively #'ert-run-tests-batch) | 970 | (if interactive #'ert-run-tests-interactively #'ert-run-tests-batch) |
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 271ac7299dd..9b1af1b28bc 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -5146,7 +5146,8 @@ This does not support globbing characters in file names (yet)." | |||
| 5146 | 5146 | ||
| 5147 | (defun tramp--test-gvfs-p (&optional method) | 5147 | (defun tramp--test-gvfs-p (&optional method) |
| 5148 | "Check, whether the remote host runs a GVFS based method. | 5148 | "Check, whether the remote host runs a GVFS based method. |
| 5149 | This requires restrictions of file name syntax." | 5149 | This requires restrictions of file name syntax. |
| 5150 | If optional METHOD is given, it is checked first." | ||
| 5150 | (or (member method tramp-gvfs-methods) | 5151 | (or (member method tramp-gvfs-methods) |
| 5151 | (tramp-gvfs-file-name-p tramp-test-temporary-file-directory))) | 5152 | (tramp-gvfs-file-name-p tramp-test-temporary-file-directory))) |
| 5152 | 5153 | ||
| @@ -5661,6 +5662,7 @@ Use the `ls' command." | |||
| 5661 | 5662 | ||
| 5662 | (defmacro tramp--test-with-proper-process-name-and-buffer (proc &rest body) | 5663 | (defmacro tramp--test-with-proper-process-name-and-buffer (proc &rest body) |
| 5663 | "Set \"process-name\" and \"process-buffer\" connection properties. | 5664 | "Set \"process-name\" and \"process-buffer\" connection properties. |
| 5665 | The values are derived from PROC. Run BODY. | ||
| 5664 | This is needed in timer functions as well as process filters and sentinels." | 5666 | This is needed in timer functions as well as process filters and sentinels." |
| 5665 | (declare (indent 1) (debug (processp body))) | 5667 | (declare (indent 1) (debug (processp body))) |
| 5666 | `(let* ((v (tramp-get-connection-property ,proc "vector" nil)) | 5668 | `(let* ((v (tramp-get-connection-property ,proc "vector" nil)) |
| @@ -6054,7 +6056,8 @@ Since it unloads Tramp, it shall be the last test to run." | |||
| 6054 | (ert-fail (format "Hook `%s' still contains Tramp function" x)))))) | 6056 | (ert-fail (format "Hook `%s' still contains Tramp function" x)))))) |
| 6055 | 6057 | ||
| 6056 | (defun tramp-test-all (&optional interactive) | 6058 | (defun tramp-test-all (&optional interactive) |
| 6057 | "Run all tests for \\[tramp]." | 6059 | "Run all tests for \\[tramp]. |
| 6060 | If INTERACTIVE is non-nil, the tests are run interactively." | ||
| 6058 | (interactive "p") | 6061 | (interactive "p") |
| 6059 | (funcall | 6062 | (funcall |
| 6060 | (if interactive | 6063 | (if interactive |