diff options
author | Richard M. Stallman <rms@gnu.org> | 1995-03-31 00:18:38 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1995-03-31 00:18:38 +0000 |
commit | 72946abda54ad5ce81a5dc47f4ff7eee689337c6 (patch) | |
tree | 72fde8ab2da7e1e2885286f2c99f5dd099c94646 /lisp/dired-aux.el | |
parent | 53bbccefdc0c5f97f718fc9c9755bce342e2e651 (diff) | |
download | emacs-72946abda54ad5ce81a5dc47f4ff7eee689337c6.tar.gz |
(dired-add-entry): If ange-ftp inserted the file's absolute name, fix that.
Diffstat (limited to 'lisp/dired-aux.el')
-rw-r--r-- | lisp/dired-aux.el | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index c537c2e458f..9785b6cffb6 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -749,6 +749,7 @@ a prefix arg lets you edit the `ls' switches used for the new listing." ;; Entry is always for files, even if they happen to also be directories (let ((opoint (point)) (cur-dir (dired-current-directory)) + (orig-file-name filename) (directory (file-name-directory filename)) reason) (setq filename (file-name-nondirectory filename) @@ -783,6 +784,20 @@ a prefix arg lets you edit the `ls' switches used for the new listing." (let ((default-directory directory)) (insert-directory filename (concat dired-actual-switches "d"))) + ;; Compensate for a bug in ange-ftp. + ;; It inserts the file's absolute name, rather than + ;; the relative one. That may be hard to fix since it + ;; is probably controlled by something in ftp. + (goto-char opoint) + (let ((inserted-name (dired-get-filename 'no-dir))) + (if (file-name-directory inserted-name) + (progn + (end-of-line) + (delete-char (- (length inserted-name))) + (insert filename) + (forward-char 1)) + (forward-line 1))) + ;; Give each line a text property recording info about it. (dired-insert-set-properties opoint (point)) (forward-line -1) (if dired-after-readin-hook;; the subdir-alist is not affected... |