unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Alan Schmitt <alan.schmitt@polytechnique.org>
To: help-gnu-emacs@gnu.org
Subject: Re: hooks and let-bound variables
Date: Wed, 24 Jun 2015 15:35:50 +0200	[thread overview]
Message-ID: <m2r3p1dya1.fsf@charm-ecran.irisa.fr> (raw)
In-Reply-To: cabbccb8-1351-44a3-b7f9-f23e99befc6c@default

[-- Attachment #1: Type: text/plain, Size: 986 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

  reply	other threads:[~2015-06-24 13:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-23 19:15 hooks and let-bound variables Alan Schmitt
2015-06-23 21:44 ` Drew Adams
2015-06-24  9:13   ` Alan Schmitt
2015-06-24 13:22     ` Drew Adams
2015-06-24 13:35       ` Alan Schmitt [this message]
2015-06-24 14:44         ` Drew Adams
2015-06-24 15:48           ` tomas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2r3p1dya1.fsf@charm-ecran.irisa.fr \
    --to=alan.schmitt@polytechnique.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).