[Top][All Lists]

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

Re: re-loading an elisp file

From: Tim X
Subject: Re: re-loading an elisp file
Date: Sun, 06 Mar 2011 09:25:37 +1100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

ken <address@hidden> writes:

> On 03/05/2011 10:54 AM Drew Adams wrote:
>>> Is there a way, when reloading an elisp file, to have it examine (and
>>> reload new) values of variables?  It's weird that this isn't done with
>>> "eval-current-buffer" or "load ..." and others.
>> Sounds like you are discovering that `defvar' does not assign a variable a 
>> value
>> if it already has one.  
> Actually, I thought my computer had some corrupt memory... but then I
> googled and after a time read about it on a forum on the web.
>> This is a feature.
> Hmm.  I've heard that said before.
>> `setq' and `setq-default' do, however.
>> But in general an Elisp library should not act this way, by design.  A 
>> personal
>> init file is another story - there you might want to use `setq' and
>> `setq-default' in some cases.
> The forum said that the simplest way to re-initialize a variable in
> elisp was to reboot emacs.  I thought, "that's knuckle-headed... can't
> be true."  But I guess it is.  Your work-around though-- changing all
> the defvar's to setq's-- is preferable.

I would be very cautious regarding any forum that provided advice like
that. I suspect they would also recommend rebooting the computer
whenever there is a problem a la "The IT Crowd"

I help maintain a couple of elisp packages, write a fair amount of
elips for personal use and only reboot emacs if I've upgraded/built a
new version or my computer needs to be rebooted (well, I might also do a
reboot if I've fixed a lot of bugs and want to make sure they work in a
fresh session prior to committing them to vc just as a final test). 

One of the huge advantages of lisp like languages is that you can modify
the running system without having to kill everything and restart. 

tcross (at) rapttech dot com dot au

reply via email to

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