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, 09 Mar 2015 22:14:58 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1425953728 22412 80.91.229.3 (10 Mar 2015 02:15:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 10 Mar 2015 02:15:28 +0000 (UTC) Cc: Artur Malabarba , emacs-devel To: Philipp Stephani Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 10 03:15:15 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 1YV9hR-0004fR-ON for ged-emacs-devel@m.gmane.org; Tue, 10 Mar 2015 03:15:14 +0100 Original-Received: from localhost ([::1]:46166 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YV9hR-0006HC-5c for ged-emacs-devel@m.gmane.org; Mon, 09 Mar 2015 22:15:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36023) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YV9hG-00064e-Uw for emacs-devel@gnu.org; Mon, 09 Mar 2015 22:15:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YV9hD-00084U-Oy for emacs-devel@gnu.org; Mon, 09 Mar 2015 22:15:02 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:33907) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YV9hD-000840-Er for emacs-devel@gnu.org; Mon, 09 Mar 2015 22:14:59 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArsTAPOG1lRLd/0j/2dsb2JhbABbgwaDX4VTwGUEAgKBDUQBAQEBAQF8hA0BBAFWIxALDiYSFBgNJIg4CM4jAQEBAQYCAR+PeAeEKgWpcoFFIoQKIoJzAQEB X-IPAS-Result: ArsTAPOG1lRLd/0j/2dsb2JhbABbgwaDX4VTwGUEAgKBDUQBAQEBAQF8hA0BBAFWIxALDiYSFBgNJIg4CM4jAQEBAQYCAR+PeAeEKgWpcoFFIoQKIoJzAQEB X-IronPort-AV: E=Sophos;i="5.09,536,1418101200"; d="scan'208";a="113134536" Original-Received: from 75-119-253-35.dsl.teksavvy.com (HELO pastel.home) ([75.119.253.35]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 09 Mar 2015 22:14:58 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 0F71E111C; Mon, 9 Mar 2015 22:14:58 -0400 (EDT) In-Reply-To: (Philipp Stephani's message of "Thu, 05 Mar 2015 20:28:08 +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:183757 Archived-At: >> > Is this something the byte compiler could warn about? At least >> > normal hooks by convention end in "-hook", so a warning could be >> > emitted every time such a variable is defined that doesn't have nil >> > as default. >> Yes, we could do that. Patch welcome, > Added a patch. After trying it out, I'm not sure we want it: there are various places where we use a non-nil default value, and while it's not ideal, it's not really clear what would be a better choice. If there was a simple way to silence those warnings in those cases, it's would be fine, but I can't think of a simple way to do that. Stefan