From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Dimech Newsgroups: gmane.emacs.help Subject: Re: Placement of list within an interactive clause Date: Fri, 15 Jul 2022 10:19:22 +0200 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="19594"; mail-complaints-to="usenet@ciao.gmane.io" Cc: carlmarcos@tutanota.com, Help Gnu Emacs To: Jean Louis Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 15 10:20:53 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 1oCGZ9-0004p7-PB for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 15 Jul 2022 10:20:51 +0200 Original-Received: from localhost ([::1]:52288 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oCGZ8-0007m4-HH for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 15 Jul 2022 04:20:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37884) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oCGYJ-0007ff-Ol for help-gnu-emacs@gnu.org; Fri, 15 Jul 2022 04:19:59 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:41511) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oCGYH-0001bR-N7 for help-gnu-emacs@gnu.org; Fri, 15 Jul 2022 04:19:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1657873162; bh=TY75BxxJI9lemrCPHPifHEwyyuiVEycoiLSxVyYCIqo=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=E95W4jnkn4OvJdKgYRvJ4EZ+Mo7RvNi8l0kl9DpKrZQgw9c1SpOCWS1MzL1aE1UKp zcXc0F3s629TVZK3HBuqh5IGCXtFby/e+qVNEokiqVUpMkwXg/ZY8rIksKFNelE+Au SkOHX+r6xxDjkLGz/VKWePjKjDx7LVr13hDFitNU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [92.251.127.164] ([92.251.127.164]) by web-mail.gmx.net (3c-app-mailcom-bs16.server.lan [172.19.170.184]) (via HTTP); Fri, 15 Jul 2022 10:19:22 +0200 Importance: normal Sensitivity: Normal In-Reply-To: X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:nD3XzRxezH7FAcMQNGcF6GPWjVxzf2hArGWhVXjFFogPbFWFs6FNJCVd7vwnJoY0WsnJU ISfBfja3Er3gf1NQLTTJsg3iDR9QzOf/ifsIPs0ZpFXo2lkqlejMYKNBd4w5m2WGkCNKZc8y/QPb jsX3z3E4xYheFE6SYbJQyXFpsJsG0Hnl20isRZtkGL8kdQVMsO/xIifbvJsI6yYruVu7r1qQSL02 Jx4kIs5pwLTNDOT3Ov1Y4uPEn9joY25mgQlCcBpNYq+mBj97f8FKmpcJZOlN/MReLPUBs9zKK0Gx wo= X-UI-Out-Filterresults: notjunk:1;V03:K0:VqCCZ/krW+8=:rrNeJUBsc8VKOyW92lDfFs +7l3I7G4ADWTjKmK0PPYXRhw0fKv8DoWM6SAxaDCM3GgF8rffWWQSGXqjzNam4UhlZrcwfSne y8qnqH5smhFjpf6ytHgOEyCBWEAQxpyuxQjgd/U8BVHiSfUA5HlZiBARk1ldC6noWEGve7PEv bisl1zo2zXbUePOlF2JJPx94k9rBLQQUBvcFSqjguwysnkxgNrOSSY0DksGo+2dQLPWBW+7z+ 1t1DJ99kWxy1ACh6ljbt1xyCOUOi3iXbVyfxObLIdhBN/OL79Rw9HiijjxoMMn48EW6SgMjWT vkF3K715UDFtpvZhb62c3zwMm49HXKF2hnvaqElhWag2dXWGYz/MtVF2UsL/hhpo+6NM2R2oE TPnOiGGxRIx6zfYwVA/SUkgX3DZBoAsHTfnDGynaCLw3o+YqzoM3kG+4fcU+8pbF7Uifgk4NU AKJ27VIDCh9xn44h8nxrvs47yujqMmijtiKa/21IdXVuJMh6mdx3q/n9b0WU5nhWOEmd5d75+ AF3GtUvzs0dPrmmYAGx6jMUJJZlmzhowXWe3xmJ2F+ZjP9XY1h/SRkmWKgffirjc3zy08+s1G ggjXjQrsObioDP+Elcmguhr6ZiM6YsETiCQXIGma5de/4QPOXOMNXEHehto9P4p4DPGyLWi/2 5iHFgE6+oQq/6vxqXOYvIv36lF1dIRHW5Mvyi7H7BfcQEEMJVPVrsl55sQl3DBbjXXA6w+fhT hOUqgGR/JPMzJVCELC8I9UdWS0YMpqvN8GviZ71W4C9CQMkaX2ExaYhZZaKziqsSUW1F40ic Received-SPF: pass client-ip=212.227.15.19; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=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:138486 Archived-At: > Sent: Friday, July 15, 2022 at 7:26 PM > From: "Jean Louis" > To: carlmarcos@tutanota=2Ecom > Cc: "Help Gnu Emacs" > Subject: Re: Placement of list within an interactive clause > > Most of time I do not use `interactive' for supply arguments to > function=2E >=20 > Thus instead of following: >=20 > (defun my-fun-1 (&optional name) > (interactive "MName: ") > (message "Hello %s" name)) >=20 > I am using following: >=20 > (defun my-fun-2 (&optional name) > (interactive) > (let ((name (or name (read-from-minibuffer "Name: ")))) > (message "Hello %s" name))) >=20 > as that gives me little more freedom: >=20 > - if I call (my-fun-1) =E2=87=92 "Hello nil" that result is not what I > really want=2E It makes it difficult to get the wanted result=2E To > get the wanted result I need to use: >=20 > (call-interactively 'my-fun-1) =E2=87=92 "Hello Bob" >=20 > - but if I call (my-fun-2) and NAME is not supplied, I will be > asked for name: (my-fun-2) =E2=87=92 "Hello Bob" and will not get "NIL= " > as result=2E In this case I need not complicate the call and use > `call-interactively`=2E >=20 > Additionall, complex `interactive` clauses I find often too > difficult to comprehend than reading the body of the function=2E Yes, but you are forced for interactive commands=2E It is not equivalent to a function that is non-interactive=2E =20 > Fo this reason I recommend using this second approach with (or > ARGUMENT (GET-ARGUMENT)) rather then using `interactive` with > purpose to supply arguments=2E >=20 >=20 > --=20 > Jean >=20 > Take action in Free Software Foundation campaigns: > https://www=2Efsf=2Eorg/campaigns >=20 > In support of Richard M=2E Stallman > https://stallmansupport=2Eorg/ >=20 >