]> git.eshelyaron.com Git - emacs.git/commitdiff
Tramp cleanup
authorMichael Albinus <michael.albinus@gmx.de>
Thu, 30 Jan 2025 07:40:34 +0000 (08:40 +0100)
committerEshel Yaron <me@eshelyaron.com>
Thu, 30 Jan 2025 18:13:59 +0000 (19:13 +0100)
* doc/misc/tramp.texi (Predefined connection information):
Mention also "androidsu" as special case of "tmpdir".
(Remote processes): Signals are not delivered to remote direct
async processes.  Say, that there are restrictions for transfer of
binary data to remote direct async processes.

* lisp/net/tramp-compat.el (tramp-compat-temporary-file-directory):
Simplify.

(cherry picked from commit 6b3d69b16ed50c8a4dea1e3f1f9f231657e66590)

doc/misc/tramp.texi
lisp/net/tramp-cache.el
lisp/net/tramp-compat.el
lisp/net/tramp-smb.el
lisp/net/tramp.el

index 74adea57d23541e1bca73b1b5c053031b91b4798..3108e398b0ffcc529a36930e9f4fe2ed6e6b6b33 100644 (file)
@@ -2378,9 +2378,9 @@ to a remote home directory, like @option{adb}, @option{rclone} and
 @item @t{"tmpdir"}
 
 The temporary directory on the remote host.  If not specified, the
-default value is @t{"/data/local/tmp"} for the @option{adb} method,
-@t{"/C$/Temp"} for the @option{smb} method, and @t{"/tmp"} otherwise.
-@xref{Temporary directory}.
+default value is @t{"/data/local/tmp"} for the @option{adb} and
+@option{androidsu} methods, @t{"/C$/Temp"} for the @option{smb}
+method, and @t{"/tmp"} otherwise.  @xref{Temporary directory}.
 
 @item @t{"posix"}
 
@@ -4680,7 +4680,9 @@ It cannot be killed via @code{interrupt-process}.
 It does not report the remote terminal name via @code{process-tty-name}.
 
 @item
-It does not set process property @code{remote-pid}.
+It does not set process property @code{remote-pid}.  Consequently,
+signals cannot be sent to that remote process; they are sent to the
+local process instead, which establishes the connection.
 
 @item
 It fails, when the command is too long.  This can happen on
@@ -4702,6 +4704,15 @@ by the connection property @t{"direct-async-process"}.  This is still
 supported but deprecated, and it will be removed in a future
 @value{tramp} version.
 
+@strong{Note}: For the @option{ssh} and @option{scp} methods,
+@value{tramp} does not faithfully pass binary sequences on to the
+process.  You can change this by changing the respective connection
+argument (@pxref{Predefined connection information}) via
+
+@lisp
+(add-to-list 'tramp-connection-properties (list "/ssh:" "direct-async" t))
+@end lisp
+
 
 @node Cleanup remote connections
 @section Cleanup remote connections
index 1625eb8e8f9182756ef86fd8e08f916c20cff116..caa5d3c2d017709ebbe642e61afa93a6f373c64f 100644 (file)
 
 ;; Some properties are handled special:
 ;;
-;; - Properties which start with a space, like " process-name", are
-;;   not saved in the file `tramp-persistency-file-name', although
-;;   being connection properties related to a `tramp-file-name'
-;;   structure.
+;; - Ephemeral properties which start with a space, like
+;;   " process-name", are not saved in the file
+;;   `tramp-persistency-file-name', although being connection
+;;   properties related to a `tramp-file-name' structure.
 ;;
 ;; - Reusable properties, which should not be saved, are kept in the
 ;;   process key retrieved by `tramp-get-process' (the main connection
@@ -79,6 +79,7 @@
 ;;   recomputation when a new asynchronous process is created by
 ;;   `make-process'.  Examples are "unsafe-temporary-file",
 ;;   "remote-path", "device" (tramp-adb.el) or "share" (tramp-gvfs.el).
+;;   FIXME: Shall they be converted to ephemeral connection properties?
 
 ;;; Code:
 
index ed42ac4fe4c3258d90fbe1699c5a896ac7d6cfee..d30c9b8cca071a9ff28f39033ca1871ed2baa0ba 100644 (file)
 ;; an infloop.  We try to follow the XDG specification, for security reasons.
 (defconst tramp-compat-temporary-file-directory
   (file-name-as-directory
-   (if-let ((xdg (xdg-cache-home))
-           ((file-directory-p xdg))
-           ((file-writable-p xdg)))
-       (prog1 (setq xdg (file-name-concat xdg "emacs"))
+   (if-let* ((xdg (xdg-cache-home))
+            ((file-directory-p xdg))
+            ((file-writable-p xdg)))
+       (prog1 (setq xdg (expand-file-name "emacs" xdg))
         (make-directory xdg t))
      (eval (car (get 'temporary-file-directory 'standard-value)) t)))
   "The default value of `temporary-file-directory' for Tramp.")
@@ -243,6 +243,8 @@ value is the default binding of the variable."
 ;;   are developers using `outline-minor-mode' in Lisp files, we still
 ;;   keep this quoting.
 ;;
+;; * Use `with-environment-variables'.
+;;
 ;; * Starting with Emacs 29.1, use `buffer-match-p'.
 ;;
 ;; * Starting with Emacs 29.1, use `string-split'.
index 9f48e2583834b91c55a79783ec8ec6d2b39aca5a..37633b8ef71d6e923fd3665e182d40aabdc61735 100644 (file)
@@ -737,7 +737,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
        (tramp-error v 'file-error "Cannot expand tilde in file `%s'" name))
       (unless (tramp-run-real-handler #'file-name-absolute-p (list localname))
        (setq localname (concat "/" localname)))
-     ;; Do not keep "/..".
+      ;; Do not keep "/..".
       (when (string-match-p (rx bos "/" (** 1 2 ".") eos) localname)
        (setq localname "/"))
       ;; Do normal `expand-file-name' (this does "/./" and "/../"),
index 25d977fd4f1c0bea1036241944e8decd0333e89a..dd525fbd01bc10111f4ed5c0c4ac213bc639b19b 100644 (file)
@@ -7200,5 +7200,11 @@ If VEC is `tramp-null-hop', return local null device."
 ;;
 ;; * Implement user and host name completion for multi-hops.  Some
 ;;   methods in tramp-container.el have it already.
+;;
+;; * Make it configurable, which environment variables are set in
+;;   direct async processes.
+;;
+;; * Pass working dir for direct async processes, for example for
+;;   container methods.
 
 ;;; tramp.el ends here