help-gnu-emacs
[Top][All Lists]
Advanced

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

Emacs 22 problems with split init file


From: Tim X
Subject: Emacs 22 problems with split init file
Date: Sun, 14 Jan 2007 18:36:06 +1100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.92 (gnu/linux)

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


reply via email to

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