emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r99447: * dired.el (dired-revert): If


From: Michael Albinus
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r99447: * dired.el (dired-revert): If DIRED-DIRECTORY is a cons cell, call
Date: Thu, 04 Feb 2010 17:25:57 +0100
User-agent: Bazaar (2.0.2)

------------------------------------------------------------
revno: 99447
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Thu 2010-02-04 17:25:57 +0100
message:
  * 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)
modified:
  lisp/ChangeLog
  lisp/dired.el
  lisp/net/tramp-imap.el
  lisp/net/tramp-smb.el
  lisp/net/tramp.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-02-04 05:14:36 +0000
+++ b/lisp/ChangeLog    2010-02-04 16:25:57 +0000
@@ -1,3 +1,17 @@
+2010-02-04  Michael Albinus  <address@hidden>
+
+       * 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)
+
 2010-02-04  David Burger  <address@hidden>  (tiny change)
 
        * macros.el (apply-macro-to-region-lines):

=== modified file 'lisp/dired.el'
--- a/lisp/dired.el     2010-01-20 16:42:50 +0000
+++ b/lisp/dired.el     2010-02-04 16:25:57 +0000
@@ -1144,8 +1144,12 @@
     (setq mark-alist;; only after dired-remember-hidden since this unhides:
          (dired-remember-marks (point-min) (point-max)))
     ;; treat top level dir extra (it may contain wildcards)
-    (dired-uncache
-     (if (consp dired-directory) (car dired-directory) dired-directory))
+    (if (not (consp dired-directory))
+       (dired-uncache dired-directory)
+      (dired-uncache (car dired-directory))
+      (dolist (dir (cdr dired-directory))
+       (if (file-name-absolute-p dir)
+           (dired-uncache dir))))
     ;; Run dired-after-readin-hook just once, below.
     (let ((dired-after-readin-hook nil))
       (dired-readin)

=== modified file 'lisp/net/tramp-imap.el'
--- a/lisp/net/tramp-imap.el    2010-01-22 21:19:50 +0000
+++ b/lisp/net/tramp-imap.el    2010-02-04 16:25:57 +0000
@@ -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)

=== modified file 'lisp/net/tramp-smb.el'
--- a/lisp/net/tramp-smb.el     2010-01-23 11:02:28 +0000
+++ b/lisp/net/tramp-smb.el     2010-02-04 16:25:57 +0000
@@ -716,7 +716,7 @@
                    (when (tramp-smb-get-stat-capability v)
                      (ignore-errors
                        (file-attributes
-                        (expand-file-name (nth 0 x)) 'string)))))
+                        (expand-file-name (nth 0 x) filename) 'string)))))
               (insert
                (format
                 "%10s %3d %-8s %-8s %8s %s "
@@ -732,9 +732,14 @@
                      "%b %e %R"
                    "%b %e  %Y")
                  (nth 3 x)))) ; date
-              ;; We mark the filename.
+              ;; 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" (nth 0 x))) ; file name
+                (insert
+                 (format
+                  "%s\n"
+                  (file-relative-name (expand-file-name (nth 0 x) filename))))
                 (put-text-property start (1- (point)) 'dired-filename t))
               (forward-line)
               (beginning-of-line))))

=== modified file 'lisp/net/tramp.el'
--- a/lisp/net/tramp.el 2010-01-29 16:23:25 +0000
+++ b/lisp/net/tramp.el 2010-02-04 16:25:57 +0000
@@ -4035,9 +4035,11 @@
                        (concat file ".z"))
                       (t nil)))))))))
 
-(defun tramp-handle-dired-uncache (dir)
+(defun tramp-handle-dired-uncache (dir &optional dir-p)
   "Like `dired-uncache' for Tramp files."
-  (with-parsed-tramp-file-name dir nil
+  ;; DIR-P is valid for XEmacs only.
+  (with-parsed-tramp-file-name
+      (if (or dir-p (file-directory-p dir)) dir (file-name-directory dir)) nil
     (tramp-flush-file-property v localname)))
 
 ;; Pacify byte-compiler.  The function is needed on XEmacs only.  I'm
@@ -4663,20 +4665,21 @@
 
 (defun tramp-handle-file-remote-p (filename &optional identification connected)
   "Like `file-remote-p' for Tramp files."
-  (when (tramp-tramp-file-p filename)
-    (let* ((v (tramp-dissect-file-name filename))
-          (p (tramp-get-connection-process v))
-          (c (and p (processp p) (memq (process-status p) '(run open)))))
-      ;; We expand the file name only, if there is already a connection.
-      (with-parsed-tramp-file-name
-         (if c (expand-file-name filename) filename) nil
-       (and (or (not connected) c)
-            (cond
-             ((eq identification 'method) method)
-             ((eq identification 'user) user)
-             ((eq identification 'host) host)
-             ((eq identification 'localname) localname)
-             (t (tramp-make-tramp-file-name method user host ""))))))))
+  (let ((tramp-verbose 3))
+    (when (tramp-tramp-file-p filename)
+      (let* ((v (tramp-dissect-file-name filename))
+            (p (tramp-get-connection-process v))
+            (c (and p (processp p) (memq (process-status p) '(run open)))))
+       ;; We expand the file name only, if there is already a connection.
+       (with-parsed-tramp-file-name
+           (if c (expand-file-name filename) filename) nil
+         (and (or (not connected) c)
+              (cond
+               ((eq identification 'method) method)
+               ((eq identification 'user) user)
+               ((eq identification 'host) host)
+               ((eq identification 'localname) localname)
+               (t (tramp-make-tramp-file-name method user host "")))))))))
 
 (defun tramp-find-file-name-coding-system-alist (filename tmpname)
   "Like `find-operation-coding-system' for Tramp filenames.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]