From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bruno Barbier Newsgroups: gmane.emacs.help Subject: Re: Prefix Argument and optional argument Date: Tue, 05 Jul 2022 08:52:05 +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="14027"; mail-complaints-to="usenet@ciao.gmane.io" To: carlmarcos@tutanota.com, Help Gnu Emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 05 08:56:51 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 1o8cUN-0003S3-Rq for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 05 Jul 2022 08:56:51 +0200 Original-Received: from localhost ([::1]:45746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o8cUM-0001dZ-1Z for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 05 Jul 2022 02:56:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45916) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8cO3-0002zL-4b for help-gnu-emacs@gnu.org; Tue, 05 Jul 2022 02:50:19 -0400 Original-Received: from smtp1-g21.free.fr ([212.27.42.1]:44486) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8cNz-0005Ll-PN for help-gnu-emacs@gnu.org; Tue, 05 Jul 2022 02:50:18 -0400 Original-Received: from tosh-laptop (unknown [IPv6:2a01:e0a:505:3460:1a16:a0c4:3f89:c0d9]) by smtp1-g21.free.fr (Postfix) with ESMTPS id 67D7BB0059A; Tue, 5 Jul 2022 08:50:10 +0200 (CEST) Original-Received: by tosh-laptop (sSMTP sendmail emulation); Tue, 05 Jul 2022 08:52:06 +0200 In-Reply-To: Received-SPF: softfail client-ip=212.27.42.1; envelope-from=brubar.cs@gmail.com; helo=smtp1-g21.free.fr X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FROM=0.001, MISSING_MID=0.497, NML_ADSP_CUSTOM_MED=0.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665, T_SCC_BODY_TEXT_LINE=-0.01 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:138310 Archived-At: carlmarcos--- via Users list for the GNU Emacs text editor writes: > I am having difficulty figuring out any problems associated with the foll= owing two functions. > > Can one safely call "M-x name", "C-u M-x name", "C-u 2 M-x name", where n= ame is either > `poke' or `poke-opt'. > > (defun poke (prefix) > =C2=A0 "TODO." > =C2=A0 (interactive "P") > ...) You should compile your code; Emacs will say: Warning: misplaced interactive spec: =E2=80=98(interactive P)=E2=80=99 > > (defun poke-opt (&optional prefix) > =C2=A0 "TODO." > =C2=A0 (interactive "P") > ...) This version is OK. You can call it "M-x name", "C-u M-x name", "C-u 2 M-x name"; wether it's safe or not depends on its body though ;-) Bruno