diff options
| author | Jim Blandy | 1993-05-03 03:37:22 +0000 |
|---|---|---|
| committer | Jim Blandy | 1993-05-03 03:37:22 +0000 |
| commit | 28dbf5014a585f1e41800fdfda4eed11dd0a39ea (patch) | |
| tree | ed2c01aecd1614c50699af937eefa2de0bd7c208 | |
| parent | 85dd3810c9de85939cbef3493601cfef2631595a (diff) | |
| download | emacs-28dbf5014a585f1e41800fdfda4eed11dd0a39ea.tar.gz emacs-28dbf5014a585f1e41800fdfda4eed11dd0a39ea.zip | |
* files.el (insert-directory): Undo change of March 23;
dereferencing links is inappropriate for dired.
* files.el (abbreviate-file-name): If abbreviated-home-dir ends
with a slash, don't remove the corresponding slash from filename
when we collapse the home directory to ~.
| -rw-r--r-- | lisp/files.el | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/lisp/files.el b/lisp/files.el index 038dc538a66..8a62702f7dd 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -481,7 +481,18 @@ Type \\[describe-variable] directory-abbrev-alist RET for more information." | |||
| 481 | ;; make it start with `~' instead. | 481 | ;; make it start with `~' instead. |
| 482 | (if (string-match abbreviated-home-dir filename) | 482 | (if (string-match abbreviated-home-dir filename) |
| 483 | (setq filename | 483 | (setq filename |
| 484 | (concat "~" (substring filename (match-end 0))))) | 484 | (concat "~" |
| 485 | ;; If abbreviated-home-dir ends with a slash, | ||
| 486 | ;; don't remove the corresponding slash from | ||
| 487 | ;; filename. On MS-DOS and OS/2, you can have | ||
| 488 | ;; home directories like "g:/", in which it is | ||
| 489 | ;; important not to remove the slash. And what | ||
| 490 | ;; about poor root on Unix systems? | ||
| 491 | (if (eq ?/ (aref abbreviated-home-dir | ||
| 492 | (1- (length abbreviated-home-dir)))) | ||
| 493 | "/" | ||
| 494 | "") | ||
| 495 | (substring filename (match-end 0))))) | ||
| 485 | filename)) | 496 | filename)) |
| 486 | 497 | ||
| 487 | (defvar find-file-not-true-dirname-list nil | 498 | (defvar find-file-not-true-dirname-list nil |
| @@ -1778,13 +1789,17 @@ If WILDCARD, it also runs the shell specified by `shell-file-name'." | |||
| 1778 | "-c" (concat insert-directory-program | 1789 | "-c" (concat insert-directory-program |
| 1779 | " -d " switches " " | 1790 | " -d " switches " " |
| 1780 | (file-name-nondirectory file)))) | 1791 | (file-name-nondirectory file)))) |
| 1781 | ;; Chase links till we reach a non-link. | 1792 | ;; Barry Margolin says: "SunOS 4.1.3 (and SV and POSIX?) |
| 1782 | ;; This used to be commented out, but Barry Margolin says: | 1793 | ;; lists the link if we give a link to a directory - yuck!" |
| 1783 | ;; SunOS 4.1.3 (and SV and POSIX?) lists the link | 1794 | ;; That's why we used to chase symlinks. But we don't want |
| 1784 | ;; if we give a link to a directory - yuck! | 1795 | ;; to chase links before passing the filename to ls; that |
| 1785 | (let (symlink) | 1796 | ;; would mean that our line of output would not display |
| 1786 | (while (setq symlink (file-symlink-p file)) | 1797 | ;; FILE's name as given. To really address the problem that |
| 1787 | (setq file symlink))) | 1798 | ;; SunOS 4.1.3 has, we need to find the right switch to get |
| 1799 | ;; a descripton of the link itself. | ||
| 1800 | ;; (let (symlink) | ||
| 1801 | ;; (while (setq symlink (file-symlink-p file)) | ||
| 1802 | ;; (setq file symlink))) | ||
| 1788 | (call-process insert-directory-program nil t nil switches file)))))) | 1803 | (call-process insert-directory-program nil t nil switches file)))))) |
| 1789 | 1804 | ||
| 1790 | (defun save-buffers-kill-emacs (&optional arg) | 1805 | (defun save-buffers-kill-emacs (&optional arg) |