From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: crazy interaction between buffer-locality and function-locality of variables Date: Sun, 02 Nov 2008 11:57:51 -0500 Message-ID: References: <9aa0cfde0811012034h30c79d6cxa66f6ee0754e027d@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1225645133 7676 80.91.229.12 (2 Nov 2008 16:58:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Nov 2008 16:58:53 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Ami Fischman" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 02 17:59:55 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 1KwgIt-0001Wv-4W for ged-emacs-devel@m.gmane.org; Sun, 02 Nov 2008 17:59:55 +0100 Original-Received: from localhost ([127.0.0.1]:36642 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KwgHm-0001Qa-OZ for ged-emacs-devel@m.gmane.org; Sun, 02 Nov 2008 11:58:46 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KwgHh-0001QV-OS for emacs-devel@gnu.org; Sun, 02 Nov 2008 11:58:41 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KwgHf-0001Pv-90 for emacs-devel@gnu.org; Sun, 02 Nov 2008 11:58:40 -0500 Original-Received: from [199.232.76.173] (port=33176 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KwgHe-0001Ph-UO for emacs-devel@gnu.org; Sun, 02 Nov 2008 11:58:38 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:45298) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KwgHe-0002Rj-Dq for emacs-devel@gnu.org; Sun, 02 Nov 2008 11:58:38 -0500 Original-Received: from ceviche.home (vpn-132-204-232-32.acd.umontreal.ca [132.204.232.32]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id mA2Gvr8P024120; Sun, 2 Nov 2008 11:57:54 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 259B2B4087; Sun, 2 Nov 2008 11:57:51 -0500 (EST) In-Reply-To: <9aa0cfde0811012034h30c79d6cxa66f6ee0754e027d@mail.gmail.com> (Ami Fischman's message of "Sat, 1 Nov 2008 20:34:07 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3138=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:105264 Archived-At: > Is the behavior of binding function arguments variables subject to the > locality of the current buffer at function call time intentional? It makes Yes. It's not great, but there's no easy fix for it. > writing functions that respond to asynchronous events require using > local variables with names that are globally unique (prefixed with > package name, presumably), which is a PITA. 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. Indeed, it's a Gnus bug. Please report it there. > It seems to me that this behavior is broken, but if it's to be kept It's partly broken, but other behaviors are broken in other ways. The only good solution is to be careful not to mix them up (except when it's really wanted, such as with default-directory which is often let-bound). > there needs to be strong guidance against making variables whose names > /aren't/ prefixed with the package name buffer-local. Agreed. Where would you like to see it? In the coding conventions? Stefan