Commit d5b3979c authored by Michael Albinus's avatar Michael Albinus
Browse files

* 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)
parent 6c594ec6
2010-02-04 Michael Albinus <michael.albinus@gmx.de>
* 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 <dburger@google.com> (tiny change) 2010-02-04 David Burger <dburger@google.com> (tiny change)
* macros.el (apply-macro-to-region-lines): * macros.el (apply-macro-to-region-lines):
......
...@@ -1144,8 +1144,12 @@ Preserves old cursor, marks/flags, hidden-p." ...@@ -1144,8 +1144,12 @@ Preserves old cursor, marks/flags, hidden-p."
(setq mark-alist;; only after dired-remember-hidden since this unhides: (setq mark-alist;; only after dired-remember-hidden since this unhides:
(dired-remember-marks (point-min) (point-max))) (dired-remember-marks (point-min) (point-max)))
;; treat top level dir extra (it may contain wildcards) ;; treat top level dir extra (it may contain wildcards)
(dired-uncache (if (not (consp dired-directory))
(if (consp dired-directory) (car dired-directory) 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. ;; Run dired-after-readin-hook just once, below.
(let ((dired-after-readin-hook nil)) (let ((dired-after-readin-hook nil))
(dired-readin) (dired-readin)
......
...@@ -472,14 +472,18 @@ SIZE MODE WEIRD INODE DEVICE)." ...@@ -472,14 +472,18 @@ SIZE MODE WEIRD INODE DEVICE)."
(nth 6 x)))) ; date (nth 6 x)))) ; date
;; For the file name, we set the `dired-filename' ;; For the file name, we set the `dired-filename'
;; property. This allows to handle file names with ;; 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))) (let ((pos (point)))
(insert (format "%s" (nth 0 x))) ; file name (insert
(put-text-property pos (point) 'dired-filename t)) (format
(insert "\n") "%s\n"
(file-relative-name (expand-file-name (nth 0 x) filename))))
(put-text-property pos (1- (point)) 'dired-filename t))
(forward-line) (forward-line)
(beginning-of-line))) (beginning-of-line)))
entries))))) entries)))))
(defun tramp-imap-handle-insert-file-contents (defun tramp-imap-handle-insert-file-contents
(filename &optional visit beg end replace) (filename &optional visit beg end replace)
......
...@@ -716,7 +716,7 @@ PRESERVE-UID-GID is completely ignored." ...@@ -716,7 +716,7 @@ PRESERVE-UID-GID is completely ignored."
(when (tramp-smb-get-stat-capability v) (when (tramp-smb-get-stat-capability v)
(ignore-errors (ignore-errors
(file-attributes (file-attributes
(expand-file-name (nth 0 x)) 'string))))) (expand-file-name (nth 0 x) filename) 'string)))))
(insert (insert
(format (format
"%10s %3d %-8s %-8s %8s %s " "%10s %3d %-8s %-8s %8s %s "
...@@ -732,9 +732,14 @@ PRESERVE-UID-GID is completely ignored." ...@@ -732,9 +732,14 @@ PRESERVE-UID-GID is completely ignored."
"%b %e %R" "%b %e %R"
"%b %e %Y") "%b %e %Y")
(nth 3 x)))) ; date (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))) (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)) (put-text-property start (1- (point)) 'dired-filename t))
(forward-line) (forward-line)
(beginning-of-line)))) (beginning-of-line))))
......
...@@ -4035,9 +4035,11 @@ This is like `dired-recursive-delete-directory' for Tramp files." ...@@ -4035,9 +4035,11 @@ This is like `dired-recursive-delete-directory' for Tramp files."
(concat file ".z")) (concat file ".z"))
(t nil))))))))) (t nil)))))))))
(defun tramp-handle-dired-uncache (dir) (defun tramp-handle-dired-uncache (dir &optional dir-p)
"Like `dired-uncache' for Tramp files." "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))) (tramp-flush-file-property v localname)))
;; Pacify byte-compiler. The function is needed on XEmacs only. I'm ;; Pacify byte-compiler. The function is needed on XEmacs only. I'm
...@@ -4663,20 +4665,21 @@ Lisp error raised when PROGRAM is nil is trapped also, returning 1." ...@@ -4663,20 +4665,21 @@ Lisp error raised when PROGRAM is nil is trapped also, returning 1."
(defun tramp-handle-file-remote-p (filename &optional identification connected) (defun tramp-handle-file-remote-p (filename &optional identification connected)
"Like `file-remote-p' for Tramp files." "Like `file-remote-p' for Tramp files."
(when (tramp-tramp-file-p filename) (let ((tramp-verbose 3))
(let* ((v (tramp-dissect-file-name filename)) (when (tramp-tramp-file-p filename)
(p (tramp-get-connection-process v)) (let* ((v (tramp-dissect-file-name filename))
(c (and p (processp p) (memq (process-status p) '(run open))))) (p (tramp-get-connection-process v))
;; We expand the file name only, if there is already a connection. (c (and p (processp p) (memq (process-status p) '(run open)))))
(with-parsed-tramp-file-name ;; We expand the file name only, if there is already a connection.
(if c (expand-file-name filename) filename) nil (with-parsed-tramp-file-name
(and (or (not connected) c) (if c (expand-file-name filename) filename) nil
(cond (and (or (not connected) c)
((eq identification 'method) method) (cond
((eq identification 'user) user) ((eq identification 'method) method)
((eq identification 'host) host) ((eq identification 'user) user)
((eq identification 'localname) localname) ((eq identification 'host) host)
(t (tramp-make-tramp-file-name method user host "")))))))) ((eq identification 'localname) localname)
(t (tramp-make-tramp-file-name method user host "")))))))))
(defun tramp-find-file-name-coding-system-alist (filename tmpname) (defun tramp-find-file-name-coding-system-alist (filename tmpname)
"Like `find-operation-coding-system' for Tramp filenames. "Like `find-operation-coding-system' for Tramp filenames.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment