[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: hooks and let-bound variables
From: |
Alan Schmitt |
Subject: |
Re: hooks and let-bound variables |
Date: |
Wed, 24 Jun 2015 15:35:50 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) |
On 2015-06-24 15:22, Drew Adams <drew.adams@oracle.com> writes:
>> It does not seem to work. Here is what I’m 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 …
>
> 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’s now working correctly. (I find very funny that I only use languages
with lexical binding, but can still be bitten by it in emacs-lisp.)
Alan
--
OpenPGP Key ID : 040D0A3B4ED2E5C7
Athmospheric CO₂ average (2015-05-30, Mauna Loa Observatory): 403.41 ppm
signature.asc
Description: PGP signature