[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


From: weber
Subject: make-manual-backup
Date: Thu, 07 Jun 2007 19:27:37 -0000
User-agent: G2/1.0

Hi all!
I just wrote this function to make a backup of the current file, but
I'm not happy with the solution I used: I have this second write-file
to return to the original file.
Is there a better (probably also faster) way?
Thanks in advance,

(defun make-manual-backup ()
  "Save a copy without changing to new filename.
Useful for making a copy of working file in development."
  (let ((old-filename (buffer-file-name))
        (new-filename (concat (buffer-file-name) (format-time-string
    (write-file new-filename)
    (write-file old-filename)
    (message (concat "Wrote backup " new-filename))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]