diff lisp/net/tramp-imap.el @ 107085:d7831d04952b

* dired.el (dired-revert): If DIRED-DIRECTORY is a cons cell, call `dired-uncache' for every elemnt which is an absolute file name. * net/tramp.el (tramp-handle-dired-uncache): When DIR is not a directory, handle its directory component. (tramp-handle-file-remote-p): Let-bind `tramp-verbose' to 3; this function is called permanently and creates noise, otherwise. * net/tramp-imap.el (tramp-imap-handle-insert-directory): * net/tramp-smb.el (tramp-smb-handle-insert-directory): Handle the case, FILENAME is not in `default-directory'. (Bug#5478)
author Michael Albinus <michael.albinus@gmx.de>
date Thu, 04 Feb 2010 17:25:57 +0100
parents a0a8dc9e7a05
children 2e763e444bc2
line wrap: on
line diff
--- a/lisp/net/tramp-imap.el	Wed Feb 03 21:21:40 2010 -0800
+++ b/lisp/net/tramp-imap.el	Thu Feb 04 17:25:57 2010 +0100
@@ -472,14 +472,18 @@
 		(nth 6 x)))) ; date
 	     ;; For the file name, we set the `dired-filename'
 	     ;; property.  This allows to handle file names with
-	     ;; leading or trailing spaces as well.
+	     ;; leading or trailing spaces as well.  The inserted name
+	     ;; could be from somewhere else, so we use the relative
+	     ;; file name of `default-directory'.
 	     (let ((pos (point)))
-	       (insert (format "%s" (nth 0 x))) ; file name
-	       (put-text-property pos (point) 'dired-filename t))
-	     (insert "\n")
+	       (insert
+		(format
+		 "%s\n"
+		 (file-relative-name (expand-file-name (nth 0 x) filename))))
+	       (put-text-property pos (1- (point)) 'dired-filename t))
 	     (forward-line)
 	     (beginning-of-line)))
-	   entries)))))
+	 entries)))))
 
 (defun tramp-imap-handle-insert-file-contents
   (filename &optional visit beg end replace)