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 06:22:08 -0700 (PDT) Message-ID: 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 1435152161 16679 80.91.229.3 (24 Jun 2015 13:22:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Jun 2015 13:22:41 +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 15:22:30 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 1Z7kdJ-0003Kn-BQ for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Jun 2015 15:22:29 +0200 Original-Received: from localhost ([::1]:50682 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7kdI-0003g6-Lf for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Jun 2015 09:22:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33201) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7kd3-0003fk-Dp for help-gnu-emacs@gnu.org; Wed, 24 Jun 2015 09:22:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7kd0-0000fh-9A for help-gnu-emacs@gnu.org; Wed, 24 Jun 2015 09:22:13 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:31584) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7kd0-0000fV-1I for help-gnu-emacs@gnu.org; Wed, 24 Jun 2015 09:22:10 -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 t5ODM8pY012196 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 24 Jun 2015 13:22:09 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t5ODM8OM008711 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Wed, 24 Jun 2015 13:22:08 GMT Original-Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userv0121.oracle.com (8.13.8/8.13.8) with ESMTP id t5ODM8J7018756; Wed, 24 Jun 2015 13:22:08 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:105118 Archived-At: > It makes sense. And I now see the big "lexical-binding:t" at the top > of the file =E2=80=A6 I guess this was recently changed and is the reason= it no > longer works. >=20 > > What happens if you add (defvar curdir), to let Emacs know that > > the variable is to be dynamically scoped? >=20 > It does not seem to work. Here is what I=E2=80=99m trying: > M-: (defvar curdir) Try putting that in the file that has the lexical-binding declaration. Or evaluating that before that file gets compiled or loaded. > then use autojump, but it tells me the value of curdir is still > void. I guess I need to change the code of eshell for this to work =E2=80= =A6 Maybe someone else will have a better suggestion. But I think that's the problem anyway: `curdir' is being handled as a lexical variable when the code that invokes the hook function is run.