sxemacs-devel
[Top] [All Lists]

Re: backup-buffer idiociy

From: Steve Youngs <steve@xxxxxxxxxxx>
Subject: Re: backup-buffer idiociy
Date: Fri, 25 Feb 2005 13:42:29 +1000
Organization: The SXEmacs Project
User-agent: Gnus/5.110003 (No Gnus v0.3) SXEmacs/22.1.2 (Audi, linux)
* Johann Oskarsson <Johann> writes:

  > To actually use auto-save-directory, I propose

  >   (expand-file-name "%backup%~" (or auto-save-directory
  >                                 (convert-standard-filename "~")))

That doesn't look right to me.  The 2nd arg to `expand-file-name' is a
directory and `convert-standard-filename' doesn't seem right here.

It would be better written as:

(expand-file-name "%backup%~" (or auto-save-directory
                                  (getenv "HOME")))

Wouldn't this be all that's needed:

--- orig/lisp/files.el
+++ mod/lisp/files.el
@@ -1875,9 +1875,9 @@
                            (file-error
                             ;; If trouble writing the backup, write it in ~.
                             (setq backupname
-                                  (expand-file-name
-                                   (convert-standard-filename "~/%backup%~")))
-                            (message "Cannot write backup file; backing up in 
~/%%backup%%~")
+                                  (expand-file-name "%backup%~" (or 
auto-save-directory
+                                                                    (getenv 
"HOME"))))
+                            (message "Cannot write backup file; backing up in 
%s" backupname)
                             (sleep-for 1)
                             (condition-case ()
                                 (copy-file real-file-name backupname t t)


-- 
|---<Steve Youngs>---------------<GnuPG KeyID: A94B3003>---|
|                        In space,                         |
|             No one can hear you rip a stinky             |
|------------------------------------<steve@xxxxxxxxxxx>---|

Attachment: pgpkyDqNSczL9.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>