From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: hooks and let-bound variables Date: Wed, 24 Jun 2015 07:44:33 -0700 (PDT) Message-ID: <8eccbda9-800d-403f-ad79-35554153db17@default> References: <96506ece-5bd9-4750-8abd-128c77cf6c39@default> 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 1435157105 11410 80.91.229.3 (24 Jun 2015 14:45:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Jun 2015 14:45:05 +0000 (UTC) To: Alan Schmitt , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 24 16:44:53 2015 Return-path: Envelope-to: geh-help-gnu-emacs@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 1Z7lv1-0006BR-JW for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Jun 2015 16:44:51 +0200 Original-Received: from localhost ([::1]:51091 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7lv1-0000Kz-1W for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Jun 2015 10:44:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38166) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7lur-0000Kp-CH for help-gnu-emacs@gnu.org; Wed, 24 Jun 2015 10:44:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7lum-0007Fl-DS for help-gnu-emacs@gnu.org; Wed, 24 Jun 2015 10:44:41 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:32636) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7lum-0007FW-5H for help-gnu-emacs@gnu.org; Wed, 24 Jun 2015 10:44:36 -0400 Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t5OEiYnE020755 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 24 Jun 2015 14:44:34 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t5OEiXSl013176 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 24 Jun 2015 14:44:34 GMT Original-Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id t5OEiXeY015616; Wed, 24 Jun 2015 14:44:33 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6691.5000 (x86)] X-Source-IP: userv0021.oracle.com [156.151.31.71] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:105125 Archived-At: > I find very funny that I only use languages with lexical binding, > but can still be bitten by it in emacs-lisp. ;-) Yup. If you have only lexical binding then you cannot be bitten by it (or by dynamic binding). Emacs makes (good) use of dynamic binding, for exactly the kind of thing you were doing: let-binding around some code whose behavior you want to change by way of the binding. In most languages you do not ever want the behavior of existing code to change at runtime by just changing the value of a global variable (i.e, from outside that code). With Common Lisp and Emacs Lisp you do sometimes want that. http://www.gnu.org/software/emacs/emacs-paper.html#SEC17