summaryrefslogtreecommitdiff
path: root/lisp/net/tramp-smb.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2014-02-19 20:24:32 +0100
committerMichael Albinus <michael.albinus@gmx.de>2014-02-19 20:24:32 +0100
commit50bfdd5d78aa015d9032da7e6376665243f3f3b1 (patch)
tree0a5f65cdd2f87aa4674e47231df76ebba5c9ccd8 /lisp/net/tramp-smb.el
parentd34f67dae3caa277bfebe0aa9f60e83a22bce0eb (diff)
downloademacs-50bfdd5d78aa015d9032da7e6376665243f3f3b1.tar.gz
Some Tramp minor fixes, found during test campaign.
* net/tramp-adb.el (tramp-adb-file-name-handler-alist) [make-symbolic-link]: Use `tramp-handle-make-symbolic-link'. * net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist) [make-symbolic-link]: Use `tramp-handle-make-symbolic-link'. (tramp-gvfs-maybe-open-connection): Set always connection properties, even if target is mounted already. * net/tramp-sh.el (tramp-color-escape-sequence-regexp): Set tramp-autoload cookie. (tramp-get-remote-touch): New defun. (tramp-sh-handle-set-file-times): Use it. (tramp-sh-handle-directory-files-and-attributes): Use `tramp-handle-directory-files-and-attributes' if neither stat nor perl are available on the remote host. * net/tramp-smb.el (tramp-smb-handle-insert-directory): Mark trailing "/". Write long listing only when "l" belongs to the switches. * net/tramp.el (tramp-handle-make-symbolic-link): New defun. (tramp-check-cached-permissions): Call `file-attributes' if the cache is empty. * net/trampver.el: Update release number.
Diffstat (limited to 'lisp/net/tramp-smb.el')
-rw-r--r--lisp/net/tramp-smb.el67
1 files changed, 37 insertions, 30 deletions
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 97a892f9858..43e2c494ece 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -929,6 +929,10 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
"Like `insert-directory' for Tramp files."
(setq filename (expand-file-name filename))
(unless switches (setq switches ""))
+ ;; Mark trailing "/".
+ (when (and (zerop (length (file-name-nondirectory filename)))
+ (not full-directory-p))
+ (setq switches (concat switches "F")))
(if full-directory-p
;; Called from `dired-add-entry'.
(setq filename (file-name-as-directory filename))
@@ -991,38 +995,41 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(mapc
(lambda (x)
(when (not (zerop (length (nth 0 x))))
- (let ((attr
- (when (tramp-smb-get-stat-capability v)
- (ignore-errors
- (file-attributes filename 'string)))))
- (insert
- (format
- "%10s %3d %-8s %-8s %8s %s "
- (or (nth 8 attr) (nth 1 x)) ; mode
- (or (nth 1 attr) 1) ; inode
- (or (nth 2 attr) "nobody") ; uid
- (or (nth 3 attr) "nogroup") ; gid
- (or (nth 7 attr) (nth 2 x)) ; size
- (format-time-string
- (if (tramp-time-less-p
- (tramp-time-subtract (current-time) (nth 3 x))
- tramp-half-a-year)
- "%b %e %R"
- "%b %e %Y")
- (nth 3 x)))) ; date
- ;; We mark the file name. The inserted name could be
- ;; from somewhere else, so we use the relative file
- ;; name of `default-directory'.
- (let ((start (point)))
+ (when (string-match "l" switches)
+ (let ((attr
+ (when (tramp-smb-get-stat-capability v)
+ (ignore-errors
+ (file-attributes filename 'string)))))
(insert
(format
- "%s\n"
- (file-relative-name
- (expand-file-name
- (nth 0 x) (file-name-directory filename)))))
- (put-text-property start (1- (point)) 'dired-filename t))
- (forward-line)
- (beginning-of-line))))
+ "%10s %3d %-8s %-8s %8s %s "
+ (or (nth 8 attr) (nth 1 x)) ; mode
+ (or (nth 1 attr) 1) ; inode
+ (or (nth 2 attr) "nobody") ; uid
+ (or (nth 3 attr) "nogroup") ; gid
+ (or (nth 7 attr) (nth 2 x)) ; size
+ (format-time-string
+ (if (tramp-time-less-p
+ (tramp-time-subtract (current-time) (nth 3 x))
+ tramp-half-a-year)
+ "%b %e %R"
+ "%b %e %Y")
+ (nth 3 x)))))) ; date
+
+ ;; We mark the file name. The inserted name could be
+ ;; from somewhere else, so we use the relative file name
+ ;; of `default-directory'.
+ (let ((start (point)))
+ (insert
+ (format
+ "%s\n"
+ (file-relative-name
+ (expand-file-name
+ (nth 0 x) (file-name-directory filename))
+ (when full-directory-p (file-name-directory filename)))))
+ (put-text-property start (1- (point)) 'dired-filename t))
+ (forward-line)
+ (beginning-of-line)))
entries)))))
(defun tramp-smb-handle-make-directory (dir &optional parents)