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: Functions with multiple optional arguments Date: Mon, 17 Oct 2022 16:24:19 +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="1955"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Jean Louis , "help-gnu-emacs@gnu.org" To: Heime Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 17 18:25:42 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 1okSvt-0000JZ-Ck for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 17 Oct 2022 18:25:41 +0200 Original-Received: from localhost ([::1]:36272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1okSvs-0001d9-7O for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 17 Oct 2022 12:25:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40938) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okSum-0001co-R4 for help-gnu-emacs@gnu.org; Mon, 17 Oct 2022 12:24:33 -0400 Original-Received: from mail-4318.protonmail.ch ([185.70.43.18]:35583) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okSul-00075I-0r for help-gnu-emacs@gnu.org; Mon, 17 Oct 2022 12:24:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1666023868; x=1666283068; bh=1sWvuDppcZHmWcm2YMBXqKKAlqgkfuvCTSYWZkiJoNA=; 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; b=gl5TgDm2yie1cEbT8IQPFPZ/mXd8i6I7H9WPEMSaycqTy+CdO69pJ4GcMfCoz+6qx /3/BpkUY/px3bWs+x5hbbHurpz+YWmqQWJwK4/dWETtcCYqqUr6wiix8yOH2hT0OJX 3Z7vltleWy5I/daN4RzboZaEAW5CK8v+5DxGYA6DomIc6RqOYK/L63TAl5Y0mhfzp6 FbWGfJ9IXFHNGT0tQ26BRawu2wsadD7E3ZiYKjVuBCMGbgUfyvN0R6WsFz+HfxPfXX 8Jp/WiHEUs90iIX7Lu7N21DvzN0GD1bO0js8pEABxg3ovlahEYEjzU5DVVWmlF2QJg 9Bi7RaX6Gxfig== In-Reply-To: Feedback-ID: 57735886:user:proton Received-SPF: pass client-ip=185.70.43.18; envelope-from=heimeborgia@protonmail.com; helo=mail-4318.protonmail.ch X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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, TO_EQ_FM_DIRECT_MX=1 autolearn=no 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:140077 Archived-At: ------- Original Message ------- On Monday, October 17th, 2022 at 5:42 AM, Heime wrote: > ------- Original Message ------- > On Monday, October 17th, 2022 at 4:05 AM, Jean Louis bugs@gnu.support wro= te: >=20 >=20 >=20 > > * Heime via Users list for the GNU Emacs text editor help-gnu-emacs@gnu= .org [2022-10-17 00:06]: > >=20 > > > Have been writing a function that has two optional arguments. It is > > > turning out to be a difficult task in situations when one in missing > > > an argument. Anybody has experience about this, as I have not seen > > > much code with multiple optional arguments. > >=20 > > If argument is optional but required by your function, I use this metho= d: > >=20 > > (defun my-fun (&optional title description) > > (let ((title (or title "Best Movie")) > > (description (or description "Description"))) > > (message "%s: %s" title description))) > >=20 > > (my-fun) =20 I want the last argument to use a symbol. Would you be so kind to scrutini= se=20 my implementation please. (defun mesgb (mesg &optional bufr actm) "Display message except on 'nogo symbol." (let ((bfr (or bufr "*Gundit*")) =09(acm (or actm 'go))) (when (not (eq 'nogo acm)) (with-current-buffer (get-buffer-create bfr) =09(org-mode) (insert mesg))) ))