From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kelly Dean Newsgroups: gmane.emacs.devel Subject: Re: Rant - Elisp terminology is deceptive Date: Sat, 24 Jan 2015 23:24:49 +0000 Message-ID: <4FMMk0pLUrXu73HsWAPNrK3cw3LlAT0PayRH8aoS4es@local> References: <87vbjw4f0z.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1422141972 5348 80.91.229.3 (24 Jan 2015 23:26:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 24 Jan 2015 23:26:12 +0000 (UTC) Cc: emacs-devel@gnu.org To: David Kastrup Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 25 00:26:12 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YFA5j-0001S6-T3 for ged-emacs-devel@m.gmane.org; Sun, 25 Jan 2015 00:26:12 +0100 Original-Received: from localhost ([::1]:36368 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFA5j-0005rT-4q for ged-emacs-devel@m.gmane.org; Sat, 24 Jan 2015 18:26:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFA5X-0005rK-5c for emacs-devel@gnu.org; Sat, 24 Jan 2015 18:26:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YFA5W-00036n-9B for emacs-devel@gnu.org; Sat, 24 Jan 2015 18:25:59 -0500 Original-Received: from relay5-d.mail.gandi.net ([2001:4b98:c:538::197]:42635) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFA5S-00033r-MP; Sat, 24 Jan 2015 18:25:54 -0500 Original-Received: from mfilter9-d.gandi.net (mfilter9-d.gandi.net [217.70.178.138]) by relay5-d.mail.gandi.net (Postfix) with ESMTP id 6F8D941C061; Sun, 25 Jan 2015 00:25:52 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter9-d.gandi.net Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]) by mfilter9-d.gandi.net (mfilter9-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id ROl7wM24ld30; Sun, 25 Jan 2015 00:25:51 +0100 (CET) X-Originating-IP: 66.220.3.179 Original-Received: from localhost (gm179.geneticmail.com [66.220.3.179]) (Authenticated sender: kelly@prtime.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 5516441C04E; Sun, 25 Jan 2015 00:25:49 +0100 (CET) In-Reply-To: <87vbjw4f0z.fsf@fencepost.gnu.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4b98:c:538::197 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:181733 Archived-At: David Kastrup wrote: > A buffer does not have an "environment". What do you call the thing that lists the bindings of buffer-local variab= les to values? The standard term for a list of bindings of variables to v= alues that's used for resolving variable references, both in Lisp and els= ewhere, is =E2=80=9Fenvironment=E2=80=9D. > It has a list of global variable values > to substitute whenever it is made current. You mean like a closure can have? (A closure's environment can also have = variables with names that aren't names of global variables, but that's no= t the point here.) (setq foo (lexical-let ((shift-select-mode 'bar)) (lambda () shift-select-mode))) (funcall foo) =E2=86=92 bar > buffer-local variables _are_ buffer-local versions of _global_ > variables. shift-select-mode above is a closure-local version of a global variable. > With setq-default you are not setting > a value that is in any manner more or less global than a buffer-local > setting. setq-default sets the global variable, which is visible in other buffers = (unless they shadow it with their own buffer-locals). A buffer-local variable is not visible in other buffers. I don't know how buffer-locals are implemented internally, but from a use= r's (and Elisp programmer's) point of view, a buffer has an environment w= ith variables that shadow global variables. If the value of each variable= in that environment is stored as part of the structure that stores the v= alue of the same-named global variable rather than being stored in a sepa= rate list of bindings for the environment, that's irrelevant. The effect = is the same. The help system agrees with me. It doesn't call buffer-locals =E2=80=9Fgl= obal=E2=80=9D. It _contrasts_ buffer-locals and globals. E.g. describe-va= riable for mark-active tells me: mark-active is a variable defined in `buffer.c'. Its value is t Local in buffer *Help*; global value is nil