From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: rusi Newsgroups: gmane.emacs.help Subject: Re: re-loading an elisp file Date: Sat, 5 Mar 2011 21:32:02 -0800 (PST) Organization: http://groups.google.com Message-ID: <2700f0cc-7c2a-46a3-a2d2-c2a34f3ddae9@z27g2000prz.googlegroups.com> References: <87bp1ptwn6.fsf@kuiper.lan.informatimago.com> <87r5alb4b2.fsf@rapttech.com.au> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1299390067 20684 80.91.229.12 (6 Mar 2011 05:41:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 6 Mar 2011 05:41:07 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Mar 06 06:41:01 2011 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.69) (envelope-from ) id 1Pw6iD-0002HC-1k for geh-help-gnu-emacs@m.gmane.org; Sun, 06 Mar 2011 06:41:01 +0100 Original-Received: from localhost ([127.0.0.1]:56707 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pw6iC-0006ov-CN for geh-help-gnu-emacs@m.gmane.org; Sun, 06 Mar 2011 00:41:00 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!z27g2000prz.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 33 Original-NNTP-Posting-Host: 116.73.35.230 Original-X-Trace: posting.google.com 1299389522 13261 127.0.0.1 (6 Mar 2011 05:32:02 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sun, 6 Mar 2011 05:32:02 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z27g2000prz.googlegroups.com; posting-host=116.73.35.230; posting-account=mBpa7woAAAAGLEWUUKpmbxm-Quu5D8ui User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13,gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:185659 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:79813 Archived-At: On Mar 6, 4:21=A0am, PJ Weisberg wrote: > On Sat, Mar 5, 2011 at 2:17 PM, Tim X wrote: > > The way I usually deal with this is to either reset the variable in the > > scratch buffer i.e. > > > (setq var nil) > > > then when I re-evaluate the buffer, var will be set if it is in a defva= r > > statement. > > Not true. =A0If the variable is set at all, even to nil, defvar respects > it and doesn't overwrite it with the default. =A0Otherwise putting > something like (setq flyspell-persistent-highlight nil) in your .emacs > file would have no effect. > > The way to actually do that is: > > (makunbound 'var) > > -PJ This points out the real problem -- elisp is not a functional language. In (pure) functional languages the pattern (for loading) is to 'clean the slate' and then load. IOW everything -- variable, function, type -- that was defined in this module is first 'makunbounded' and then the module is loaded. It would certainly be worthwhile to have such a feature in emacs. I guess its not easy to do unless one has available the pair-list of the form: ((var defined-in-file)...). Another problem that would probably muddy the waters are macros...