From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.devel Subject: Re: Why looking-at-p works? Date: Wed, 07 Mar 2018 14:06:29 +0100 Message-ID: <87bmg02fxm.fsf@mbork.pl> References: <87tvtttz49.fsf@mbork.pl> <87ina9szq2.fsf@mbork.pl> <53ed13d7-1228-4325-83cc-ebea329221ea@default> <87efkwtfp1.fsf@mbork.pl> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1520427961 29997 195.159.176.226 (7 Mar 2018 13:06:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 7 Mar 2018 13:06:01 +0000 (UTC) User-Agent: mu4e 1.1.0; emacs 27.0.50 Cc: John Mastro , Drew Adams To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 07 14:05:56 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1etYlY-0006tQ-3D for ged-emacs-devel@m.gmane.org; Wed, 07 Mar 2018 14:05:56 +0100 Original-Received: from localhost ([::1]:33277 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etYnZ-0000BT-5g for ged-emacs-devel@m.gmane.org; Wed, 07 Mar 2018 08:08:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etYmU-00009j-6M for emacs-devel@gnu.org; Wed, 07 Mar 2018 08:06:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etYmQ-0005Ij-I6 for emacs-devel@gnu.org; Wed, 07 Mar 2018 08:06:53 -0500 Original-Received: from mail.mojserwer.eu ([195.110.48.8]:57154) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etYmQ-0005IQ-1q for emacs-devel@gnu.org; Wed, 07 Mar 2018 08:06:50 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id ECCEEE670A; Wed, 7 Mar 2018 14:06:48 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zNymFf9uH-ek; Wed, 7 Mar 2018 14:06:44 +0100 (CET) Original-Received: from localhost (188.47.41.75.ipv4.supernova.orange.pl [188.47.41.75]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 2D452E66FB; Wed, 7 Mar 2018 14:06:44 +0100 (CET) In-reply-to: <87efkwtfp1.fsf@mbork.pl> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.110.48.8 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:223405 Archived-At: --=-=-= Content-Type: text/plain How about this patch? On 2018-03-07, at 10:09, Marcin Borkowski wrote: > On 2018-03-06, at 23:23, Drew Adams wrote: > >>> Where is it documented? I could find it neither in the Elisp >>> Reference nor in let's docstring. >> >> You might need to read a tiny bit between the lines, but this >> (from (elisp) `Local Variables') pretty much suggests it: >> >> Sometimes it is useful to give a variable a "local value"-a >> value that takes effect only within a certain part of a Lisp >> program. >> >> It might have said "is in effect" instead of "takes effect". >> >> To take another example, the 'let' special form explicitly >> establishes local bindings for specific variables, which >> take effect within the body of the 'let' form. >> >> Again, "are in effect only" instead of "take effect". >> >> (Consider suggesting a doc improvement for this point - >> `M-x report-emacs-bug'. And yes, probably the doc string >> should mention "_local_ variable".) > > Thanks (to you, and also to Nick) for pointing me here. I would not > call this very explicit;-). I'll try to prepare a patch for the docs > today. > > Best, -- Marcin Borkowski http://mbork.pl --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Reword-docs-of-let-and-let.patch >From dfd9978d839eccf744835e2e1daed9e140800214 Mon Sep 17 00:00:00 2001 From: Marcin Borkowski Date: Wed, 7 Mar 2018 14:03:57 +0100 Subject: [PATCH] Reword docs of let and let* Make it slightly more prominent that local bindings are destroyed in case of an error within let's body. --- doc/lispref/variables.texi | 4 ++-- src/eval.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index e025d3fd10..49eba3816e 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -155,7 +155,7 @@ Local Variables Global variables have values that last until explicitly superseded with new values. Sometimes it is useful to give a variable a -@dfn{local value}---a value that takes effect only within a certain +@dfn{local value}---a value that is in effect only within a certain part of a Lisp program. When a variable has a local value, we say that it is @dfn{locally bound} to that value, and that it is a @dfn{local variable}. @@ -165,7 +165,7 @@ Local Variables function call; these local bindings take effect within the body of the function. To take another example, the @code{let} special form explicitly establishes local bindings for specific variables, which -take effect within the body of the @code{let} form. +are in effect only within the body of the @code{let} form. We also speak of the @dfn{global binding}, which is where (conceptually) the global value is kept. diff --git a/src/eval.c b/src/eval.c index 08a73b1e4a..bc08f0d084 100644 --- a/src/eval.c +++ b/src/eval.c @@ -843,7 +843,7 @@ DEFUN ("internal-make-var-non-special", Fmake_var_non_special, DEFUN ("let*", FletX, SletX, 1, UNEVALLED, 0, - doc: /* Bind variables according to VARLIST then eval BODY. + doc: /* Bind local variables according to VARLIST then eval BODY. The value of the last form in BODY is returned. Each element of VARLIST is a symbol (which is bound to nil) or a list (SYMBOL VALUEFORM) (which binds SYMBOL to the value of VALUEFORM). @@ -902,7 +902,7 @@ usage: (let* VARLIST BODY...) */) } DEFUN ("let", Flet, Slet, 1, UNEVALLED, 0, - doc: /* Bind variables according to VARLIST then eval BODY. + doc: /* Bind local variables according to VARLIST then eval BODY. The value of the last form in BODY is returned. Each element of VARLIST is a symbol (which is bound to nil) or a list (SYMBOL VALUEFORM) (which binds SYMBOL to the value of VALUEFORM). -- 2.16.2 --=-=-=--