From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: define-minor-mode: Suppressing warning Date: Sun, 16 May 2021 17:41:08 -0400 Message-ID: References: <24737.19462.438383.80857@google.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33051"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: "T.V Raman" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 16 23:43:05 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1liOXR-0008PS-1t for ged-emacs-devel@m.gmane-mx.org; Sun, 16 May 2021 23:43:05 +0200 Original-Received: from localhost ([::1]:49626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1liOXQ-0005an-56 for ged-emacs-devel@m.gmane-mx.org; Sun, 16 May 2021 17:43:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34484) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liOVe-0003sJ-Ps for emacs-devel@gnu.org; Sun, 16 May 2021 17:41:14 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:36990) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liOVc-0000pD-Ch for emacs-devel@gnu.org; Sun, 16 May 2021 17:41:14 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 8E1D48089C; Sun, 16 May 2021 17:41:10 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 2F08A80547; Sun, 16 May 2021 17:41:09 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1621201269; bh=gk5FpYp6JHMKNXO04hljhTiUk74zK2lQ4sTJAYtijms=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=VD0tgY3BxL5+/X5BaV5r+dJpPceS1c8eESpLD6UfTqv1A+SF/ZdZC0RrxQjol/EY7 FnZd8Shhs5ZXz33nCjjIYDPXDNmY+3x5xK0/pNTywn8jU00aqMz1LtPPzMVj/0ftAs pjI6DR7ch2XPRR/Bsgs0eFMkM9zAx+FK3RA2KJNQpOWVtc3iQ5vRgtcnnn/zkLHVdK 4lAQbwLk08gb5BUtU73dYamuY9aSJv1G6C+ALzfrzr6GiA2h/2B6ANlQJaoULV31mE YH/3eGc5cxwwiqHKBlHnUcWNhBKEvMI8WpQuuT63FvgnBvvUZ5kzm2DY6RtMEswhKP 8OW++RQcbBiVA== Original-Received: from alfajor (76-10-140-76.dsl.teksavvy.com [76.10.140.76]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id DDC1212061F; Sun, 16 May 2021 17:41:08 -0400 (EDT) In-Reply-To: (T. V. Raman's message of "Sun, 16 May 2021 12:52:41 -0700") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:269382 Archived-At: > Really? I looked at define-minor-mode in emacs 27.1 and it does not > appear to take the keyword argument, unless that is I'm very confused. The Emacs-21 version of the docstring says (among other things): The above three arguments can be skipped if keyword arguments are used (see below). BODY contains code that will be executed each time the mode is (dis)activated. It will be executed after any toggling but before running the hooks. BODY can start with a list of CL-style keys specifying additional arguments. The following keyword arguments are supported: :group Followed by the group name to use for any generated `defcustom'. :global If non-nil specifies that the minor mode is not meant to be buffer-local. By default, the variable is made buffer-local. :init-value Same as the INIT-VALUE argument. :lighter Same as the LIGHTER argument. The end of the docstring on Emacs-24 additionally says: For example, you could write (define-minor-mode foo-mode "If enabled, foo on you!" :lighter " Foo" :require 'foo :global t :group 'hassle :version "27.5" ...BODY CODE...) Do you believe me now? ;-) Stefan >> T.V Raman [2021-05-16 09:44:54] wrote: >> >>> When compiling code released for emacs 27.2 with emacs 28, you >>> presently get this warning: >>> >>> emacspeak-comint.el:582:12: Warning: Use keywords rather than deprecated >>> positional arguments to `define-minor-mode' >>> >>> I'm unable to suppress this warning --- and I cant update my code >>> to use the recommended keyword argument form until emacs 28 is >>> released. >> >> Why? The recommended syntax is the one that was introduced back in >> Emacs-21! >> >> >> Stefan >>