From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Richard M. Stallman" Newsgroups: gmane.emacs.devel Subject: Re: crazy interaction between buffer-locality and function-locality of variables Date: Sun, 02 Nov 2008 18:19:10 -0500 Message-ID: References: <9aa0cfde0811012034h30c79d6cxa66f6ee0754e027d@mail.gmail.com> Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: ger.gmane.org 1225668140 9893 80.91.229.12 (2 Nov 2008 23:22:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Nov 2008 23:22:20 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Ami Fischman" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 03 00:23:23 2008 connect(): Connection refused Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KwmHy-000121-L4 for ged-emacs-devel@m.gmane.org; Mon, 03 Nov 2008 00:23:23 +0100 Original-Received: from localhost ([127.0.0.1]:46274 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KwmGr-0003wk-Pq for ged-emacs-devel@m.gmane.org; Sun, 02 Nov 2008 18:22:13 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KwmGn-0003wO-Ob for emacs-devel@gnu.org; Sun, 02 Nov 2008 18:22:09 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KwmGl-0003vt-3A for emacs-devel@gnu.org; Sun, 02 Nov 2008 18:22:08 -0500 Original-Received: from [199.232.76.173] (port=33309 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KwmGk-0003vj-RA for emacs-devel@gnu.org; Sun, 02 Nov 2008 18:22:06 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]:49520) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KwmGk-0006lU-FK for emacs-devel@gnu.org; Sun, 02 Nov 2008 18:22:06 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1KwmDu-0001Hz-9b; Sun, 02 Nov 2008 18:19:10 -0500 In-reply-to: <9aa0cfde0811012034h30c79d6cxa66f6ee0754e027d@mail.gmail.com> (ami@fischman.org) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:105275 Archived-At: (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'.