A while back on -beta, JWZ mentioned that %backup%~ should probably go
to `auto-save-directory'. This is how we did it at SXEmacs...
This being another SXEmacs-originated change I'd feel more comfortable
if another Reviewer gave this the go ahead before its committed.
2005-03-23 Steve Youngs <steve(a)sxemacs.org>
* files.el (backup-buffer): Write "$backup$~" in
`auto-save-directory' and fall back to $HOME if for some reason
that isn't possible.
Suggested By: Jamie Zawinski <jwz(a)jwz.org>
Index: files.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/files.el,v
retrieving revision 1.72
diff -u -p -r1.72 files.el
--- files.el 17 Mar 2005 09:26:09 -0000 1.72
+++ files.el 23 Mar 2005 04:35:43 -0000
@@ -2390,10 +2390,15 @@ no longer accessible under its old name.
(rename-file real-file-name backupname t)
(setq setmodes (file-modes backupname)))
(file-error
- ;; If trouble writing the backup, write it in ~.
+ ;; If trouble writing the backup, write
+ ;; it in `auto-save-directory'. Fall
+ ;; back to $HOME if that's not possible.
(setq backupname
- (expand-file-name
- (convert-standard-filename "~/%backup%~")))
+ (expand-file-name "$backup%~"
+ (or (when (and auto-save-directory
+ (file-writable-p auto-save-directory))
+ auto-save-directory)
+ (getenv "HOME"))))
(lwarn 'file 'alert "Cannot write backup file; backing up in
%s"
(file-name-nondirectory backupname))
(sleep-for 1)
--
|---<Steve Youngs>---------------<GnuPG KeyID: A94B3003>---|
| I am Dyslexic of Borg. |
| Fusistance is retile. Your arse will be laminated. |
|------------------------------------<steve(a)sxemacs.org>---|