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: Re: Using variables to set defaults to parameters Date: Thu, 03 Feb 2022 18:43:31 +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="7288"; 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 20:12:46 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 1nFhXB-0001gz-Lv for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 03 Feb 2022 20:12:45 +0100 Original-Received: from localhost ([::1]:44136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nFhXA-0005Gi-DX for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 03 Feb 2022 14:12:44 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nFh5m-00028c-F4 for help-gnu-emacs@gnu.org; Thu, 03 Feb 2022 13:44:30 -0500 Original-Received: from mail-40135.protonmail.ch ([185.70.40.135]:24018) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nFh4z-0000pK-Sb for help-gnu-emacs@gnu.org; Thu, 03 Feb 2022 13:44:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail2; t=1643913815; bh=dI6bRhdNlhejIwhK1dDUCNa0x/lyVFt6D1sN1KJE1rU=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:From:To:Cc; b=G7Z/H2VAmNKBeYwa1ESXSb9ibwo16yn7hhG42My/BtOuV6e1UPpec/EWaUb9L3nhH a2zWFI2n008WSZ+CGhgCOH/RaiD/nrPZWqlypmbtyB49ku+SXyYmJlg7N/6QcFPhgA W5C2s8BPREMb8Od7GzSu5ws02x+B4N2bNB1DTA1qkpH7Ep72WVmS/nL3sZi6Epuk7+ 4SjmWQZP3t9QxoNNsKZC8Jo9+pCszbR9/WfIn5vXdsOLpK/PEbWJtVYVdHhotSvBv5 e40Q4HgfLM6psSQN7JKKp2BzzqTIaXJ08/tDa30u7WEPjiyiqpaKFdWc9P70uBYiGD Rv5PgxneTDWIA== In-Reply-To: Received-SPF: pass client-ip=185.70.40.135; envelope-from=goncholden@protonmail.com; helo=mail-40135.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:135704 Archived-At: ------- Original Message ------- On Thursday, February 3rd, 2022 at 6:20 PM, goncholden wrote: > ------- Original Message ------- > > On Thursday, February 3rd, 2022 at 4:24 PM, Stefan Monnier via Users list= for the GNU Emacs text editor help-gnu-emacs@gnu.org 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, r= ather 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-ind= ic other > Where can I find some information on using the keyword arguments? I only = know about the > long obsolete form. What's the best thing to make code more readable? Keywords as you say? I = do not want modeline indicator for this. I do not particularly understand initial values, how d= o they work?