From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: add-hook and defvar Date: Mon, 23 Feb 2015 17:31:27 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1424730753 9133 80.91.229.3 (23 Feb 2015 22:32:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 23 Feb 2015 22:32:33 +0000 (UTC) Cc: emacs-devel To: Artur Malabarba Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 23 23:32:24 2015 Return-path: Envelope-to: ged-emacs-devel@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 1YQ1Y8-0003jf-4j for ged-emacs-devel@m.gmane.org; Mon, 23 Feb 2015 23:32:24 +0100 Original-Received: from localhost ([::1]:45725 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQ1Y7-0004sA-MI for ged-emacs-devel@m.gmane.org; Mon, 23 Feb 2015 17:32:23 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQ1Xt-0004rs-21 for emacs-devel@gnu.org; Mon, 23 Feb 2015 17:32:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQ1Xp-000413-Pj for emacs-devel@gnu.org; Mon, 23 Feb 2015 17:32:08 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:20667) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQ1Xp-00040j-LQ for emacs-devel@gnu.org; Mon, 23 Feb 2015 17:32:05 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArsTAPOG1lRsoXmY/2dsb2JhbABbgwaDX4VTwGUEAgKBDUQBAQEBAQF8hA0BBAFWIxALDiYSFBgNJIg4CM4jAQEBAQYBAQEBHo94B4QqBYonn0uBRSKEDCCCcwEBAQ X-IPAS-Result: ArsTAPOG1lRsoXmY/2dsb2JhbABbgwaDX4VTwGUEAgKBDUQBAQEBAQF8hA0BBAFWIxALDiYSFBgNJIg4CM4jAQEBAQYBAQEBHo94B4QqBYonn0uBRSKEDCCCcwEBAQ X-IronPort-AV: E=Sophos;i="5.09,536,1418101200"; d="scan'208";a="111274123" Original-Received: from 108-161-121-152.dsl.teksavvy.com (HELO pastel.home) ([108.161.121.152]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 23 Feb 2015 17:32:04 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id EAB461898; Mon, 23 Feb 2015 17:31:27 -0500 (EST) In-Reply-To: (Artur Malabarba's message of "Mon, 23 Feb 2015 05:10:10 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:183430 Archived-At: >> Another problem is that defvar may simply never be called. > But isn't it a bug to run-hooks a variable that was never explicitly > defined? All hook functions have always treated "unbound" as equal to nil, so no, it's not considered a bug to run a hook that's still unbound. Basically, given that "unbound == nil", what is a bug is to defvar a hook with a non-nil default value, unless that hook is predefined (i.e. is never unbound). Stefan