diff options
| author | Gerd Moellmann | 2000-11-23 13:53:12 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-11-23 13:53:12 +0000 |
| commit | 03679a46d01914f5656695253aae5886fbc6487c (patch) | |
| tree | da0902a42a42417b2f88c61fafef0d05cc265e74 | |
| parent | d96a4de3aedea8a1262cfdbd72ab738c64318ed5 (diff) | |
| download | emacs-03679a46d01914f5656695253aae5886fbc6487c.tar.gz emacs-03679a46d01914f5656695253aae5886fbc6487c.zip | |
(dired-add-entry): Don't call dired-get-filename
with `no-dir'; we want the directory part to be able to remove
it.
| -rw-r--r-- | lisp/dired-aux.el | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index b543dc9edd5..dde77e3af43 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el | |||
| @@ -806,10 +806,10 @@ a prefix arg lets you edit the `ls' switches used for the new listing." | |||
| 806 | (setq filename (directory-file-name filename)) | 806 | (setq filename (directory-file-name filename)) |
| 807 | ;; Entry is always for files, even if they happen to also be directories | 807 | ;; Entry is always for files, even if they happen to also be directories |
| 808 | (let* ((opoint (point)) | 808 | (let* ((opoint (point)) |
| 809 | (cur-dir (dired-current-directory)) | 809 | (cur-dir (dired-current-directory)) |
| 810 | (orig-file-name filename) | 810 | (orig-file-name filename) |
| 811 | (directory (if relative cur-dir (file-name-directory filename))) | 811 | (directory (if relative cur-dir (file-name-directory filename))) |
| 812 | reason) | 812 | reason) |
| 813 | (setq filename | 813 | (setq filename |
| 814 | (if relative | 814 | (if relative |
| 815 | (file-relative-name filename directory) | 815 | (file-relative-name filename directory) |
| @@ -822,14 +822,14 @@ a prefix arg lets you edit the `ls' switches used for the new listing." | |||
| 822 | (if (eq (following-char) ?\r) | 822 | (if (eq (following-char) ?\r) |
| 823 | (dired-unhide-subdir)) | 823 | (dired-unhide-subdir)) |
| 824 | ;; We are already where we should be, except when | 824 | ;; We are already where we should be, except when |
| 825 | ;; point is before the subdir line or its total line. | 825 | ;; point is before the subdir line or its total line. |
| 826 | (let ((p (dired-after-subdir-garbage cur-dir))) | 826 | (let ((p (dired-after-subdir-garbage cur-dir))) |
| 827 | (if (< (point) p) | 827 | (if (< (point) p) |
| 828 | (goto-char p)))) | 828 | (goto-char p)))) |
| 829 | ;; else try to find correct place to insert | 829 | ;; else try to find correct place to insert |
| 830 | (if (dired-goto-subdir directory) | 830 | (if (dired-goto-subdir directory) |
| 831 | (progn;; unhide if necessary | 831 | (progn ;; unhide if necessary |
| 832 | (if (looking-at "\r");; point is at end of subdir line | 832 | (if (looking-at "\r") ;; point is at end of subdir line |
| 833 | (dired-unhide-subdir)) | 833 | (dired-unhide-subdir)) |
| 834 | ;; found - skip subdir and `total' line | 834 | ;; found - skip subdir and `total' line |
| 835 | ;; and uninteresting files like . and .. | 835 | ;; and uninteresting files like . and .. |
| @@ -841,7 +841,7 @@ a prefix arg lets you edit the `ls' switches used for the new listing." | |||
| 841 | (beginning-of-line) | 841 | (beginning-of-line) |
| 842 | (setq opoint (point)) | 842 | (setq opoint (point)) |
| 843 | (dired-add-entry-do-indentation marker-char) | 843 | (dired-add-entry-do-indentation marker-char) |
| 844 | ;; don't expand `.'. Show just the file name within directory. | 844 | ;; don't expand `.'. Show just the file name within directory. |
| 845 | (let ((default-directory directory)) | 845 | (let ((default-directory directory)) |
| 846 | (insert-directory filename | 846 | (insert-directory filename |
| 847 | (concat dired-actual-switches "d"))) | 847 | (concat dired-actual-switches "d"))) |
| @@ -850,7 +850,7 @@ a prefix arg lets you edit the `ls' switches used for the new listing." | |||
| 850 | ;; the relative one. That may be hard to fix since it | 850 | ;; the relative one. That may be hard to fix since it |
| 851 | ;; is probably controlled by something in ftp. | 851 | ;; is probably controlled by something in ftp. |
| 852 | (goto-char opoint) | 852 | (goto-char opoint) |
| 853 | (let ((inserted-name (dired-get-filename 'no-dir))) | 853 | (let ((inserted-name (dired-get-filename))) |
| 854 | (if (file-name-directory inserted-name) | 854 | (if (file-name-directory inserted-name) |
| 855 | (progn | 855 | (progn |
| 856 | (end-of-line) | 856 | (end-of-line) |
| @@ -858,11 +858,11 @@ a prefix arg lets you edit the `ls' switches used for the new listing." | |||
| 858 | (insert filename) | 858 | (insert filename) |
| 859 | (forward-char 1)) | 859 | (forward-char 1)) |
| 860 | (forward-line 1))) | 860 | (forward-line 1))) |
| 861 | ;; Give each line a text property recording info about it. | 861 | ;; Give each line a text property recording info about it. |
| 862 | (dired-insert-set-properties opoint (point)) | 862 | (dired-insert-set-properties opoint (point)) |
| 863 | (forward-line -1) | 863 | (forward-line -1) |
| 864 | (if dired-after-readin-hook;; the subdir-alist is not affected... | 864 | (if dired-after-readin-hook ;; the subdir-alist is not affected... |
| 865 | (save-excursion;; ...so we can run it right now: | 865 | (save-excursion ;; ...so we can run it right now: |
| 866 | (save-restriction | 866 | (save-restriction |
| 867 | (beginning-of-line) | 867 | (beginning-of-line) |
| 868 | (narrow-to-region (point) (save-excursion | 868 | (narrow-to-region (point) (save-excursion |
| @@ -871,9 +871,9 @@ a prefix arg lets you edit the `ls' switches used for the new listing." | |||
| 871 | (dired-move-to-filename)) | 871 | (dired-move-to-filename)) |
| 872 | ;; return nil if all went well | 872 | ;; return nil if all went well |
| 873 | nil)) | 873 | nil)) |
| 874 | (if reason ; don't move away on failure | 874 | (if reason ; don't move away on failure |
| 875 | (goto-char opoint)) | 875 | (goto-char opoint)) |
| 876 | (not reason))) ; return t on success, nil else | 876 | (not reason))) ; return t on success, nil else |
| 877 | 877 | ||
| 878 | ;; This is a separate function for the sake of nested dired format. | 878 | ;; This is a separate function for the sake of nested dired format. |
| 879 | (defun dired-add-entry-do-indentation (marker-char) | 879 | (defun dired-add-entry-do-indentation (marker-char) |