all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Richard M. Stallman" <rms@gnu.org>
To: "Ami Fischman" <ami@fischman.org>
Cc: emacs-devel@gnu.org
Subject: Re: crazy interaction between buffer-locality and function-locality of variables
Date: Sun, 02 Nov 2008 18:19:10 -0500	[thread overview]
Message-ID: <E1KwmDu-0001Hz-9b@fencepost.gnu.org> (raw)
In-Reply-To: <9aa0cfde0811012034h30c79d6cxa66f6ee0754e027d@mail.gmail.com> (ami@fischman.org)

    (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'.




  parent reply	other threads:[~2008-11-02 23:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-02  3:34 crazy interaction between buffer-locality and function-locality of variables Ami Fischman
2008-11-02 16:57 ` Stefan Monnier
2008-11-02 17:43   ` Ami Fischman
2008-11-02 20:05     ` Stefan Monnier
2008-11-02 20:31       ` crazy interaction between buffer-locality and function-localityof variables Drew Adams
2008-11-02 23:19 ` Richard M. Stallman [this message]
2008-11-02 23:59   ` crazy interaction between buffer-locality and function-locality of variables Ami Fischman

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1KwmDu-0001Hz-9b@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=ami@fischman.org \
    --cc=emacs-devel@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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.