From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Jun 26 08:50:02 2007 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 86EB716A474 for ; Tue, 26 Jun 2007 08:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 66E8713C480 for ; Tue, 26 Jun 2007 08:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l5Q8o205014685 for ; Tue, 26 Jun 2007 08:50:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l5Q8o21m014684; Tue, 26 Jun 2007 08:50:02 GMT (envelope-from gnats) Resent-Date: Tue, 26 Jun 2007 08:50:02 GMT Resent-Message-Id: <200706260850.l5Q8o21m014684@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jason Spiro Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D9CD016A468 for ; Tue, 26 Jun 2007 08:41:10 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [69.147.83.33]) by mx1.freebsd.org (Postfix) with ESMTP id B0A6813C4C5 for ; Tue, 26 Jun 2007 08:41:10 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l5Q8fAmT063680 for ; Tue, 26 Jun 2007 08:41:10 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id l5Q8fAVO063679; Tue, 26 Jun 2007 08:41:10 GMT (envelope-from nobody) Message-Id: <200706260841.l5Q8fAVO063679@www.freebsd.org> Date: Tue, 26 Jun 2007 08:41:10 GMT From: Jason Spiro To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.0 Cc: Subject: ports/114031: [PATCH] stop XEmacs from corrupting the ~/.emacs file when trying to migrate an init file it can't start to parse X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jun 2007 08:50:02 -0000 >Number: 114031 >Category: ports >Synopsis: [PATCH] stop XEmacs from corrupting the ~/.emacs file when trying to migrate an init file it can't start to parse >Confidential: no >Severity: non-critical >Priority: high >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jun 26 08:50:01 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Jason Spiro >Release: 6.2-RELEASE >Organization: >Environment: FreeBSD jlaptop. 6.2-RELEASE-p4 FreeBSD 6.2-RELEASE-p4 #0: Thu Apr 26 17:40:53 UTC 2007 root@i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC i386 >Description: 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. >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: foobarbazquux * 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: (custom-set-variables '(load-home-init-file t t)) (custom-set-faces) >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: --- 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 @@ ;;;###autoload (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)) (custom-save-variables) (custom-save-faces) Dear FreeBSD people, could you please forward the patch onto the XEmacs people? Please let me know. Regards, Jason >Release-Note: >Audit-Trail: >Unformatted: