# HG changeset patch # User Richard M. Stallman # Date 1167460137 0 # Node ID 2711fe24b0e3b53b806cf990dd03648f02289977 # Parent 750801c2d9b6430ba868a3f6dd29900a8a68722a (backup-buffer): Show entire backup file name in message. (make-backup-file-name-1): Precompute abs name but don't lose the relative name. diff -r 750801c2d9b6 -r 2711fe24b0e3 lisp/files.el --- a/lisp/files.el Sat Dec 30 06:27:30 2006 +0000 +++ b/lisp/files.el Sat Dec 30 06:28:57 2006 +0000 @@ -3031,7 +3031,7 @@ (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 @@ (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 @@ ;; 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 @@ (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).