From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Rant - Elisp terminology is deceptive Date: Sat, 24 Jan 2015 12:03:08 +0100 Message-ID: <87vbjw4f0z.fsf@fencepost.gnu.org> References: <87ppa4uaay.fsf@uwakimon.sk.tsukuba.ac.jp> 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 1422097419 15154 80.91.229.3 (24 Jan 2015 11:03:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 24 Jan 2015 11:03:39 +0000 (UTC) Cc: "Stephen J. Turnbull" , emacs-devel@gnu.org To: Kelly Dean Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 24 12:03:38 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 1YEyV7-0003PP-Mv for ged-emacs-devel@m.gmane.org; Sat, 24 Jan 2015 12:03:37 +0100 Original-Received: from localhost ([::1]:34627 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEyV6-0007IS-H9 for ged-emacs-devel@m.gmane.org; Sat, 24 Jan 2015 06:03:36 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEyUt-0007IG-RN for emacs-devel@gnu.org; Sat, 24 Jan 2015 06:03:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEyUs-0001gB-TR for emacs-devel@gnu.org; Sat, 24 Jan 2015 06:03:23 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34042) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEyUs-0001g7-QS for emacs-devel@gnu.org; Sat, 24 Jan 2015 06:03:22 -0500 Original-Received: from localhost ([127.0.0.1]:41218 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEyUs-0002ms-2q; Sat, 24 Jan 2015 06:03:22 -0500 Original-Received: by lola (Postfix, from userid 1000) id BFE1EE0F59; Sat, 24 Jan 2015 12:03:08 +0100 (CET) In-Reply-To: (Kelly Dean's message of "Sat, 24 Jan 2015 10:30:59 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e 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:181722 Archived-At: Kelly Dean writes: > Stephen J. Turnbull wrote: >> Buffer-local values are global values in the usual >> sense that they are instance-wide and can be accessed in local context >> if not shadowed by let-bindings and the like. > > Function parameters (or a closure's parameters and environment > variables) are global variables in the sense that they're > =E2=80=9Finstance-wide=E2=80=9D (within the entire function or closure) a= nd can be > accessed in local context if not shadowed by let-bindings. > > But =C2=ABwithin an entire function or closure=C2=BB isn't really instanc= e-wide? > Well neither is =C2=ABwithin an entire buffer=C2=BB. We are not talking about "within an entire buffer". Emacs has a notion of a "current buffer". There is no hierarchy or stack or nesting involved: the current buffer setting swaps out variables in global scope. It does not matter which module or buffer or context your global variables have been defined in. > The global environment is the outermost one. A buffer's environment is > not. That confusion seems to be the most compelling reason _not_ to mess with the terminology in order not to cause additional confusion. A buffer does not have an "environment". It has a list of global variable values to substitute whenever it is made current. There is always exactly one current buffer. You cannot _not_ have a current buffer: emacs -Q --batch --eval '(message "%S" (current-buffer))' # > There's only one global environment. There can be multiple buffers and > multiple closures, each with its own environment. =E2=80=9FBuffer-local= =E2=80=9D is a > perfectly good term for buffer-locals. Calling them =E2=80=9Fglobal=E2=80= =9D would be > misleading, and it's good that Emacs doesn't do that. > > =E2=80=9FGlobal=E2=80=9D is the right term for globals. And buffer-local variables _are_ buffer-local versions of _global_ variables. They are not scoped. With setq-default you are not setting a value that is in any manner more or less global than a buffer-local setting. It is a separate symbol slot only accessible via special commands or when no buffer-local setting exists. --=20 David Kastrup