* doc/misc/tramp.texi (Remote processes): Adapt index.
* lisp/net/tramp.el (tramp-skeleton-directory-files)
(tramp-skeleton-make-symbolic-link):
* lisp/net/tramp-cache.el (with-tramp-saved-file-property)
(with-tramp-saved-file-properties)
(with-tramp-saved-connection-property)
(with-tramp-saved-connection-properties): Use `setf' but `setq' in macro.
* lisp/net/tramp-compat.el (tramp-compat-funcall): Declare debug.
* lisp/net/tramp-crypt.el (tramp-crypt-file-name-p): Exclude lock files.
(tramp-crypt-file-name-handler-alist): Use `identity' for
`abbreviate-file-name'.
(tramp-crypt-add-directory, tramp-crypt-remove-directory):
Adapt docstrings.
(tramp-crypt-cleanup-connection): New defun. Add it to
`tramp-cleanup-connection-hook'
* lisp/net/tramp-sh.el (tramp-sh-extra-args): Extend regexp.
Each involved method must be an inline method (@pxref{Inline methods}).
@value{tramp} adds the ad-hoc definitions on the fly to
-@code{tramp-default-proxies-alist} and is available for re-use during
+@code{tramp-default-proxies-alist} and is available for reuse during
that Emacs session. Subsequent @value{tramp} connections to the same
remote host can then use the shortcut form:
@samp{@trampfn{ssh,you@@remotehost,/path}}.
@subsection Remote process connection type
@vindex process-connection-type
-@cindex tramp-process-connection-type
+@vindex tramp-process-connection-type
Asynchronous processes behave differently based on whether they use a
pseudo tty or not. This is controlled by the variable
@end group
@end lisp
-@cindex proced
+@cindex @code{proced}
@vindex proced-show-remote-processes
If you want to see a listing of remote system processes when calling
@code{proced}, set user option @code{proced-show-remote-processes} to
(declare (indent 3) (debug t))
`(progn
;; Unify localname. Remove hop from `tramp-file-name' structure.
- (setq ,key (tramp-file-name-unify ,key ,file))
+ (setf ,key (tramp-file-name-unify ,key ,file))
(let* ((hash (tramp-get-hash-table ,key))
(cached (and (hash-table-p hash) (gethash ,property hash))))
(unwind-protect (progn ,@body)
(declare (indent 3) (debug t))
`(progn
;; Unify localname. Remove hop from `tramp-file-name' structure.
- (setq ,key (tramp-file-name-unify ,key ,file))
+ (setf ,key (tramp-file-name-unify ,key ,file))
(let* ((hash (tramp-get-hash-table ,key))
(values
(and (hash-table-p hash)
"Save PROPERTY, run BODY, reset PROPERTY."
(declare (indent 2) (debug t))
`(progn
- (setq ,key (tramp-file-name-unify ,key))
+ (setf ,key (tramp-file-name-unify ,key))
(let* ((hash (tramp-get-hash-table ,key))
(cached (and (hash-table-p hash)
(gethash ,property hash tramp-cache-undefined))))
PROPERTIES is a list of file properties (strings)."
(declare (indent 2) (debug t))
`(progn
- (setq ,key (tramp-file-name-unify ,key))
+ (setf ,key (tramp-file-name-unify ,key))
(let* ((hash (tramp-get-hash-table ,key))
(values
(mapcar
;; avoid them in cases we know what we do.
(defmacro tramp-compat-funcall (function &rest arguments)
"Call FUNCTION with ARGUMENTS if it exists. Do not raise compiler warnings."
+ (declare (indent 1) (debug t))
`(when (functionp ,function)
(with-no-warnings (funcall ,function ,@arguments))))
(and tramp-crypt-enabled (stringp name)
(not (file-name-quoted-p name))
(not (string-suffix-p tramp-crypt-encfs-config name))
+ ;; No lock file name.
+ (not (string-prefix-p ".#" (file-name-nondirectory name)))
(dolist (dir tramp-crypt-directories)
(and (string-prefix-p
dir (file-name-as-directory (expand-file-name name)))
;; New handlers should be added here.
;;;###tramp-autoload
(defconst tramp-crypt-file-name-handler-alist
- '(;; `abbreviate-file-name' performed by default handler.
+ '((abbreviate-file-name . identity)
(access-file . tramp-crypt-handle-access-file)
(add-name-to-file . tramp-handle-add-name-to-file)
;; `byte-compiler-base-file-name' performed by default handler.
;;;###tramp-autoload
(defun tramp-crypt-add-directory (name)
- "Mark remote directory NAME for encryption.
+ "Mark expanded remote directory NAME for encryption.
Files in that directory and all subdirectories will be encrypted
before copying to, and decrypted after copying from that
directory. File names will be also encrypted."
#'tramp-crypt-command-completion-p)
(defun tramp-crypt-remove-directory (name)
- "Unmark remote directory NAME for encryption.
+ "Unmark expanded remote directory NAME for encryption.
Existing files in that directory and its subdirectories will be
kept in their encrypted form."
;; (declare (completion tramp-crypt-command-completion-p))
(tramp-compat-funcall
'unlock-file (tramp-crypt-encrypt-file-name filename))))
+(defun tramp-crypt-cleanup-connection (vec)
+ "Cleanup crypt ressources determined by VEC."
+ (let ((tramp-cleanup-connection-hook
+ (remove
+ #'tramp-crypt-cleanup-connection tramp-cleanup-connection-hook)))
+ (dolist (dir tramp-crypt-directories)
+ (when (tramp-file-name-equal-p vec (tramp-dissect-file-name dir))
+ (tramp-cleanup-connection (tramp-crypt-dissect-file-name dir))))))
+
+;; Add cleanup hooks.
+(add-hook 'tramp-cleanup-connection-hook #'tramp-crypt-cleanup-connection)
+(add-hook 'tramp-crypt-unload-hook
+ (lambda ()
+ (remove-hook 'tramp-cleanup-connection-hook
+ #'tramp-crypt-cleanup-connection)))
+
(with-eval-after-load 'bookmark
(add-hook 'bookmark-inhibit-context-functions
#'tramp-crypt-file-name-p)
(tramp-set-completion-function "fcp" tramp-completion-function-alist-ssh))
(defcustom tramp-sh-extra-args
- `((,(rx "/bash" eos) . "-noediting -norc -noprofile")
- (,(rx "/zsh" eos) . "-f +Z -V"))
+ `((,(rx (| bos "/") "bash" eos) . "-noediting -norc -noprofile")
+ (,(rx (| bos "/") "zsh" eos) . "-f +Z -V"))
"Alist specifying extra arguments to pass to the remote shell.
Entries are (REGEXP . ARGS) where REGEXP is a regular expression
matching the shell file name and ARGS is a string specifying the
for tilde expansion. The extra arguments should typically prevent the
shell from reading its init file."
:group 'tramp
- :version "27.1"
+ :version "30.1"
:type '(alist :key-type regexp :value-type string))
(defconst tramp-actions-before-shell
(tramp-get-connection-name v)
(tramp-get-connection-buffer v)
copy-program copy-args)))
- ;; This is neded for ssh or PuTTY based processes, and
+ ;; This is needed for ssh or PuTTY based processes, and
;; only if the respective options are set. Perhaps,
;; the setting could be more fine-grained.
;; (process-put p 'tramp-shared-socket t)
v 'file-notify-error
"`%s' failed to start on remote host"
(string-join sequence " "))
- ;; This is neded for ssh or PuTTY based processes, and only if
+ ;; This is needed for ssh or PuTTY based processes, and only if
;; the respective options are set. Perhaps, the setting could
;; be more fine-grained.
;; (process-put p 'tramp-shared-socket t)
(and tramp-encoding-command-interactive
`(,tramp-encoding-command-interactive)))))))
- ;; This is neded for ssh or PuTTY based processes,
+ ;; This is needed for ssh or PuTTY based processes,
;; and only if the respective options are set.
;; Perhaps, the setting could be more fine-grained.
;; (process-put p 'tramp-shared-socket t)
(with-parsed-tramp-file-name (expand-file-name ,directory) nil
(tramp-barf-if-file-missing v ,directory
(when (file-directory-p ,directory)
- (setq ,directory
+ (setf ,directory
(file-name-as-directory (expand-file-name ,directory)))
(let ((temp
(with-tramp-file-property v localname "directory-files" ,@body))
(let ((non-essential t))
(when (and (tramp-tramp-file-p ,target)
(tramp-file-name-equal-p v (tramp-dissect-file-name ,target)))
- (setq ,target (tramp-file-local-name (expand-file-name ,target))))
+ (setf ,target (tramp-file-local-name (expand-file-name ,target))))
;; There could be a cyclic link.
(tramp-flush-file-properties
v (expand-file-name ,target (tramp-file-local-name default-directory))))
;; Query flag is overwritten in `tramp-post-process-creation',
;; so we reset it.
(set-process-query-on-exit-flag p (null noquery))
- ;; This is neded for ssh or PuTTY based processes, and
+ ;; This is needed for ssh or PuTTY based processes, and
;; only if the respective options are set. Perhaps, the
;; setting could be more fine-grained.
;; (process-put p 'tramp-shared-socket t)