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: Why is not end-of-defun-function buffer local? Date: Mon, 10 Dec 2007 00:13:02 -0500 Message-ID: References: <4759ED09.7060601@gmail.com> <475ADCA4.1020506@gmail.com> <475B48A7.2030509@gmail.com> <475BE75A.9030507@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1197263602 22661 80.91.229.12 (10 Dec 2007 05:13:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 10 Dec 2007 05:13:22 +0000 (UTC) Cc: "Lennart Borgman \(gmail\)" , Emacs Devel To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 10 06:13:33 2007 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 1J1axQ-0005iP-GD for ged-emacs-devel@m.gmane.org; Mon, 10 Dec 2007 06:13:32 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J1ax8-0006FF-HN for ged-emacs-devel@m.gmane.org; Mon, 10 Dec 2007 00:13:14 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J1ax5-0006Ex-JT for emacs-devel@gnu.org; Mon, 10 Dec 2007 00:13:11 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J1ax3-0006D8-EP for emacs-devel@gnu.org; Mon, 10 Dec 2007 00:13:10 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J1ax3-0006D5-93 for emacs-devel@gnu.org; Mon, 10 Dec 2007 00:13:09 -0500 Original-Received: from 76-10-156-34.dsl.teksavvy.com ([76.10.156.34] helo=ceviche.home) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J1ax3-0003mq-3E for emacs-devel@gnu.org; Mon, 10 Dec 2007 00:13:09 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 9E169B402D; Mon, 10 Dec 2007 00:13:02 -0500 (EST) In-Reply-To: <475BE75A.9030507@gmx.at> (martin rudalics's message of "Sun, 09 Dec 2007 14:02:18 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: 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:84945 Archived-At: >> More specifically, the problem is to decide *when* to make a variable >> buffer-local. I.e. Setting the variable via `setq' should make it >> buffer-local, but setting it with `let' shouldn't. > Has this to be carved in stone? Why should with > (defvar foo 1) > (make-variable-buffer-local 'foo) > the form below not set the default value of foo > (let ((foo 2)) > (setq-default foo 3)) > and the following form > (progn > (setq foo 4) > (let ((foo 2)) > (setq-default foo 3))) > set it? Isn't code depending on one or the other behavior silly anyway? Yes, the interaction between buffer-local bindings and let bindings is messy. There is no generally right answer, AFAICT. So we just developped some heuristic over time about what the semantics should look like, so as to work OK in most cases. The "automatically local when set" is of course making it yet a bit messier. Not sure what we should do about that. Stefan