From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: goncholden Newsgroups: gmane.emacs.help Subject: Using variables to set defaults to parameters Date: Thu, 03 Feb 2022 18:20:44 +0000 Message-ID: References: <-FFY39s9gf027CaRqTOHR5D_xsFqho--WNpfqfGxVCqZebyGIOwTYInT6s8m2nNkEBEvuPRudAmVVAO4LwOCGp0OFNM7lKwmL3EP0obBLJo=@protonmail.com> Reply-To: goncholden Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15058"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 03 19:58:12 2022 Return-path: Envelope-to: geh-help-gnu-emacs@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 1nFhJ5-0003hL-VS for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 03 Feb 2022 19:58:11 +0100 Original-Received: from localhost ([::1]:59816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nFhJ4-0004Mm-8V for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 03 Feb 2022 13:58:10 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39814) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nFgj0-0005B0-0H for help-gnu-emacs@gnu.org; Thu, 03 Feb 2022 13:20:54 -0500 Original-Received: from mail-4027.protonmail.ch ([185.70.40.27]:38463) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nFgix-0004oc-He for help-gnu-emacs@gnu.org; Thu, 03 Feb 2022 13:20:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail2; t=1643912448; bh=24+PS3laAVKtsx3FuUmbS1oB3Lp11nqkuZKfKfj6JjU=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:From:To:Cc; b=iuqOq4LcYSkUDR2ukU2JXDbdTZ58a99hVI34uGdRvGbn1e9/K17sNNEh7YJSVVXEO Oh07UwfFknEfEMNdSEj2EC9i9oP+oxIzk7kCHQ2hBNqaO3uYwsqavyU1yI7CB0bVfZ iqphTqwtmPYpkzzpu1MiVq1w8+B8M3sc5GfnAn475bHPTZ5bt7XJUyErmBQh/eRWgc t36My4SvsafZ8z2sramTEBqFofGQxypkZ1ahermQistWiFr0YMWpeLWb0t2j9a5NDk ReeRUpTNaDtu2yzvO536oZAZUqtNBOEDtqFgajD95M5Xddf6x/CwdYjr8w9gEp7rWX AT72Iga2StFRg== In-Reply-To: Received-SPF: pass client-ip=185.70.40.27; envelope-from=goncholden@protonmail.com; helo=mail-4027.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:135703 Archived-At: ------- Original Message ------- On Thursday, February 3rd, 2022 at 4:24 PM, Stefan Monnier via Users list f= or the GNU Emacs text editor wrote: > I am currently defining a minor-mode with default parameters, but want > > to pass defaulted variables instead. What is the way to do this, > > using setq ? > > (define-minor-mode rich-minor-mode > > "Brief description" nil "" nil Don't use this long obsolete form. Use the keyword arguments, instead: (define-minor-mode rich-minor-mode "Brief description" :lighter "") > then changed to > > (setq initval nil) > > (setq mdline-indic "") > > (setq other nil) I don't know what you mean with "then changed" nor where the above code is intended to be placed (inside the `define-minor-mode`? In some other function?). Stefan Have been trying to pass the parameters with names that mean something, rat= her than using (define-minor-mode rich-minor-mode "Brief description" nil "" nil so I would have (define-minor-mode rich-minor-mode "Brief description" initval mdline-indic= other Where can I find some information on using the keyword arguments? I only kn= ow about the long obsolete form.