]> code.delx.au - gnu-emacs/commitdiff
* net/tramp.el (tramp-tramp-file-p): Fix docstring.
authorMichael Albinus <michael.albinus@gmx.de>
Fri, 22 Feb 2013 14:05:38 +0000 (15:05 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Fri, 22 Feb 2013 14:05:38 +0000 (15:05 +0100)
* net/tramp-sh.el (tramp-sh-handle-insert-directory): Handle
multibyte file names.

lisp/ChangeLog
lisp/net/tramp-sh.el
lisp/net/tramp.el

index c6c9d93ed97028d43b50e927d726e5f232d59a0b..6496fe998d3b138519e0a2dae747b04738e8359a 100644 (file)
@@ -1,3 +1,10 @@
+2013-02-22  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/tramp.el (tramp-tramp-file-p): Fix docstring.
+
+       * net/tramp-sh.el (tramp-sh-handle-insert-directory): Handle
+       multibyte file names.
+
 2013-02-22  Glenn Morris  <rgm@gnu.org>
 
        * textmodes/sgml-mode.el (sgml-xml-mode): Move before use.
index 82cbda5708627e05ba88a70a913e37c5b23665c1..f2dc514116ab63b4852a1af6a60f14d0ef3445cb 100644 (file)
@@ -2606,10 +2606,13 @@ This is like `dired-recursive-delete-directory' for Tramp files."
        (if full-directory-p "yes" "no"))
       ;; If `full-directory-p', we just say `ls -l FILENAME'.
       ;; Else we chdir to the parent directory, then say `ls -ld BASENAME'.
+      ;; "--dired" returns byte positions.  Therefore, the file names
+      ;; must be encoded, which is guaranteed by "LC_ALL=en_US.UTF8
+      ;; LC_CTYPE=''".
       (if full-directory-p
          (tramp-send-command
           v
-          (format "%s %s %s 2>/dev/null"
+          (format "env LC_ALL=en_US.UTF8 LC_CTYPE='' %s %s %s 2>/dev/null"
                   (tramp-get-ls-command v)
                   switches
                   (if wildcard
@@ -2625,7 +2628,7 @@ This is like `dired-recursive-delete-directory' for Tramp files."
          (tramp-run-real-handler 'file-name-directory (list localname))))
        (tramp-send-command
         v
-        (format "%s %s %s"
+        (format "env LC_ALL=en_US.UTF8 LC_CTYPE='' %s %s %s"
                 (tramp-get-ls-command v)
                 switches
                 (if (or wildcard
@@ -2671,6 +2674,11 @@ This is like `dired-recursive-delete-directory' for Tramp files."
          (while (re-search-forward tramp-color-escape-sequence-regexp nil t)
            (replace-match "")))
 
+       ;; Decode the output, it could be multibyte.
+       (decode-coding-region
+        beg (point-max)
+        (or file-name-coding-system default-file-name-coding-system))
+
        ;; The inserted file could be from somewhere else.
        (when (and (not wildcard) (not full-directory-p))
          (goto-char (point-max))
index 4bfe541f053de967bfba80dc9c65fa97e4e89ab0..fe4959715d58393a492ee021bebbc2317451b853 100644 (file)
@@ -1166,11 +1166,9 @@ If the `tramp-methods' entry does not exist, return nil."
 
 ;;;###tramp-autoload
 (defun tramp-tramp-file-p (name)
-  "Return t if NAME is a string with Tramp file name syntax.
-It checks also, whether NAME is unibyte encoded."
+  "Return t if NAME is a string with Tramp file name syntax."
   (save-match-data
     (and (stringp name)
-;       (string-equal name (string-as-unibyte name))
         (string-match tramp-file-name-regexp name))))
 
 (defun tramp-find-method (method user host)
@@ -1354,7 +1352,7 @@ The outline level is equal to the verbosity of the Tramp message."
       (get-buffer-create (tramp-debug-buffer-name vec))
     (when (bobp)
       (setq buffer-undo-list t)
-      ;; So it does not get loaded while outline-regexp is let-bound.
+      ;; So it does not get loaded while `outline-regexp' is let-bound.
       (require 'outline)
       ;; Activate `outline-mode'.  This runs `text-mode-hook' and
       ;; `outline-mode-hook'.  We must prevent that local processes