FreeBSD Bugzilla – Bug 114031
[PATCH] editors/xemacs-devel - stop XEmacs from corrupting the ~/.emacs file when trying to migrate an init file it can't start to parse
Last modified: 2007-09-30 20:00:11 UTC
This is a patch for a preference-corruption issue. XEmacs corrupts the ~/.emacs file when you follow the steps below. It has happened to me both on Ubuntu Linux and on FreeBSD. The poor guy posting at https://stat.ethz.ch/pipermail/ess-help/2005-September/002851.html also experienced it.
Fix: See attached patch. To make the patch, I copied two lines from
http://cvs.savannah.gnu.org/viewvc/emacs/emacs/lisp/cus-edit.el?revision=1.321&view=markup into the xemacs21-devel-mule port's unpacked source. Then I modified it to check even more aggressively: it refuses to try to save a user's customizations any time the init file didn't fully load, even if the custom file is a different file than the init file. This is because it seems that the variable custom-file was set (to /home/j/.emacs) on my PC and I am worried it may be set elsewhere too.
I tested the patch by deleting my cus-edit.elc and pasting in the new cus-edit.el in my xemacs lisp directory. It works fine.
Here is the patch:
Dear FreeBSD people, could you please forward the patch onto the XEmacs people? Please let me know.
Content-Type: text/plain; name="file.diff"
Content-Disposition: attachment; filename="file.diff"
--- xemacs-21.5.27/lisp/cus-edit.el.orig Tue Jun 26 04:10:18 2007
+++ xemacs-21.5.27/lisp/cus-edit.el Tue Jun 26 04:14:52 2007
@@ -3756,6 +3756,8 @@
(defun custom-save-all ()
"Save all customizations in `custom-file'."
+ (when init-file-had-error
+ (error "Cannot save customizations; init file was not fully loaded"))
(let ((inhibit-read-only t))
How-To-Repeat: * Add something to the top of the file (somewhere above the custom-set-variables statement) that xemacs can't understand, such as the lone word:
* Start xemacs for the first time
* At the "Migrate init file to ~/.xemacs/? (yes or no)" prompt, enter "no"
Now XEmacs will clobber the custom-set-variables and custom-set-fonts clauses in your ~/.emacs file. It replaces them with:
'(load-home-init-file t t))
I'll take it.
alepulver 2007-09-30 18:58:29 UTC
FreeBSD ports repository
- Avoid corrupting the ~/.emacs file when migrating if it couldn't be fully
Submitted by: Jason Spiro <email@example.com>
Obtained from: http://cvs.savannah.gnu.org/viewvc/emacs/emacs/lisp/cus-edit.el?revision=1.321&view=markup
Revision Changes Path
1.1 +11 -0 ports/editors/xemacs-devel/files/patch-lisp__cus-edit.el (new)
firstname.lastname@example.org mailing list
To unsubscribe, send any mail to "email@example.com"