]> git.eshelyaron.com Git - emacs.git/commitdiff
Some Tramp cleanup
authorMichael Albinus <michael.albinus@gmx.de>
Tue, 15 Feb 2022 15:15:55 +0000 (16:15 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Tue, 15 Feb 2022 15:15:55 +0000 (16:15 +0100)
* doc/misc/tramp.texi (Remote processes): Add also tramp-sshfs.el.

* lisp/net/tramp-adb.el (tramp-adb-handle-make-process):
Error-out for multi-byte `default-directory'.

* lisp/net/tramp.el (tramp-tolerate-tilde): Move it up.
(tramp-handle-abbreviate-file-name): Use it.
(tramp-read-passwd): Show literal passphrase prompt.

doc/misc/tramp.texi
lisp/net/tramp-adb.el
lisp/net/tramp-sshfs.el
lisp/net/tramp.el

index 8ee4ab24cd701d9573c1a1cbd0c790c40c3f322b..ec9f07dc9eeaf905862411368007c7315570e5ba 100644 (file)
@@ -3960,8 +3960,8 @@ Furthermore, this approach has the following limitations:
 
 @itemize
 @item
-It works only for connection methods defined in @file{tramp-sh.el} and
-@file{tramp-adb.el}.
+It works only for connection methods defined in @file{tramp-adb.el},
+@file{tramp-sh.el} and @file{tramp-sshfs.el}.
 
 @item
 It does not support interactive user authentication.  With
index c683f4c6e8ac6d992c7a110f410d6317ca360b5f..a61179958ca7d0dcb4931d5e4cf734cca7ae5122 100644 (file)
@@ -986,6 +986,10 @@ implementation will be used."
                 (name1 name)
                 (i 0))
 
+           (when (string-match-p "[[:multibyte:]]" command)
+             (tramp-error
+              v 'file-error "Cannot apply multi-byte command `%s'" command))
+
            (while (get-process name1)
              ;; NAME must be unique as process name.
              (setq i (1+ i)
@@ -1264,7 +1268,7 @@ connection if a previous connection has died for some reason."
        (if (zerop (length device))
            (tramp-error vec 'file-error "Device %s not connected" host))
        (with-tramp-progress-reporter vec 3 "Opening adb shell connection"
-         (let* ((coding-system-for-read 'utf-8-dos)  ; Is this correct?
+         (let* ((coding-system-for-read 'utf-8-dos) ; Is this correct?
                 (process-connection-type tramp-process-connection-type)
                 (args (if (> (length host) 0)
                           (list "-s" device "shell")
index 3f23b1a87865e4bb02794cbe4781fc8047677d56..40c02ccea0d50c454c79de26d7b4eebdc2478ce1 100644 (file)
@@ -240,7 +240,7 @@ arguments to pass to the OPERATION."
     (error "Implementation does not handle immediate return"))
 
   (with-parsed-tramp-file-name (expand-file-name default-directory) nil
-    (let ((coding-system-for-read 'utf-8-dos)  ; Is this correct?
+    (let ((coding-system-for-read 'utf-8-dos) ; Is this correct?
          (command
           (format
            "cd %s && exec %s"
index 3c06ad1630ada24a289afd77bc99a3d1ed5e4946..91c0efb48245431d01a100d18ae629367e38fd13 100644 (file)
@@ -3335,6 +3335,10 @@ User is always nil."
 (defvar tramp-handle-write-region-hook nil
   "Normal hook to be run at the end of `tramp-*-handle-write-region'.")
 
+(defvar tramp-tolerate-tilde nil
+  "Indicator, that not expandable tilde shall be tolerated.
+Let-bind it when necessary.")
+
 ;; `directory-abbrev-apply' and `directory-abbrev-make-regexp' exists
 ;; since Emacs 29.1.  Since this handler isn't called for older
 ;; Emacsen, it is save to invoke them via `tramp-compat-funcall'.
@@ -3342,6 +3346,7 @@ User is always nil."
   "Like `abbreviate-file-name' for Tramp files."
   (let* ((case-fold-search (file-name-case-insensitive-p filename))
         (vec (tramp-dissect-file-name filename))
+        (tramp-tolerate-tilde t)
          (home-dir
           (if (let ((non-essential t)) (tramp-connectable-p vec))
               ;; If a connection has already been established, make
@@ -3466,10 +3471,6 @@ User is always nil."
       (if (file-directory-p dir) dir (file-name-directory dir)) nil
     (tramp-flush-directory-properties v localname)))
 
-(defvar tramp-tolerate-tilde nil
-  "Indicator, that not expandable tilde shall be tolerated.
-Let-bind it when necessary.")
-
 (defun tramp-handle-expand-file-name (name &optional dir)
   "Like `expand-file-name' for Tramp files."
   ;; If DIR is not given, use DEFAULT-DIRECTORY or "/".
@@ -5756,7 +5757,9 @@ Consults the auth-source package."
          (or prompt
              (with-current-buffer (process-buffer proc)
                (tramp-check-for-regexp proc tramp-password-prompt-regexp)
-               (format "%s for %s " (capitalize (match-string 1)) key))))
+               (if (string-match-p "passphrase" (match-string 1))
+                   (match-string 0)
+                 (format "%s for %s " (capitalize (match-string 1)) key)))))
         (auth-source-creation-prompts `((secret . ,pw-prompt)))
         ;; Use connection-local value.
         (auth-sources (buffer-local-value 'auth-sources (process-buffer proc)))