unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Emacs 22 problems with split init file
@ 2007-01-14  7:36 Tim X
  2007-01-14 11:14 ` Peter Dyballa
       [not found] ` <mailman.3046.1168773302.2155.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 6+ messages in thread
From: Tim X @ 2007-01-14  7:36 UTC (permalink / 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Emacs 22 problems with split init file
  2007-01-14  7:36 Emacs 22 problems with split init file Tim X
@ 2007-01-14 11:14 ` Peter Dyballa
       [not found] ` <mailman.3046.1168773302.2155.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 6+ messages in thread
From: Peter Dyballa @ 2007-01-14 11:14 UTC (permalink / raw)



Am 14.01.2007 um 08:36 schrieb Tim X:

> I wanted to break up my .emacs file so that I can run either emacs  
> 22 or emacs
> 21.

I have a different layout, which also puts the customisation (or  
desktop/session settings) into different files – and I suppose it's  
the customisation that leads to your crashes (I really have no  
customisation in ~/.emacs and neither a *common* customisation file):

	(defconst mWS (symbol-value 'window-system)
	  "Running as some windowing system's client,
	   or as slave of a terminal emulator?")
	(setq custom-file (format "~/.emacs-Abrichtung-%d.el" emacs-major- 
version))
	(load custom-file)
	(load (format "~/.emacs_%s" mWS))

In ~/.emacs blocks are built for different Emacs versions.


I'd recommend to remove ~/.emacs-custom.el and put its contents into  
both ~/.emacs2?-custom.el files.

--
Greetings

   Pete

"A mathematician is a machine that turns coffee into theorems."

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Emacs 22 problems with split init file
       [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>
  0 siblings, 2 replies; 6+ messages in thread
From: Tim X @ 2007-01-15  6:42 UTC (permalink / raw)


Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> Am 14.01.2007 um 08:36 schrieb Tim X:
>
>> I wanted to break up my .emacs file so that I can run either emacs  22 or
>> emacs
>> 21.
>
> I have a different layout, which also puts the customisation (or
> desktop/session settings) into different files – and I suppose it's  the
> customisation that leads to your crashes (I really have no  customisation in
> ~/.emacs and neither a *common* customisation file):
>
> 	(defconst mWS (symbol-value 'window-system)
> 	  "Running as some windowing system's client,
> 	   or as slave of a terminal emulator?")
> 	(setq custom-file (format "~/.emacs-Abrichtung-%d.el" emacs-major- 
> version))
> 	(load custom-file)
> 	(load (format "~/.emacs_%s" mWS))
>
> In ~/.emacs blocks are built for different Emacs versions.
>
>
> I'd recommend to remove ~/.emacs-custom.el and put its contents into  both
> ~/.emacs2?-custom.el files.
>
> --

Thanks Pete. Actually, I have my custom variable stuff in two different files
already - one for emacs22 and one for emacs 21. The emacs-custom.el file is a
catch-all in case things were not working and theoretically, should never get
called or have anything written into it. However, I do suspect it is something
related to the customize stuff which is causeing the seg faults.

Tim

-- 
tcross (at) rapttech dot com dot au

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Emacs 22 problems with split init file
  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>
  1 sibling, 0 replies; 6+ messages in thread
From: Peter Dyballa @ 2007-01-15 10:14 UTC (permalink / raw)



Am 15.01.2007 um 07:42 schrieb Tim X:

> However, I do suspect it is something
> related to the customize stuff which is causeing the seg faults.

How about putting

	(message "From <this or that> custom file starts here")
	(message "From <this or that> custom file ends here")

into your custom files? (You can also put some into ~/.emacs.) It's  
only useful when you're able to to see the *Messages* buffer, so it  
could be a good idea to comment the whole block of settings starting  
with

	(custom-set-variables

and ending with ``)´´ and see whether this leads to no crashes. Then  
uncomment the first and the last line of customisation, to have a  
valid ELisp statement, and see whether it's still OK. Next comes a  
loop of binary dividing the customisation, i.e., finding the  
increasingly smaller region with the faulty setting in it ...

--
Greetings

   Pete

“One cannot live by television, video games, top ten CDs, and dumb  
movies alone”
       (Amiri Baraka 1999)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Emacs 22 problems with split init file
       [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
  0 siblings, 1 reply; 6+ messages in thread
From: Tim X @ 2007-01-15 21:50 UTC (permalink / raw)


Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> Am 15.01.2007 um 07:42 schrieb Tim X:
>
>> However, I do suspect it is something
>> related to the customize stuff which is causeing the seg faults.
>
> How about putting
>
> 	(message "From <this or that> custom file starts here")
> 	(message "From <this or that> custom file ends here")
>
> into your custom files? (You can also put some into ~/.emacs.) It's  only
> useful when you're able to to see the *Messages* buffer, so it  could be a good
> idea to comment the whole block of settings starting  with
>
> 	(custom-set-variables
>
> and ending with ``)´´ and see whether this leads to no crashes. Then  uncomment
> the first and the last line of customisation, to have a  valid ELisp statement,
> and see whether it's still OK. Next comes a  loop of binary dividing the
> customisation, i.e., finding the  increasingly smaller region with the faulty
> setting in it ...
>
> --

Hi Pete,

I've already tried that. The custom file (the correct one for the version of
emacs i.e. 22) is getting loaded and all the customization seems correct. In
fact, there don't seem to be any problems after starting emacs. However, when
you go to do certain operations after emacs has booted, such as start a mail
reading client, you will go to perform some operation and emacs crashes with
the segfault error. As soon as you use just a single init file, there are no
problems. 

I'll keep experimenting and see what happens. I have considerable amounts of
custom stuff and eliminating them in a methodical way is time consuming. 

Tim

-- 
tcross (at) rapttech dot com dot au

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Emacs 22 problems with split init file
  2007-01-15 21:50       ` Tim X
@ 2007-01-15 23:27         ` Peter Dyballa
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Dyballa @ 2007-01-15 23:27 UTC (permalink / raw)



Am 15.01.2007 um 22:50 schrieb Tim X:

> As soon as you use just a single init file, there are no problems.

I am using exactly one file with

	(custom-set-variables

and

	(custom-set-faces

and a few others with just ELisp code. And it works. On Mac OS X.

--
Greetings

   Pete

The day Microsoft makes something that doesn't suck
is the day they start selling vacuum cleaners.
                                     Ernest Jan Plugge

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-01-15 23:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-14  7:36 Emacs 22 problems with split init file Tim X
2007-01-14 11:14 ` 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

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).