From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Schmitt Newsgroups: gmane.emacs.help Subject: Re: hooks and let-bound variables Date: Wed, 24 Jun 2015 15:35:50 +0200 Message-ID: References: <96506ece-5bd9-4750-8abd-128c77cf6c39@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1435153006 30607 80.91.229.3 (24 Jun 2015 13:36:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Jun 2015 13:36:46 +0000 (UTC) To: 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:36:39 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 1Z7kr0-0005LW-3j for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Jun 2015 15:36:38 +0200 Original-Received: from localhost ([::1]:50788 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7kqt-00039h-7N for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Jun 2015 09:36:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38481) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7kqf-00038h-9L for help-gnu-emacs@gnu.org; Wed, 24 Jun 2015 09:36:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7kqa-00085X-9p for help-gnu-emacs@gnu.org; Wed, 24 Jun 2015 09:36:17 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:52936) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7kqa-00085M-2y for help-gnu-emacs@gnu.org; Wed, 24 Jun 2015 09:36:12 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Z7kqX-00053n-1g for help-gnu-emacs@gnu.org; Wed, 24 Jun 2015 15:36:09 +0200 Original-Received: from charm-ecran.irisa.fr ([131.254.101.83]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 24 Jun 2015 15:36:09 +0200 Original-Received: from alan.schmitt by charm-ecran.irisa.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 24 Jun 2015 15:36:09 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 48 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: charm-ecran.irisa.fr User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) Cancel-Lock: sha1:k1TrkIlftaKTrRf2zCfPAO4+nug= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:105120 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2015-06-24 15:22, Drew Adams writes: >> 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. Thank you for the suggestions. The eshell-autojump author fixed it and it=E2=80=99s now working correctly. (I find very funny that I only use lang= uages with lexical binding, but can still be bitten by it in emacs-lisp.) Alan =2D-=20 OpenPGP Key ID : 040D0A3B4ED2E5C7 Athmospheric CO=E2=82=82 average (2015-05-30, Mauna Loa Observatory): 403.4= 1 ppm --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBCgAGBQJVirI2AAoJEAQNCjtO0uXHJUwH/3Jrw0pYU51B5K2ho0qkiPnW Yye0gapIE0wzRBEpppAlmcV0cO7dpu14kebZZj5jteYaQMkHsXpcnEynpems6lcv ggpdn6MZ87jOB4Wnfz8ObJg9RPxWKQmZYkj21/BHtwnlkGXhS/H+kbHgcWwNbK2G BvIjP7cAu+SjeDOZoDzpF0NCiSrV9MKi3RpNBV+/5flNDTycHgMYbqKJ/j/z0C9V YUOo0Y3yVXQEFhDEdW3c8+/zg0K8G9yWP63tncZjyaMIs3P7HpIZpuCCcgXwPxrt GUaxa6NaczkMybihi5zuLWeK1ER5b4yvJnJ2GAU+Yh4Z2gNlt70OH47gWNiDu4Y= =Ty8x -----END PGP SIGNATURE----- --=-=-=--