unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Tim X <timx@nospam.dev.null>
Subject: Emacs 22 problems with split init file
Date: Sun, 14 Jan 2007 18:36:06 +1100	[thread overview]
Message-ID: <87hcuurrfd.fsf@lion.rapttech.com.au> (raw)


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	other threads:[~2007-01-14  7:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-14  7:36 Tim X [this message]
2007-01-14 11:14 ` Emacs 22 problems with split init file Peter Dyballa
     [not found] ` <mailman.3046.1168773302.2155.help-gnu-emacs@gnu.org>
2007-01-15  6:42   ` Tim X
2007-01-15 10:14     ` Peter Dyballa
     [not found]     ` <mailman.3068.1168856053.2155.help-gnu-emacs@gnu.org>
2007-01-15 21:50       ` Tim X
2007-01-15 23:27         ` Peter Dyballa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87hcuurrfd.fsf@lion.rapttech.com.au \
    --to=timx@nospam.dev.null \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).