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 15:05:21 -0500 Message-ID: References: <9aa0cfde0811012034h30c79d6cxa66f6ee0754e027d@mail.gmail.com> <9aa0cfde0811020943l24121f8cj78bbf82709036f9d@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 1225656339 7068 80.91.229.12 (2 Nov 2008 20:05:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Nov 2008 20:05:39 +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 21:06:41 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 1KwjDb-000802-OT for ged-emacs-devel@m.gmane.org; Sun, 02 Nov 2008 21:06:40 +0100 Original-Received: from localhost ([127.0.0.1]:56491 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KwjCU-0003ku-Nm for ged-emacs-devel@m.gmane.org; Sun, 02 Nov 2008 15:05:30 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KwjCP-0003jN-UD for emacs-devel@gnu.org; Sun, 02 Nov 2008 15:05:26 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KwjCO-0003hv-E1 for emacs-devel@gnu.org; Sun, 02 Nov 2008 15:05:25 -0500 Original-Received: from [199.232.76.173] (port=46796 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KwjCO-0003ha-4c for emacs-devel@gnu.org; Sun, 02 Nov 2008 15:05:24 -0500 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]:5596 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KwjCN-0002Mr-Bj for emacs-devel@gnu.org; Sun, 02 Nov 2008 15:05:23 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AoMGAESWDUlMCqyo/2dsb2JhbACBdoEwxVGDUoEP X-IronPort-AV: E=Sophos;i="4.33,530,1220241600"; d="scan'208";a="29239642" Original-Received: from 76-10-172-168.dsl.teksavvy.com (HELO ceviche.home) ([76.10.172.168]) by ironport2-out.teksavvy.com with ESMTP; 02 Nov 2008 15:05:22 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 0FD84B4087; Sun, 2 Nov 2008 15:05:22 -0500 (EST) In-Reply-To: <9aa0cfde0811020943l24121f8cj78bbf82709036f9d@mail.gmail.com> (Ami Fischman's message of "Sun, 2 Nov 2008 09:43:15 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:105268 Archived-At: > My point was that the only way to avoid mixing the behaviors is to > make variable names unwieldy. As an async-event-handler-writer all > function arguments and local variables must be > globally-uniquely-named, and as a major-mode writer all buffer-local > variables must be globally-uniquely-named. Actually, function arguments (and typical local variables) don't need to be globally unique: they just need to use a name space that's not used for buffer-local variables. In Emacs we get this behavior as follows: buffer-local variables should use a package prefix. > The latter is perhaps not too terrible a burden, but the former would > make coding in elisp unbearable IMO. Indeed, which is why the convention moves the responsability to the buffer-local side. >> > 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? > At least also at the same place as the warning about the conflict > between buffer-locals and let-binding in elisp.info that I pointed to > in my original email. But also this should be a great big warning in > the defun docs of the make-variable-*-local and make-local-variable > since it's the authors using those functions (and friends? I don't > have a complete list) that must shoulder the burden of avoiding > collisions. Hmm... at the place you mentioned in the elisp.info, we're kind of far from discussing naming conventions, but I'll try and add a cross-ref. Stefan