aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2006-12-30 06:28:57 +0000
committerRichard M. Stallman2006-12-30 06:28:57 +0000
commit6ba7756e5f99eea9613d8016c4dc040f4198b7ee (patch)
tree7e0ec611f9abd95f32d5b483a2942d8f0de1f4a5
parenta08bc5a8bd4c1cb2434a57d2ae4f376679ec3697 (diff)
downloademacs-6ba7756e5f99eea9613d8016c4dc040f4198b7ee.tar.gz
emacs-6ba7756e5f99eea9613d8016c4dc040f4198b7ee.zip
(backup-buffer): Show entire backup file name in message.
(make-backup-file-name-1): Precompute abs name but don't lose the relative name.
-rw-r--r--lisp/files.el20
1 files changed, 10 insertions, 10 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 78e25fe8c24..78b0cdab2a5 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."
3031 (convert-standard-filename 3031 (convert-standard-filename
3032 "~/%backup%~"))) 3032 "~/%backup%~")))
3033 (message "Cannot write backup file; backing up in %s" 3033 (message "Cannot write backup file; backing up in %s"
3034 (file-name-nondirectory backupname)) 3034 backupname)
3035 (sleep-for 1) 3035 (sleep-for 1)
3036 (backup-buffer-copy real-file-name backupname modes))) 3036 (backup-buffer-copy real-file-name backupname modes)))
3037 (setq buffer-backed-up t) 3037 (setq buffer-backed-up t)
@@ -3227,7 +3227,7 @@ doesn't exist, it is created."
3227(defun make-backup-file-name-1 (file) 3227(defun make-backup-file-name-1 (file)
3228 "Subroutine of `make-backup-file-name' and `find-backup-file-name'." 3228 "Subroutine of `make-backup-file-name' and `find-backup-file-name'."
3229 (let ((alist backup-directory-alist) 3229 (let ((alist backup-directory-alist)
3230 elt backup-directory) 3230 elt backup-directory abs-backup-directory)
3231 (while alist 3231 (while alist
3232 (setq elt (pop alist)) 3232 (setq elt (pop alist))
3233 (if (string-match (car elt) file) 3233 (if (string-match (car elt) file)
@@ -3237,12 +3237,14 @@ doesn't exist, it is created."
3237 ;; file's directory. By expanding explicitly here, we avoid 3237 ;; file's directory. By expanding explicitly here, we avoid
3238 ;; depending on default-directory. 3238 ;; depending on default-directory.
3239 (if backup-directory 3239 (if backup-directory
3240 (setq backup-directory (expand-file-name backup-directory 3240 (setq abs-backup-directory
3241 (file-name-directory file)))) 3241 (expand-file-name backup-directory
3242 (if (and backup-directory (not (file-exists-p backup-directory))) 3242 (file-name-directory file))))
3243 (if (and abs-backup-directory (not (file-exists-p abs-backup-directory)))
3243 (condition-case nil 3244 (condition-case nil
3244 (make-directory backup-directory 'parents) 3245 (make-directory abs-backup-directory 'parents)
3245 (file-error (setq backup-directory nil)))) 3246 (file-error (setq backup-directory nil
3247 abs-backup-directory nil))))
3246 (if (null backup-directory) 3248 (if (null backup-directory)
3247 file 3249 file
3248 (if (file-name-absolute-p backup-directory) 3250 (if (file-name-absolute-p backup-directory)
@@ -3273,9 +3275,7 @@ doesn't exist, it is created."
3273 (replace-regexp-in-string "!" "!!" file)) 3275 (replace-regexp-in-string "!" "!!" file))
3274 backup-directory)) 3276 backup-directory))
3275 (expand-file-name (file-name-nondirectory file) 3277 (expand-file-name (file-name-nondirectory file)
3276 (file-name-as-directory 3278 (file-name-as-directory abs-backup-directory))))))
3277 (expand-file-name backup-directory
3278 (file-name-directory file))))))))
3279 3279
3280(defun backup-file-name-p (file) 3280(defun backup-file-name-p (file)
3281 "Return non-nil if FILE is a backup file name (numeric or not). 3281 "Return non-nil if FILE is a backup file name (numeric or not).