From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Heime Newsgroups: gmane.emacs.help Subject: Re: Handling optional argument with t value Date: Mon, 05 Dec 2022 20:09:38 +0000 Message-ID: References: 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="24795"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Heime via Users list for the GNU Emacs text editor To: Jean Louis Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 05 21:10:20 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 1p2Hn9-0006JP-LQ for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 05 Dec 2022 21:10:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p2Hmh-00010U-03; Mon, 05 Dec 2022 15:09:51 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p2Hmf-000102-9H for help-gnu-emacs@gnu.org; Mon, 05 Dec 2022 15:09:49 -0500 Original-Received: from mail-40130.protonmail.ch ([185.70.40.130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p2Hmd-0007ng-Fo for help-gnu-emacs@gnu.org; Mon, 05 Dec 2022 15:09:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1670270985; x=1670530185; bh=S2i8nq4QeWrCvT5AuXmWHbKx0hfHtT6f95Akg5luW5M=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=Cd3RpiR2sS2du6Mk+SHjmiBxU9ml58FhoN989f8FGgnWzZtnMpqxZ58lcgHo51tvo DAP/o8qnKDtHX9oJ8d1/BlwPSQIUK4XV7G8KXuFPGJEBmkDI71g8hH8V8bd+9+lg5O zcNBDaSVI3+D5cOvdy+L9mtLPUP2YZnlvRY9O2ZF9+HE9b/6R5aJDybld3PCcOnlRl ZR+URu55pwmDqN75O7AkGWGxCvls2B4ckm9KjTjA82jMVoYEaoPqKFkj2jV1zcK252 oSZ81NFaww/R1sgFstl6pJVftAJa57lAoGL/n79R7JgvawDYBnpFDEdB8r9tCpr5m8 79rsVUXLQz78Q== In-Reply-To: Feedback-ID: 57735886:user:proton Received-SPF: pass client-ip=185.70.40.130; envelope-from=heimeborgia@protonmail.com; helo=mail-40130.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, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 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-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:141414 Archived-At: ------- Original Message ------- On Monday, December 5th, 2022 at 7:16 PM, Jean Louis wro= te: > * Heime heimeborgia@protonmail.com [2022-12-05 02:02]: >=20 > > I have this function to which I am adding the capability to print a > > compact version that excludes the whitespace. Thus I include an > > optional argument "kpact", so that when it is set to t, the (insert > > " ") in excluded. Is this a good strategy. >=20 >=20 > "To print a compact version..." compact version of what? >=20 > I understand you wish to print propertized version of some symbol. >=20 > If it is good strategy or not, I guess you are the one to > decide. Because it is with special background, I would insert space > before and after, to make it more indicative or to make it more visible. >=20 > > Does the use of (unless kpact (insert " ")) do the job or am I > > missing some possible condition that might occur? >=20 > You missed to express better what you wish to achieve. I need some advice on how to handle optional arguments, where one either=20 does not pass it or passes t. For instance, should I put a default for it, as in (setq kpact (or kpact ni= l)) ? Or handle things with a "when", or using some other combination ? (defun ticker-hour (lampkl &optional kpact) (setq kpact (or kpact nil)) (when () ) )