Mercurial > emacs
comparison lisp/net/tramp.el @ 106643:9e3bbd77797c
* net/tramp.el (tramp-handle-insert-directory): Quote "'" in the
switches. Check also for //SUBDIRED// line.
author | Michael Albinus <michael.albinus@gmx.de> |
---|---|
date | Sat, 26 Dec 2009 20:04:43 +0000 |
parents | 291ea018e478 |
children | 1d1d5d9bd884 |
comparison
equal
deleted
inserted
replaced
106642:33320786e55e | 106643:9e3bbd77797c |
---|---|
36 ;; Notes: | 36 ;; Notes: |
37 ;; ----- | 37 ;; ----- |
38 ;; | 38 ;; |
39 ;; This package only works for Emacs 21.1 and higher, and for XEmacs 21.4 | 39 ;; This package only works for Emacs 21.1 and higher, and for XEmacs 21.4 |
40 ;; and higher. For XEmacs 21, you need the package `fsf-compat' for | 40 ;; and higher. For XEmacs 21, you need the package `fsf-compat' for |
41 ;; the `with-timeout' macro.) | 41 ;; the `with-timeout' macro. |
42 ;; | 42 ;; |
43 ;; Also see the todo list at the bottom of this file. | 43 ;; Also see the todo list at the bottom of this file. |
44 ;; | 44 ;; |
45 ;; The current version of Tramp can be retrieved from the following URL: | 45 ;; The current version of Tramp can be retrieved from the following URL: |
46 ;; http://ftp.gnu.org/gnu/tramp/ | 46 ;; http://ftp.gnu.org/gnu/tramp/ |
4077 (setq switches (mapconcat 'identity switches " "))) | 4077 (setq switches (mapconcat 'identity switches " "))) |
4078 (unless full-directory-p | 4078 (unless full-directory-p |
4079 (setq switches (concat "-d " switches))) | 4079 (setq switches (concat "-d " switches))) |
4080 (when wildcard | 4080 (when wildcard |
4081 (setq switches (concat switches " " wildcard))) | 4081 (setq switches (concat switches " " wildcard))) |
4082 (when (string-match "'" switches) | |
4083 (setq switches (replace-match "\\\\'" nil nil switches))) | |
4082 ;; If `full-directory-p', we just say `ls -l FILENAME'. | 4084 ;; If `full-directory-p', we just say `ls -l FILENAME'. |
4083 ;; Else we chdir to the parent directory, then say `ls -ld BASENAME'. | 4085 ;; Else we chdir to the parent directory, then say `ls -ld BASENAME'. |
4084 (if full-directory-p | 4086 (if full-directory-p |
4085 (tramp-send-command | 4087 (tramp-send-command |
4086 v | 4088 v |
4119 (with-current-buffer (tramp-get-buffer v) | 4121 (with-current-buffer (tramp-get-buffer v) |
4120 (buffer-string))) | 4122 (buffer-string))) |
4121 | 4123 |
4122 ;; Check for "--dired" output. | 4124 ;; Check for "--dired" output. |
4123 (forward-line -2) | 4125 (forward-line -2) |
4126 (when (looking-at "//SUBDIRED//") | |
4127 (forward-line -1)) | |
4124 (when (looking-at "//DIRED//") | 4128 (when (looking-at "//DIRED//") |
4125 (let ((end (tramp-compat-line-end-position)) | 4129 (let ((end (tramp-compat-line-end-position)) |
4126 (linebeg (point))) | 4130 (linebeg (point))) |
4127 ;; Now read the numeric positions of file names. | 4131 ;; Now read the numeric positions of file names. |
4128 (goto-char linebeg) | 4132 (goto-char linebeg) |