diff options
| author | Stefan Monnier | 2003-05-13 18:39:39 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2003-05-13 18:39:39 +0000 |
| commit | 67b6fd1cf0f3a346176be150376b6bb92952aea3 (patch) | |
| tree | 9948bfdf7dece0bdac0fcfe943650c9e4986f9c5 | |
| parent | b0622c6d46e7109cc2afce4e8edbb1d06240420c (diff) | |
| download | emacs-67b6fd1cf0f3a346176be150376b6bb92952aea3.tar.gz emacs-67b6fd1cf0f3a346176be150376b6bb92952aea3.zip | |
(file-relative-name): Remove dead code.
Make sure \n in a filename does not confuse us.
| -rw-r--r-- | lisp/files.el | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lisp/files.el b/lisp/files.el index b7553f1a886..67b8b6adba3 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; files.el --- file input and output commands for Emacs | 1 | ;;; files.el --- file input and output commands for Emacs |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 86, 87, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 | 3 | ;; Copyright (C) 1985,86,87,92,93,94,95,96,97,98,99,2000,01,02,2003 |
| 4 | ;;; Free Software Foundation, Inc. | 4 | ;;; Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Maintainer: FSF | 6 | ;; Maintainer: FSF |
| @@ -2357,6 +2357,8 @@ the old visited file has been renamed to the new name FILENAME." | |||
| 2357 | (if (eq system-type 'vax-vms) | 2357 | (if (eq system-type 'vax-vms) |
| 2358 | (setq new-name (downcase new-name))) | 2358 | (setq new-name (downcase new-name))) |
| 2359 | (setq default-directory (file-name-directory buffer-file-name)) | 2359 | (setq default-directory (file-name-directory buffer-file-name)) |
| 2360 | ;; If new-name == old-name, renaming would add a spurious <2> | ||
| 2361 | ;; and it's considered as a feature in rename-buffer. | ||
| 2360 | (or (string= new-name (buffer-name)) | 2362 | (or (string= new-name (buffer-name)) |
| 2361 | (rename-buffer new-name t)))) | 2363 | (rename-buffer new-name t)))) |
| 2362 | (setq buffer-backed-up nil) | 2364 | (setq buffer-backed-up nil) |
| @@ -2911,17 +2913,13 @@ on a DOS/Windows machine, it returns FILENAME on expanded form." | |||
| 2911 | (string-match re directory) | 2913 | (string-match re directory) |
| 2912 | (substring directory 0 (match-end 0)))))))) | 2914 | (substring directory 0 (match-end 0)))))))) |
| 2913 | filename | 2915 | filename |
| 2914 | (unless (file-name-absolute-p filename) | ||
| 2915 | (setq filename (concat "/" filename))) | ||
| 2916 | (unless (file-name-absolute-p directory) | ||
| 2917 | (setq directory (concat "/" directory))) | ||
| 2918 | (let ((ancestor ".") | 2916 | (let ((ancestor ".") |
| 2919 | (filename-dir (file-name-as-directory filename))) | 2917 | (filename-dir (file-name-as-directory filename))) |
| 2920 | (while | 2918 | (while |
| 2921 | (and | 2919 | (and |
| 2922 | (not (string-match (concat "^" (regexp-quote directory)) | 2920 | (not (string-match (concat "\\`" (regexp-quote directory)) |
| 2923 | filename-dir)) | 2921 | filename-dir)) |
| 2924 | (not (string-match (concat "^" (regexp-quote directory)) | 2922 | (not (string-match (concat "\\`" (regexp-quote directory)) |
| 2925 | filename))) | 2923 | filename))) |
| 2926 | (setq directory (file-name-directory (substring directory 0 -1)) | 2924 | (setq directory (file-name-directory (substring directory 0 -1)) |
| 2927 | ancestor (if (equal ancestor ".") | 2925 | ancestor (if (equal ancestor ".") |