From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim X Newsgroups: gmane.emacs.help Subject: Emacs 22 problems with split init file Date: Sun, 14 Jan 2007 18:36:06 +1100 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <87hcuurrfd.fsf@lion.rapttech.com.au> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1168760434 12427 80.91.229.12 (14 Jan 2007 07:40:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 14 Jan 2007 07:40:34 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 14 08:40:31 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1H5zyb-0006X4-Qd for geh-help-gnu-emacs@m.gmane.org; Sun, 14 Jan 2007 08:40:26 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H5zyb-0000IH-Nw for geh-help-gnu-emacs@m.gmane.org; Sun, 14 Jan 2007 02:40:25 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsfeed.berkeley.edu!ucberkeley!sn-xt-sjc-02!sn-xt-sjc-10!sn-xt-sjc-01!sn-post-sjc-01!supernews.com!corp.supernews.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.92 (gnu/linux) Cancel-Lock: sha1:f97v8p2kX5LsaWpigdBY4NhMeNs= Original-X-Complaints-To: abuse@supernews.com Original-Lines: 113 Original-Xref: shelby.stanford.edu gnu.emacs.help:144684 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:40288 Archived-At: Hi All, After over a year, it looks like I've run into my first real bug in emacs 22. Emacs crashes with segmentation faults. However, here is the interesting bit and why I'm posting to the group rather than just reporting a bug. I wanted to break up my .emacs file so that I can run either emacs 22 or emacs 21. My idea was to create a .emacs file that would set the name for the customize file based on the emacs major version number and load an additional file with my own bits and pieces etc. Something along the lines of ;; requires wanted for both emacs 21 and 22 (require 'time-date) (require 'ls-lisp) (require 'dired-x) (require 'dired-aux) (require 'generic) (require 'generic-x) (require 'align) ;; load specific custom and version files based on the major version number (cond ((eq 22 emacs-major-version) (message "Configuring for emacs 22") (load "~/.emacs22.el")) ((eq 21 emacs-major-version) (message "Configuring for emacs 21") (load "~/.emacs21.el")) (t ; "catchall - maybe I wold put xemacs stuff in here if I ran it (message "Generic Configuration") (setq custom-file "~/.emacs-custom.el") (load custom-file))) and the emacs 22 file looks like (setq custom-file "~/.emacs22-custom.el") (load custom-file) (add-to-list 'load-path "~/.emacs.d/22") ;; emacs 22 specific requires (require 'tc-browse-url) (require 'tc-diary) (require 'tc-keys) (require 'tc-template) (require 'tc-timestamp) (require 'tc-mail) (require 'tx-muse) (require 'tx-planner) (require 'tc-w3m) (require 'tx-vm-w3m) (require 'txutils) (require 'tx-ruby) ... ... However, with my init files split like this, emacs 22 segfaults while loading the tx-planner require statement. I commented out the require lines for my muse and planner configuration and then emacs appears to start OK. thinking it was something odd with planner mode, I started up mew to send an e-mail to the list and ask if anyone else had experienced anything similar, but as soon as I go to write a message, emacs 22 crashes with a segfault (signal 11). It seems any operation that tries to manipulate windows or frames can cause a segfault - but some operations don't, while others do. Still need to narrow down the exact commands which will cause a segfault. As soon as I remove the scheme to split up my .emacs file and just have a single .emacs file with the customize variables in it (still using the require statements to load my individual emacs config files etc, everything works fine and emacs 22 seems to be rock solid. I'm now going to break things down to a very basic configuration and see if I can track down the problem, or at the very least, easily reproduce it for a bug report. However, before doing that, I wanted to know if anyone else is running emacs 22 and has some sort of split init file that can make it easy to run emacs 22 and emacs 21. I figured others may have a similar requirement to me - essentially, I'm using emacs 22 all the time unless I find a problem, in which case, I might switch to emacs 21 and see if the problem exists there etc. Currently, I do this by maintaining two .emacs files, one for each version and before starting/switching to a different version, I copy the appropriate config file to .emacs. this is not a great solution as it is too easy to lose config changes when switching between versions or forget to copy over the appropriate .emacs etc I am aware of the initz package, which is supposed to provide this sort of functionality. However, therer were a number of things I didn't like about that package - it seemed a bit over engineered for what I wanted and I didn't like the idea of my init files being automatically compiled for me, plus some other personal taste things I didn't like. I seem to remember someone posting a message about problems with getting customize to work correctly once you set the customize file and unexpected behavior once you moved away from the default etc. I will look into this next. However, I figured it was worth posting to the group and see if anyone has had any luck at doing this sort of thing or experienced anything similar. Tim My environment is Debian Testing/Unstable (Only emacs-snapshot from unstable + any packages emacs-snapshot requires) GNU Emacs 22.0.92.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2007-01-07 on pacem, modified by Debian Running under X on an Intel dual core 32bit box with 1Gb of memory. All updates applied according to local Australian debian mirror at 11am today (Sunday 14) -- tcross (at) rapttech dot com dot au