From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Tassilo Horn <tsdh@gnu.org>
Cc: 21311@debbugs.gnu.org
Subject: bug#21311: 25.0.50; non-defvared hooks are not declared special with lexical-binding
Date: Fri, 21 Aug 2015 09:48:53 -0400 [thread overview]
Message-ID: <jwvh9ns4uwv.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <87vbc8g8dn.fsf@gnu.org> (Tassilo Horn's message of "Fri, 21 Aug 2015 13:59:16 +0200")
> It seems that hooks that are not declared using defvar but come into
> being just because of a (add-hook 'my-hook ...) are not declared as
> special meaning you cannot let-bind them to change their value in the
> dynamic scope of the let.
Yes.
> The bug disappears as soon as I
> - don't use lexical-binding, or
> - defvar the hook (Fix #1 or #2)
I think either of fix #1 or #2 are proper fixes and I think there's not
much more we can do about it.
If the hook hasn't been created yet at all (neither defvar, nor
add-hook) then fix #1 or #2 are really the only options.
Arguably, nowadays packages should defvar all their hooks.
Stefan
next prev parent reply other threads:[~2015-08-21 13:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-21 11:59 bug#21311: 25.0.50; non-defvared hooks are not declared special with lexical-binding Tassilo Horn
2015-08-21 13:48 ` Stefan Monnier [this message]
2015-08-21 15:03 ` Drew Adams
2015-08-21 15:40 ` Tassilo Horn
2015-08-22 6:05 ` Tassilo Horn
2015-08-22 18:12 ` Glenn Morris
2015-08-23 5:17 ` Tassilo Horn
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvh9ns4uwv.fsf-monnier+emacsbugs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=21311@debbugs.gnu.org \
--cc=tsdh@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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.