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: Handling optional argument with t value Date: Sun, 04 Dec 2022 23:01:21 +0000 Message-ID: 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="39138"; mail-complaints-to="usenet@ciao.gmane.io" To: Heime via Users list for the GNU Emacs text editor Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 05 00:01:54 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 1p1xzd-0009yF-Ev for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 05 Dec 2022 00:01:53 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p1xzI-00013s-Q3; Sun, 04 Dec 2022 18:01:32 -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 1p1xzG-00013a-JI for help-gnu-emacs@gnu.org; Sun, 04 Dec 2022 18:01:30 -0500 Original-Received: from mail-4324.protonmail.ch ([185.70.43.24]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p1xzC-0005yE-Ml for help-gnu-emacs@gnu.org; Sun, 04 Dec 2022 18:01:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1670194883; x=1670454083; bh=XWKo+RO1YKDboCQ0+Fm24BvvcIQzg1aBJLi815siK6Y=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=iiLXtD491RBXP70qNizPr9qqy8sDzZHxVNrvKHNkit4W4kNTzfhVuUfyfr/ZMwdgE M1wpMvUbi9pTgewejdKU256W8lrPDErgtrhQ2c5nJn5BaKM8YjRT0SMQbzK9MHn3Mt E06OnuDaC6AkTNAgQLH5tnk3/5vqJttEvpXgcZtsgeNiFavARKvfecs+TytCU6XIpg S6ayeK02xR/X1chZx+neeifPo//1QrJhX3c9rYvwjosmD1ws0TU5jBgXiBf0nb2+Y7 gyriiGPbq3QAzjkmzEdGFNfFn8b96D8xASn4Tf0dcDZiBKWjVbQAu2o2oVIJpu9vsa ZE/EYykNX7ffg== Feedback-ID: 57735886:user:proton Received-SPF: pass client-ip=185.70.43.24; envelope-from=heimeborgia@protonmail.com; helo=mail-4324.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:141376 Archived-At: I have this function to which I am adding the capability to print a compact= version=20 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 Does the use of (unless kpact (insert " ")) do the job or am I missing som= e possible condition that might occur? (defun ticker-hour (lampkl &optional kpact) "TODO." (interactive) (unless kpact (insert " ")) (cond ((eq 'magenta lampkl) (insert (propertize "=E2=9A=92" 'font-lock-face '(:background "#FF29FF" :foreground "black")))) ((eq 'red lampkl) (insert (propertize "=E2=9A=92" 'font-lock-face '(:background "#B30000" :foreground "black"))))))