From 29bb19dc10d3bd1a79150ff87f8f6a773d894654 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Fri, 22 Feb 2013 15:05:38 +0100 Subject: [PATCH] * net/tramp.el (tramp-tramp-file-p): Fix docstring. * net/tramp-sh.el (tramp-sh-handle-insert-directory): Handle multibyte file names. --- lisp/ChangeLog | 7 +++++++ lisp/net/tramp-sh.el | 12 ++++++++++-- lisp/net/tramp.el | 6 ++---- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c6c9d93ed97..6496fe998d3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2013-02-22 Michael Albinus + + * 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 * textmodes/sgml-mode.el (sgml-xml-mode): Move before use. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 82cbda57086..f2dc514116a 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -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)) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 4bfe541f053..fe4959715d5 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -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 -- 2.39.2