# HG changeset patch # User Richard M. Stallman # Date 796609118 0 # Node ID b9376f3450bbf1cf936fb682abad218839a61784 # Parent 620fd38579d8d6f581ccbae91dc073e3cc2fbe06 (dired-add-entry): If ange-ftp inserted the file's absolute name, fix that. diff -r 620fd38579d8 -r b9376f3450bb lisp/dired-aux.el --- a/lisp/dired-aux.el Fri Mar 31 00:09:19 1995 +0000 +++ b/lisp/dired-aux.el Fri Mar 31 00:18:38 1995 +0000 @@ -749,6 +749,7 @@ ;; 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 @@ (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...