From 6ba7756e5f99eea9613d8016c4dc040f4198b7ee Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 30 Dec 2006 06:28:57 +0000 Subject: [PATCH] (backup-buffer): Show entire backup file name in message. (make-backup-file-name-1): Precompute abs name but don't lose the relative name. --- lisp/files.el | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lisp/files.el b/lisp/files.el index 78e25fe8c2..78b0cdab2a 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3031,7 +3031,7 @@ BACKUPNAME is the backup file name, which is the old file renamed." (convert-standard-filename "~/%backup%~"))) (message "Cannot write backup file; backing up in %s" - (file-name-nondirectory backupname)) + backupname) (sleep-for 1) (backup-buffer-copy real-file-name backupname modes))) (setq buffer-backed-up t) @@ -3227,7 +3227,7 @@ doesn't exist, it is created." (defun make-backup-file-name-1 (file) "Subroutine of `make-backup-file-name' and `find-backup-file-name'." (let ((alist backup-directory-alist) - elt backup-directory) + elt backup-directory abs-backup-directory) (while alist (setq elt (pop alist)) (if (string-match (car elt) file) @@ -3237,12 +3237,14 @@ doesn't exist, it is created." ;; file's directory. By expanding explicitly here, we avoid ;; depending on default-directory. (if backup-directory - (setq backup-directory (expand-file-name backup-directory - (file-name-directory file)))) - (if (and backup-directory (not (file-exists-p backup-directory))) + (setq abs-backup-directory + (expand-file-name backup-directory + (file-name-directory file)))) + (if (and abs-backup-directory (not (file-exists-p abs-backup-directory))) (condition-case nil - (make-directory backup-directory 'parents) - (file-error (setq backup-directory nil)))) + (make-directory abs-backup-directory 'parents) + (file-error (setq backup-directory nil + abs-backup-directory nil)))) (if (null backup-directory) file (if (file-name-absolute-p backup-directory) @@ -3273,9 +3275,7 @@ doesn't exist, it is created." (replace-regexp-in-string "!" "!!" file)) backup-directory)) (expand-file-name (file-name-nondirectory file) - (file-name-as-directory - (expand-file-name backup-directory - (file-name-directory file)))))))) + (file-name-as-directory abs-backup-directory)))))) (defun backup-file-name-p (file) "Return non-nil if FILE is a backup file name (numeric or not). -- 2.20.1