From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs 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 Message-ID: References: <87vbc8g8dn.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1440164970 11709 80.91.229.3 (21 Aug 2015 13:49:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Aug 2015 13:49:30 +0000 (UTC) Cc: 21311@debbugs.gnu.org To: Tassilo Horn Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 21 15:49:10 2015 Return-path: Envelope-to: geb-bug-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 1ZSmgv-0000o0-Qv for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Aug 2015 15:49:10 +0200 Original-Received: from localhost ([::1]:41670 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZSmgv-0007TA-Ee for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Aug 2015 09:49:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46702) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZSmgo-0007SZ-RM for bug-gnu-emacs@gnu.org; Fri, 21 Aug 2015 09:49:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZSmgo-000352-1m for bug-gnu-emacs@gnu.org; Fri, 21 Aug 2015 09:49:02 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42099) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZSmgn-00034v-VO for bug-gnu-emacs@gnu.org; Fri, 21 Aug 2015 09:49:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZSmgn-0000QP-Os for bug-gnu-emacs@gnu.org; Fri, 21 Aug 2015 09:49:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Aug 2015 13:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21311 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21311-submit@debbugs.gnu.org id=B21311.14401649361622 (code B ref 21311); Fri, 21 Aug 2015 13:49:01 +0000 Original-Received: (at 21311) by debbugs.gnu.org; 21 Aug 2015 13:48:56 +0000 Original-Received: from localhost ([127.0.0.1]:34309 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZSmgi-0000Q5-GM for submit@debbugs.gnu.org; Fri, 21 Aug 2015 09:48:56 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:22567) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZSmgg-0000Px-L1 for 21311@debbugs.gnu.org; Fri, 21 Aug 2015 09:48:54 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AwEwA731xV/5P+d0tcgxCEAoVVuzcJhH6CTQQCAoE8ORQBAQEBAQEBgQpBBYNdAQEDAVYjBQsLDiYSFBgNJIg3CM8jAQEBAQEBBAEBAQEeizqFBQeELQWzP4FFI4I7gVkigngBAQE X-IPAS-Result: A0AwEwA731xV/5P+d0tcgxCEAoVVuzcJhH6CTQQCAoE8ORQBAQEBAQEBgQpBBYNdAQEDAVYjBQsLDiYSFBgNJIg3CM8jAQEBAQEBBAEBAQEeizqFBQeELQWzP4FFI4I7gVkigngBAQE X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="160931759" Original-Received: from 75-119-254-147.dsl.teksavvy.com (HELO ceviche.home) ([75.119.254.147]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 21 Aug 2015 09:48:53 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id D0AC66610C; Fri, 21 Aug 2015 09:48:53 -0400 (EDT) In-Reply-To: <87vbc8g8dn.fsf@gnu.org> (Tassilo Horn's message of "Fri, 21 Aug 2015 13:59:16 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:105654 Archived-At: > 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