unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: rusi <rustompmody@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: re-loading an elisp file
Date: Sat, 5 Mar 2011 21:32:02 -0800 (PST)	[thread overview]
Message-ID: <2700f0cc-7c2a-46a3-a2d2-c2a34f3ddae9@z27g2000prz.googlegroups.com> (raw)
In-Reply-To: mailman.3.1299367324.22865.help-gnu-emacs@gnu.org

On Mar 6, 4:21 am, PJ Weisberg <p...@irregularexpressions.net> wrote:
> On Sat, Mar 5, 2011 at 2:17 PM, Tim X <t...@nospam.dev.null> 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 defvar
> > statement.
>
> Not true.  If the variable is set at all, even to nil, defvar respects
> it and doesn't overwrite it with the default.  Otherwise 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...


  parent reply	other threads:[~2011-03-06  5:32 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.6.1299338195.13665.help-gnu-emacs@gnu.org>
2011-03-05 15:27 ` re-loading an elisp file Pascal J. Bourguignon
2011-03-05 16:46   ` ken
     [not found]   ` <mailman.18.1299343589.13665.help-gnu-emacs@gnu.org>
2011-03-05 17:41     ` Johan Bockgård
2011-03-05 23:09       ` ken
2011-03-05 22:17     ` Tim X
2011-03-05 23:21       ` PJ Weisberg
     [not found]       ` <mailman.3.1299367324.22865.help-gnu-emacs@gnu.org>
2011-03-06  0:05         ` Tim X
2011-03-06  5:32         ` rusi [this message]
2011-03-06  8:36           ` Le Wang
2011-03-08  1:18             ` Kevin Rodgers
     [not found]             ` <mailman.0.1299547100.4111.help-gnu-emacs@gnu.org>
2011-03-08  1:57               ` rusi
2011-03-08  2:01                 ` rusi
2011-03-24 18:02       ` David Combs
2011-03-25  6:39         ` Tim X
2011-03-25  6:51           ` David Kastrup
2011-03-25  8:45             ` Jambunathan K
2011-03-25 22:23             ` Tim X
     [not found]             ` <mailman.2.1301064125.24725.help-gnu-emacs@gnu.org>
2011-03-25 23:01               ` Tim X
2011-03-26  4:25                 ` Jambunathan K
     [not found]                 ` <mailman.0.1301164236.2084.help-gnu-emacs@gnu.org>
2011-03-26 22:49                   ` Tim X
2011-03-05 15:16 ken
2011-03-05 15:54 ` Drew Adams
2011-03-05 17:13   ` ken
2011-03-05 18:06     ` Drew Adams
2011-03-05 18:11     ` Drew Adams
2011-03-05 23:36       ` ken
2011-03-06  2:08         ` PJ Weisberg
     [not found]         ` <mailman.22.1299377327.22865.help-gnu-emacs@gnu.org>
2011-03-24 18:31           ` David Combs
2011-03-24 18:57             ` Drew Adams
     [not found]     ` <mailman.4.1299348453.24947.help-gnu-emacs@gnu.org>
2011-03-24 18:24       ` David Combs
2011-03-24 19:09         ` Drew Adams
     [not found]   ` <mailman.0.1299345251.24947.help-gnu-emacs@gnu.org>
2011-03-05 22:25     ` Tim X

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=2700f0cc-7c2a-46a3-a2d2-c2a34f3ddae9@z27g2000prz.googlegroups.com \
    --to=rustompmody@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /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).