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: [External] : Re: Functions with multiple optional arguments Date: Mon, 17 Oct 2022 17:28:57 +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="13160"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Jean Louis , "help-gnu-emacs@gnu.org" To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 17 19:30:05 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 1okTwC-0003CU-Jr for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 17 Oct 2022 19:30:04 +0200 Original-Received: from localhost ([::1]:56288 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1okTwB-0002LB-AN for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 17 Oct 2022 13:30:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okTvQ-0002L3-Db for help-gnu-emacs@gnu.org; Mon, 17 Oct 2022 13:29:16 -0400 Original-Received: from mail-40135.protonmail.ch ([185.70.40.135]:62495) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okTvO-0001lH-GF for help-gnu-emacs@gnu.org; Mon, 17 Oct 2022 13:29:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1666027750; x=1666286950; bh=tKjc7QXM0/Jhu+gzrr2NY9im0wuOJ4GbROFDtFJCpm0=; 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=alXI1FsIkCgn9XrH7YPeVOAoz/7x/pXf2y/dfcNu+SzMyG08Y8Kz4ma2Nxj4ZgyUa eBEkUFih1UUgaDKUpe08ukP4yOOKyEIHQdW0C4Pv1mePma9uRtbE8su9skpjHbC2EJ wo/cAQv6EBIFfGytYWe5bvHZECOaTu0FJbu2/psDSDwhiTzE7TLp0We+qRqPYdG0nk kuoT+/bgWWcE5Slz2TPGUEsuIHwWtDf38Ye5Z07NflFpg9dgUmtzKSYTtyfAefEudn HuLMXBZwATJJAYwy+hBJoryup9gBi10RIJKu4X1jtgFfK9VhNKsidE7JKns2ssQHX5 N+WyFEGiXbuTg== In-Reply-To: Feedback-ID: 57735886:user:proton Received-SPF: pass client-ip=185.70.40.135; envelope-from=heimeborgia@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, 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" Xref: news.gmane.io gmane.emacs.help:140080 Archived-At: ------- Original Message ------- On Monday, October 17th, 2022 at 4:52 PM, Drew Adams wrote: > > I want the last argument to use a symbol. Would you be so kind to scrut= inise > > my implementation please. > >=20 > > (defun mesgb (mesg &optional bufr actm) > > "Display message except on 'nogo symbol." > > (let ((bfr (or bufr "Gundit")) > > (acm (or actm 'go))) > >=20 > > (when (not (eq 'nogo acm)) > > (with-current-buffer (get-buffer-create bfr) > > (org-mode) > > (insert mesg))) )) >=20 >=20 > (defun mesgb (message &optional buffer actm) > "Show MESSAGE, unless ACTM is the symbol `nogo'." > (setq buffer (or buffer "Gundit") > actm (or actm 'go)) > (unless (eq 'actm 'nogo) > (with-current-buffer (get-buffer-create buffer)) > (org-mode) > (insert message)))) Your adaptation is much neater. Did not realise that equality=20 on symbols should be (eq 'actm 'nogo) rather than (eq actm 'nogo). Do you have time to describe what does wrong with (eq actm 'nogo)? =20