comparison lisp/dired-aux.el @ 11158:b9376f3450bb

(dired-add-entry): If ange-ftp inserted the file's absolute name, fix that.
author Richard M. Stallman <rms@gnu.org>
date Fri, 31 Mar 1995 00:18:38 +0000
parents e5942b624f45
children a3c6991e86b4
comparison
equal deleted inserted replaced
11157:620fd38579d8 11158:b9376f3450bb
747 ;; Hidden subdirs are exposed if a file is added there. 747 ;; Hidden subdirs are exposed if a file is added there.
748 (setq filename (directory-file-name filename)) 748 (setq filename (directory-file-name filename))
749 ;; Entry is always for files, even if they happen to also be directories 749 ;; Entry is always for files, even if they happen to also be directories
750 (let ((opoint (point)) 750 (let ((opoint (point))
751 (cur-dir (dired-current-directory)) 751 (cur-dir (dired-current-directory))
752 (orig-file-name filename)
752 (directory (file-name-directory filename)) 753 (directory (file-name-directory filename))
753 reason) 754 reason)
754 (setq filename (file-name-nondirectory filename) 755 (setq filename (file-name-nondirectory filename)
755 reason 756 reason
756 (catch 'not-found 757 (catch 'not-found
781 (dired-add-entry-do-indentation marker-char) 782 (dired-add-entry-do-indentation marker-char)
782 ;; don't expand `.'. Show just the file name within directory. 783 ;; don't expand `.'. Show just the file name within directory.
783 (let ((default-directory directory)) 784 (let ((default-directory directory))
784 (insert-directory filename 785 (insert-directory filename
785 (concat dired-actual-switches "d"))) 786 (concat dired-actual-switches "d")))
787 ;; Compensate for a bug in ange-ftp.
788 ;; It inserts the file's absolute name, rather than
789 ;; the relative one. That may be hard to fix since it
790 ;; is probably controlled by something in ftp.
791 (goto-char opoint)
792 (let ((inserted-name (dired-get-filename 'no-dir)))
793 (if (file-name-directory inserted-name)
794 (progn
795 (end-of-line)
796 (delete-char (- (length inserted-name)))
797 (insert filename)
798 (forward-char 1))
799 (forward-line 1)))
800 ;; Give each line a text property recording info about it.
786 (dired-insert-set-properties opoint (point)) 801 (dired-insert-set-properties opoint (point))
787 (forward-line -1) 802 (forward-line -1)
788 (if dired-after-readin-hook;; the subdir-alist is not affected... 803 (if dired-after-readin-hook;; the subdir-alist is not affected...
789 (save-excursion;; ...so we can run it right now: 804 (save-excursion;; ...so we can run it right now:
790 (save-restriction 805 (save-restriction