emacs-devel
[Top][All Lists]
Advanced

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

Re: crazy interaction between buffer-locality and function-locality of v


From: Richard M. Stallman
Subject: Re: crazy interaction between buffer-locality and function-locality of variables
Date: Sun, 02 Nov 2008 18:19:10 -0500

    (make-local-variable 'ami-wcb-bug-foo)
    (defun ami-wcb-bug (ami-wcb-bug-foo)
      (with-temp-buffer
        ami-wcb-bug-foo))
    (ami-wcb-bug 'bar)

    eval'd in a *scratch* buffer results in this error: (void-variable
    ami-wcb-bug-foo)

This is intentional.  It is more coherent than the other possible
behaviors.

    Is the behavior of binding function arguments variables subject to the
    locality of the current buffer at function call time intentional?

That's a confusing way to describe things.  The current buffer
when the function is called has no direct effect on the function.
What does have an effect is switching buffers within the function.

Normally this is not a problem, because the sort of names that are
used for function arguments are never made buffer-local.  But you
encountered an exception.

      An example of where this bit me: gnus makes
    'timestamp buffer-local in *Summary* buffers, and emacs-jabber has a
    function that uses "timestamp" as the name of one of its arguments and then
    calls with-temp-buffer inside that function.

We should probably change the name of that variable in Gnus.
to something like `gnus-timestamp'.




reply via email to

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