From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: add-hook and defvar Date: Fri, 06 Mar 2015 19:05:58 +0000 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a113464ac0560260510a3601e X-Trace: ger.gmane.org 1425668820 16710 80.91.229.3 (6 Mar 2015 19:07:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Mar 2015 19:07:00 +0000 (UTC) Cc: Stefan Monnier , emacs-devel To: bruce.connor.am@gmail.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 06 20:06:59 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 1YTxaK-0008Sb-Jo for ged-emacs-devel@m.gmane.org; Fri, 06 Mar 2015 20:06:56 +0100 Original-Received: from localhost ([::1]:59878 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTxaJ-0003uh-LG for ged-emacs-devel@m.gmane.org; Fri, 06 Mar 2015 14:06:55 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58800) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTxZx-0003qv-Oj for emacs-devel@gnu.org; Fri, 06 Mar 2015 14:06:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YTxZw-0005wP-0d for emacs-devel@gnu.org; Fri, 06 Mar 2015 14:06:33 -0500 Original-Received: from mail-la0-x22d.google.com ([2a00:1450:4010:c03::22d]:40392) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTxZv-0005hj-DH for emacs-devel@gnu.org; Fri, 06 Mar 2015 14:06:31 -0500 Original-Received: by labgm9 with SMTP id gm9so19922560lab.7 for ; Fri, 06 Mar 2015 11:06:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:from:date:message-id:subject:to:cc :content-type; bh=RVsLG4Bj6F7vXIfGa4Q4Ixqr/hD4MMhQyrRjhB+5YuY=; b=PCewd0CUADyZSRl6Tlkd3iDec34w12f7WKC9fQ17J66xBFTpwOr0FKAnbEcsZpC11f OHWDeATdxG44mLmj83PG3rWPlAVuZZGAdfAQEbc33MhFdgqwDs5ezT6y2WQ+Iqzgnlds I7DEK5foLq2NMwVo6CX/ZS5jI85mPPs47+4x3qQTU3IbPfvuO71kPVPFNhrRKgvOeXbL yzTtsdXRkUpmoEeZenBEVkhTKj6eYyWLtZR71dzNHj/i64IXcTZAhrYIMRUpEaA7va5u 0SP6PW1tZYE6iRs+PQki7BqTDsuGfd7hWtyVEI5BDEhKMS11vwU9/BBjRovo6GktGeDu FDBw== X-Received: by 10.112.223.7 with SMTP id qq7mr14284287lbc.81.1425668760088; Fri, 06 Mar 2015 11:06:00 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::22d 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:183704 Archived-At: --001a113464ac0560260510a3601e Content-Type: multipart/alternative; boundary=001a113464ac0560200510a3601c --001a113464ac0560200510a3601c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Ack. Modified patch attached. Btw, do I still need to write explicit changelog entries or is that already done automatically? Artur Malabarba schrieb am Do., 5. M=C3=A4rz 20= 15 um 22:45 Uhr: > This should probably do the same if the variable name ends with > "-functions" (since IIUC that's the correct way of naming a hook where > the functions should take arguments). > > 2015-03-05 17:28 GMT-03:00 Philipp Stephani : > > > > > > Stefan Monnier schrieb am Mi., 25. Feb. 2015 > um > > 03:56 Uhr: > > > >> > Is this something the byte compiler could warn about? At least norma= l > >> > hooks > >> > by convention end in "-hook", so a warning could be emitted every ti= me > >> > such > >> > a variable is defined that doesn't have nil as default. > >> > >> Yes, we could do that. Patch welcome, > >> > >> > > > > Added a patch. > --001a113464ac0560200510a3601c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Ack. Modified patch attached.

Btw, do I still need = to write explicit changelog entries or is that already done automatically?<= br>
Artur Malabarba <bruce.connor.am@gmail.com> schrieb am Do., 5. M= =C3=A4rz 2015 um 22:45=C2=A0Uhr:
This sho= uld probably do the same if the variable name ends with
"-functions" (since IIUC that's the correct way of naming a h= ook where
the functions should take arguments).

2015-03-05 17:28 GMT-03:00 Philipp Stephani <p.stephani2@gmail.com>:
>
>
> Stefan Monnier <monnier@iro.umontreal.ca> schrieb am Mi., 25. Feb. 2015 = um
> 03:56 Uhr:
>
>> > Is this something the byte compiler could warn about? At leas= t 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.=C2=A0 Patch welcome,
>>
>>
>
> Added a patch.
--001a113464ac0560200510a3601c-- --001a113464ac0560260510a3601e Content-Type: text/plain; charset=US-ASCII; name="0001-Warn-if-a-hook-variable-is-given-a-non-nil-init-form.txt" Content-Disposition: attachment; filename="0001-Warn-if-a-hook-variable-is-given-a-non-nil-init-form.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: 14bf07acd3ff5e451d01 RnJvbSBlYTczNjFjMTBjNGRlYjEzYzI1ZmVmZWM3MDVhMDU0MDM1MDZiODYwIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBQaGlsaXBwIFN0ZXBoYW5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