help-gnu-emacs
[Top][All Lists]
Advanced

[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 11:13:31 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin)

Hi Drew,

On 2015-06-23 23:44, Drew Adams <drew.adams@oracle.com> writes:

>> I’m trying to get eshell-autojump to work but I’m getting
>> errors about an undefined variable (curdir). This variable is bound by a
>> let before a hook is called:
>
> Yes, but occurrences of that variable in the function called by the hook are
> not within the lexical scope of that let.

It makes sense. And I now see the big "lexical-binding:t" at the top of
the file … I guess this was recently changed and is the reason it no
longer works.

> What happens if you add (defvar curdir), to let Emacs know that the variable
> is to be dynamically scoped?

It does not seem to work. Here is what I’m trying:

M-: (defvar curdir)

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 …

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Athmospheric CO₂ average (2015-05-30, Mauna Loa Observatory): 403.41 ppm

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]