Subject: Re: 23.0.60; Custom-save deleting custom file

From: Bastien Guerry <[email-masked]>
Date: Tue, 06 May 2008 11:21:16 +0200

Chong Yidong <[email-masked]> writes:

>> Saving a change with Custom-save deletes the old custom file (in my
>> case ~/.emacs-custom.el).  This is quite annoying if you don't have
>> backups.
>
> Could you be more specific?  Please supply an exact recipe for
> reproducing this bug.

Yes, sorry.

Emacs version: GNU Emacs 23.0.60.1 (i686-pc-linux-gnu, GTK+ Version
2.12.9) of 2008-05-04 on bzg.ath.cx

1. emacs -Q
2. With an existing ~/.emacs-custom.el file, C-x C-e this:

   (setq custom-file "~/.emacs-custom.el")
   (load custom-file)

3. M-x customize-face RET font-lock-comment-face RET
4. [Don't do changes...]
5. C-x C-s

Then the custom file is now:

,----
| (custom-set-variables
|   ;; custom-set-variables was added by Custom.
|   ;; If you edit it by hand, you could mess it up, so be careful.
|   ;; Your init file should contain only one such instance.
|   ;; If there is more than one, they won't work right.
|  )
| 
| 
| (custom-set-faces
|   ;; custom-set-faces was added by Custom.
|   ;; If you edit it by hand, you could mess it up, so be careful.
|   ;; Your init file should contain only one such instance.
|   ;; If there is more than one, they won't work right.
|  )
`----

As far as I can check, this is a problem with `custom-save-variables'
not writing variables in the custom file if they lack some property. 

Can't help further for now.  

Thanks,

-- 
Bastien