From unknown Sat Jun 21 10:16:56 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#2723 <2723@debbugs.gnu.org> To: bug#2723 <2723@debbugs.gnu.org> Subject: Status: Emacs 23: `interactive': prefix argument "P" and region "r" are mutually exclusive. Reply-To: bug#2723 <2723@debbugs.gnu.org> Date: Sat, 21 Jun 2025 17:16:56 +0000 retitle 2723 Emacs 23: `interactive': prefix argument "P" and region "r" ar= e mutually exclusive. reassign 2723 emacs submitter 2723 Alan Mackenzie severity 2723 normal thanks From acm@muc.de Thu Mar 19 12:16:31 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 19 Mar 2009 19:16:31 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=none autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2JJGRF6021295 for ; Thu, 19 Mar 2009 12:16:29 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LkNj9-000595-82 for bug-gnu-emacs@gnu.org; Thu, 19 Mar 2009 15:16:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LkNj4-00056j-Fj for bug-gnu-emacs@gnu.org; Thu, 19 Mar 2009 15:16:26 -0400 Received: from [199.232.76.173] (port=50715 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LkNj4-00056g-Ch for bug-gnu-emacs@gnu.org; Thu, 19 Mar 2009 15:16:22 -0400 Received: from colin.muc.de ([193.149.48.1]:4755 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LkNj3-0002W3-Qg for bug-gnu-emacs@gnu.org; Thu, 19 Mar 2009 15:16:22 -0400 Received: (qmail 27119 invoked by uid 3782); 19 Mar 2009 19:16:15 -0000 Received: from acm.muc.de (pD9E23BAC.dip.t-dialin.net [217.226.59.172]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Thu, 19 Mar 2009 20:16:12 +0100 Received: (qmail 2342 invoked by uid 1000); 19 Mar 2009 19:15:24 -0000 Date: Thu, 19 Mar 2009 19:15:24 +0000 To: bug-gnu-emacs@gnu.org Subject: Emacs 23: `interactive': prefix argument "P" and region "r" are mutually exclusive. Message-ID: <20090319191524.GA2306@muc.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 Hi, Emacs! In the following: ######################################################################### (defun echo-prefix (arg) "Echo the command prefix" (interactive "P") (message "Command prefix: %s" arg)) (defun echo-region (beg end) "Echo the region boundaries" (interactive "r") (message "Region: (%s %s)" beg end)) (defun echo-region-prefix (beg end arg) "Echo the region and prefix parameters." (interactive "rP") (message "region: (%s %s); prefix: %s" beg end arg)) ######################################################################### , echo-prefix and echo-region work as expected. echo-region-prefix throws this error: Wrong number of arguments: (lambda (beg end arg) "Echo the region and prefix parameters." (interactive "rP") (message "region: (%s %s); prefix: %s" beg end arg)), 2 It seems that `(interactive "rP")' is only supplying the defun with two parameters. -- Alan Mackenzie (Nuremberg, Germany). From sl392@hermes.cam.ac.uk Thu Mar 19 13:16:17 2009 Received: (at 2723) by emacsbugs.donarmstrong.com; 19 Mar 2009 20:16:17 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from ppsw-0.csi.cam.ac.uk (ppsw-0.csi.cam.ac.uk [131.111.8.130]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2JKGENv005706 for <2723@emacsbugs.donarmstrong.com>; Thu, 19 Mar 2009 13:16:15 -0700 X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from smaug.linux.pwf.cam.ac.uk ([193.60.95.72]:60252) by ppsw-0.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.150]:587) with esmtpsa (LOGIN:sl392) (TLSv1:DHE-RSA-AES256-SHA:256) id 1LkOez-0000mr-19 (Exim 4.70) (return-path ); Thu, 19 Mar 2009 20:16:13 +0000 From: Leo To: Alan Mackenzie Cc: 2723@debbugs.gnu.org Subject: Re: bug#2723: Emacs 23: `interactive': prefix argument "P" and region "r" are mutually exclusive. References: <20090319191524.GA2306@muc.de> Date: Thu, 19 Mar 2009 20:16:12 +0000 In-Reply-To: <20090319191524.GA2306@muc.de> (Alan Mackenzie's message of "Thu, 19 Mar 2009 19:15:24 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: "Leo, Shidai Liu" On 2009-03-19 19:15 +0000, Alan Mackenzie wrote: > (defun echo-region-prefix (beg end arg) > "Echo the region and prefix parameters." > (interactive "rP") > (message "region: (%s %s); prefix: %s" beg end arg)) They have to be separated by "\n" as follows. (defun echo-region-prefix (beg end arg) "Echo the region and prefix parameters." (interactive "r\nP") (message "region: (%s %s); prefix: %s" beg end arg)) I tested it in GNU Emacs 23.0.60.1 (i686-pc-linux-gnu, GTK+ Version 2.12.0) of 2008-12-15. -- .: Leo :. [ sdl.web AT gmail.com ] .: I use Emacs :. www.git-scm.com git - the one true version control system From monnier@iro.umontreal.ca Thu Mar 19 13:40:16 2009 Received: (at 2723-done) by emacsbugs.donarmstrong.com; 19 Mar 2009 20:40:17 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.5 required=4.0 tests=HAS_BUG_NUMBER,XIRONPORT autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from ironport2-out.teksavvy.com (ironport2-out.pppoe.ca [206.248.154.182]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2JKeC9S011317 for <2723-done@emacsbugs.donarmstrong.com>; Thu, 19 Mar 2009 13:40:13 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiIFAENKwklFxIZP/2dsb2JhbACBT9Jsg3wGhGI X-IronPort-AV: E=Sophos;i="4.38,391,1233550800"; d="scan'208";a="35420704" Received: from 69-196-134-79.dsl.teksavvy.com (HELO pastel.home) ([69.196.134.79]) by ironport2-out.teksavvy.com with ESMTP; 19 Mar 2009 16:40:05 -0400 Received: by pastel.home (Postfix, from userid 20848) id B55897F0C; Thu, 19 Mar 2009 16:40:11 -0400 (EDT) From: Stefan Monnier To: Alan Mackenzie Cc: 2723-done@debbugs.gnu.org Subject: Re: bug#2723: Emacs 23: `interactive': prefix argument "P" and region "r" are mutually exclusive. Message-ID: References: <20090319191524.GA2306@muc.de> Date: Thu, 19 Mar 2009 16:40:11 -0400 In-Reply-To: <20090319191524.GA2306@muc.de> (Alan Mackenzie's message of "Thu, 19 Mar 2009 19:15:24 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > It seems that `(interactive "rP")' is only supplying the defun with two > parameters. Read C-h f interactive RET, and if you read carefully enough you'll see you need (interactive "r\nP") Stefan From acm@muc.de Thu Mar 19 14:49:58 2009 Received: (at 2723) by emacsbugs.donarmstrong.com; 19 Mar 2009 21:49:58 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail.muc.de (qmailr@colin.muc.de [193.149.48.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2JLnsbp029777 for <2723@emacsbugs.donarmstrong.com>; Thu, 19 Mar 2009 14:49:56 -0700 Received: (qmail 50026 invoked by uid 3782); 19 Mar 2009 21:49:53 -0000 Received: from acm.muc.de (pD9E51B61.dip.t-dialin.net [217.229.27.97]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Thu, 19 Mar 2009 22:49:51 +0100 Received: (qmail 1715 invoked by uid 1000); 19 Mar 2009 21:49:04 -0000 Date: Thu, 19 Mar 2009 21:49:04 +0000 To: Stefan Monnier Cc: 2723@debbugs.gnu.org Subject: Re: bug#2723: Emacs 23: `interactive': prefix argument "P" and region "r" are mutually exclusive. Message-ID: <20090319214904.GA1310@muc.de> References: <20090319191524.GA2306@muc.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de Hi, Stefan! On Thu, Mar 19, 2009 at 04:40:11PM -0400, Stefan Monnier wrote: > > It seems that `(interactive "rP")' is only supplying the defun with two > > parameters. > Read C-h f interactive RET, and if you read carefully enough you'll see > you need (interactive "r\nP") No. I've read closely and it doesn't say this, neither in the doc string or the Elisp manual. The pertinent bit of the Elisp manual reads thusly: * It may be a string; then its contents should consist of a code character followed by a prompt (which some code characters use and some ignore). The prompt ends either with the end of the string or with a newline. Here is a simple example: , i.e. the \n terminates the prompt rather than separating it from the next thing. This bit of the manual is oblivious to the existence of descriptors lacking prompts ("p", "P", "r", "d", "i", "m"), and looks like it could have been written early in Emacs's development, before "p" and friends existed (if there was such a time). The only bit of the doc string which is relevant is To prompt for multiple arguments, give a code letter, its prompt, a newline, and another code letter, etc. , which implies that the \n is required only where there's prompting going on, which clearly isn't the case for "P", "r", etc. Is there any reason why there needs to be a \n separating "P" and "r"? After all, in a shell, we can write tar -xf emacs.tar.gz , rather than having to do tar -x -f emacs.tar.gz , which is somewhat analagous. Aternatively, why does the interactive call function not give an error message? OK, I'll write the patches for the Elisp manual and `interactive''s doc string. Just not tonight. Should I reopen this bug, submit a new bug, or just submit the patch? > Stefan > -- Alan Mackenzie (Nuremberg, Germany). From mod-submit@uni-berlin.de Fri Mar 20 00:59:29 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 20 Mar 2009 07:59:29 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2K7xPTu020944 for ; Fri, 20 Mar 2009 00:59:27 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LkZdV-00046l-Jm for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2009 03:59:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LkZdR-00046H-3u for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2009 03:59:25 -0400 Received: from [199.232.76.173] (port=34600 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LkZdR-00046E-0v for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2009 03:59:21 -0400 Received: from moderators.individual.net ([130.133.4.7]:54612) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LkZdQ-0008Au-JY for bug-gnu-emacs@gnu.org; Fri, 20 Mar 2009 03:59:20 -0400 Received: from outpost1.zedat.fu-berlin.de ([130.133.4.66]) by moderators.individual.net (Exim 4.69) for gnu-emacs-bug@moderators.individual.net with esmtp (envelope-from ) id <1LkZdQ-0000p2-2f>; Fri, 20 Mar 2009 08:59:20 +0100 Received: from relay1.zedat.fu-berlin.de ([130.133.4.67]) by outpost1.zedat.fu-berlin.de (Exim 4.69) for gnu-emacs-bug@moderators.individual.net with esmtp (envelope-from ) id <1LkZdO-0003Ih-8N>; Fri, 20 Mar 2009 08:59:18 +0100 Received: from curry.zedat.fu-berlin.de ([130.133.1.2]) by relay1.zedat.fu-berlin.de (Exim 4.69) for gnu-emacs-bug@moderators.individual.net with esmtp (envelope-from ) id <1LkZdO-00061V-75>; Fri, 20 Mar 2009 08:59:18 +0100 Received: by Curry.ZEDAT.FU-Berlin.DE (Smail3.2.0.98) from news.uni-berlin.de with bsmtp id ; Fri, 20 Mar 2009 08:59:18 +0100 (MET) To: gnu-emacs-bug@moderators.individual.net Path: individual.net!not-for-mail From: Miles Bader Newsgroups: gnu.emacs.bug Subject: Re: bug#2723: Emacs 23: `interactive': prefix argument "P" and region "r" are mutually exclusive. Date: Fri, 20 Mar 2009 16:59:17 +0900 Lines: 11 Message-ID: <87d4ccbp62.fsf@catnip.gol.com> References: <20090319191524.GA2306@muc.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Orig-X-Trace: individual.net rR4NmoO7fIP2ZjZAKqChDAaHCXyW3G/z+TFHtKR2xjZbbbswYV Cancel-Lock: sha1:umCfe20qu2Y3JpcSWDX/vH4Gwms= sha1:67sXMKHpAEIGkMsHJcuQlf8TGnI= System-Type: x86_64-unknown-linux-gnu X-Originating-IP: 130.133.1.2 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Alan Mackenzie writes: > Is there any reason why there needs to be a \n separating "P" and "r"? > After all, in a shell, we can write An interesting question, but it does keep open the possibility of adding optional sub-parameters after the operation letter... -Miles -- Patience, n. A minor form of despair, disguised as a virtue. From monnier@iro.umontreal.ca Fri Mar 20 06:19:50 2009 Received: (at 2723) by emacsbugs.donarmstrong.com; 20 Mar 2009 13:19:50 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.5 required=4.0 tests=HAS_BUG_NUMBER,XIRONPORT autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from ironport2-out.teksavvy.com (ironport2-out.teksavvy.com [206.248.154.182]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2KDJlTo009324 for <2723@emacsbugs.donarmstrong.com>; Fri, 20 Mar 2009 06:19:48 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgMFAKM0w0lFxIZP/2dsb2JhbACBT9Jmg30GhGY X-IronPort-AV: E=Sophos;i="4.38,395,1233550800"; d="scan'208";a="35439372" Received: from 69-196-134-79.dsl.teksavvy.com (HELO pastel.home) ([69.196.134.79]) by ironport2-out.teksavvy.com with ESMTP; 20 Mar 2009 09:19:40 -0400 Received: by pastel.home (Postfix, from userid 20848) id BB9B27F74; Fri, 20 Mar 2009 09:19:51 -0400 (EDT) From: Stefan Monnier To: Alan Mackenzie Cc: 2723@debbugs.gnu.org Subject: Re: bug#2723: Emacs 23: `interactive': prefix argument "P" and region "r" are mutually exclusive. Message-ID: References: <20090319191524.GA2306@muc.de> <20090319214904.GA1310@muc.de> Date: Fri, 20 Mar 2009 09:19:51 -0400 In-Reply-To: <20090319214904.GA1310@muc.de> (Alan Mackenzie's message of "Thu, 19 Mar 2009 21:49:04 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii >> > It seems that `(interactive "rP")' is only supplying the defun with two >> > parameters. >> Read C-h f interactive RET, and if you read carefully enough you'll see >> you need (interactive "r\nP") > No. I see two bugs: 1 - the doc is unclear about the need for a newline. 2 - arguments without prompts should signal a warning when provided with a prompt (this would have helped you find your problem). Stefan From lekktu@gmail.com Fri Mar 20 07:39:33 2009 Received: (at 2723) by emacsbugs.donarmstrong.com; 20 Mar 2009 14:39:34 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2KEdU3w030736 for <2723@emacsbugs.donarmstrong.com>; Fri, 20 Mar 2009 07:39:31 -0700 Received: by ey-out-2122.google.com with SMTP id 25so167009eya.13 for <2723@emacsbugs.donarmstrong.com>; Fri, 20 Mar 2009 07:39:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=oWX2kEBy6YRMz3DpQfhwcunTK9r2zaTNZeDn0KZdSa0=; b=B4u2ArOKKR/GDRm9dYGeUW0d9FyIMCIQATgRWL0XjoI36x6dsAuWAsGGUVR1oXPdLU z/oSWtmEWiUU6Stlw53ZZJ9hYQ0Noi/94MtTRa+SHD7FN098+ekad8OMvBo838jjSU2n j8SgHnkUIS508XQqAJjZlwOT5Y1CVoQ+TQzWE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=LTCh3qcjGzJ/MXcINZZv6KvWfb3NhSx1wkecyiIIXg9JSBjTCwf2kdC2YGE1j+/CL/ lI5amvF3CdZdzSbbGVdiZ5CTkCrYtXbBvg+bbWmaJ6SxOOpKQ4zjGnMv2fGdraQZAqtj h0FW1/qlzLR4EsSs4xxvgQvpuq9l8RCpYTq6c= MIME-Version: 1.0 Received: by 10.210.128.5 with SMTP id a5mr2892420ebd.19.1237559969785; Fri, 20 Mar 2009 07:39:29 -0700 (PDT) In-Reply-To: References: <20090319191524.GA2306@muc.de> <20090319214904.GA1310@muc.de> Date: Fri, 20 Mar 2009 15:39:29 +0100 Message-ID: Subject: Re: bug#2723: Emacs 23: `interactive': prefix argument "P" and region "r" are mutually exclusive. From: Juanma Barranquero To: Stefan Monnier Cc: Alan Mackenzie , 2723@debbugs.gnu.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On Fri, Mar 20, 2009 at 14:19, Stefan Monnier wrote: > 1 - the doc is unclear about the need for a newline. As witnessed by - org/org-table.el (uses "rP") - progmodes/idlwave.el (uses "eP") - emulation/viper-util.el (uses "s x") Juanma From acm@muc.de Sat Mar 21 08:26:05 2009 Received: (at 2723) by emacsbugs.donarmstrong.com; 21 Mar 2009 15:26:05 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail.muc.de (qmailr@colin.muc.de [193.149.48.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2LFQ0Q8005142 for <2723@emacsbugs.donarmstrong.com>; Sat, 21 Mar 2009 08:26:02 -0700 Received: (qmail 98532 invoked by uid 3782); 21 Mar 2009 15:25:58 -0000 Received: from acm.muc.de (pD9E53470.dip.t-dialin.net [217.229.52.112]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Sat, 21 Mar 2009 16:25:55 +0100 Received: (qmail 7142 invoked by uid 1000); 21 Mar 2009 15:25:12 -0000 Date: Sat, 21 Mar 2009 15:25:12 +0000 To: Stefan Monnier Cc: 2723@debbugs.gnu.org, Juanma Barranquero , Leo , Miles Bader Subject: Re: bug#2723: Emacs 23: `interactive': prefix argument "P" and region "r" are mutually exclusive. Message-ID: <20090321152511.GA6890@muc.de> References: <20090319191524.GA2306@muc.de> <20090319214904.GA1310@muc.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de Hi, Stefan et al., On Fri, Mar 20, 2009 at 09:19:51AM -0400, Stefan Monnier wrote: > >> > It seems that `(interactive "rP")' is only supplying the defun with two > >> > parameters. > >> Read C-h f interactive RET, and if you read carefully enough you'll see > >> you need (interactive "r\nP") > > No. > I see two bugs: > 1 - the doc is unclear about the need for a newline. > 2 - arguments without prompts should signal a warning when provided with > a prompt (this would have helped you find your problem). OK, here's a pair of patches for bug 1. Any comments before I commit them? 2009-03-21 Alan Mackenzie * callint.c (Finteractive): Clarify the doc string - even promptless elements need \n separators. *** callint.c.orig 2009-03-08 14:56:05.000000000 +0000 --- callint.c 2009-03-21 14:49:33.360805672 +0000 *************** *** 68,85 **** DEFUN ("interactive", Finteractive, Sinteractive, 0, UNEVALLED, 0, doc: /* Specify a way of parsing arguments for interactive use of a function. For example, write ! (defun foo (arg) "Doc string" (interactive "p") ...use arg...) ! to make ARG be the prefix argument when `foo' is called as a command. The "call" to `interactive' is actually a declaration rather than a function; it tells `call-interactively' how to read arguments to pass to the function. When actually called, `interactive' just returns nil. ! The argument of `interactive' is usually a string containing a code letter ! followed by a prompt. (Some code letters do not use I/O to get ! the argument and do not need prompts.) To prompt for multiple arguments, ! give a code letter, its prompt, a newline, and another code letter, etc. ! Prompts are passed to format, and may use % escapes to print the arguments that have already been read. If the argument is not a string, it is evaluated to get a list of arguments to pass to the function. --- 68,86 ---- DEFUN ("interactive", Finteractive, Sinteractive, 0, UNEVALLED, 0, doc: /* Specify a way of parsing arguments for interactive use of a function. For example, write ! (defun foo (arg buf) "Doc string" (interactive "P\\nbbuffer: ") .... ) ! to make ARG be the raw prefix argument, and set BUF to an existing buffer, ! when `foo' is called as a command. The "call" to `interactive' is actually a declaration rather than a function; it tells `call-interactively' how to read arguments to pass to the function. When actually called, `interactive' just returns nil. ! Usually the argument of `interactive' is a string containing a code letter ! followed optionally by a prompt. (Some code letters do not use I/O to get ! the argument and do not use prompts.) To get several arguments, concatenate ! the individual strings, separating them by newline characters. ! Prompts are passed to format, and may use % escapes to print the arguments that have already been read. If the argument is not a string, it is evaluated to get a list of arguments to pass to the function. 2009-03-21 Alan Mackenzie * commands.texi (Using Interactive): Clarify string argument to `interactive' - even promptless elements need \n separators. *** commands.texi.orig 2009-02-12 12:10:45.000000000 +0000 --- commands.texi 2009-03-21 14:55:01.964850264 +0000 *************** *** 158,181 **** or more arguments. @item ! It may be a string; then its contents should consist of a code character ! followed by a prompt (which some code characters use and some ignore). ! The prompt ends either with the end of the string or with a newline. ! Here is a simple example: @smallexample ! (interactive "bFrobnicate buffer: ") @end smallexample @noindent ! The code letter @samp{b} says to read the name of an existing buffer, ! with completion. The buffer name is the sole argument passed to the ! command. The rest of the string is a prompt. ! ! If there is a newline character in the string, it terminates the prompt. ! If the string does not end there, then the rest of the string should ! contain another code character and prompt, specifying another argument. ! You can specify any number of arguments in this way. @c Emacs 19 feature The prompt string can use @samp{%} to include previous argument values --- 158,179 ---- or more arguments. @item ! It may be a string; its contents are a sequence of elements separated ! by newlines, one for each parameter@footnote{Some elements actually ! supply two parameters.}. Each element consists of a code character ! (@pxref{ Interactive Codes}) optionally followed by a prompt (which ! some code characters use and some ignore). Here is an example: @smallexample ! (interactive "P\nbFrobnicate buffer: ") @end smallexample @noindent ! The code letter @samp{P} sets the command's first argument to the raw ! command prefix (@pxref{Prefix Command Arguments}). @samp{bFrobnicate ! buffer: } prompts the user with @samp{Frobnicate buffer: } to enter ! the name of an existing buffer, which becomes the second and final ! argument. @c Emacs 19 feature The prompt string can use @samp{%} to include previous argument values > > Stefan -- Alan Mackenzie (Nuremberg, Germany). From monnier@iro.umontreal.ca Sat Mar 21 12:07:04 2009 Received: (at 2723) by emacsbugs.donarmstrong.com; 21 Mar 2009 19:07:04 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.5 required=4.0 tests=HAS_BUG_NUMBER, MURPHY_DRUGS_REL8,XIRONPORT autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from ironport2-out.teksavvy.com (ironport2-out.teksavvy.com [206.248.154.182]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n2LJ70so029868 for <2723@emacsbugs.donarmstrong.com>; Sat, 21 Mar 2009 12:07:01 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjoFACrYxElFxIZP/2dsb2JhbACBT9Jlg34GhGc X-IronPort-AV: E=Sophos;i="4.38,400,1233550800"; d="scan'208";a="35485132" Received: from 69-196-134-79.dsl.teksavvy.com (HELO pastel.home) ([69.196.134.79]) by ironport2-out.teksavvy.com with ESMTP; 21 Mar 2009 15:06:54 -0400 Received: by pastel.home (Postfix, from userid 20848) id 6F8937F74; Sat, 21 Mar 2009 15:07:14 -0400 (EDT) From: Stefan Monnier To: Alan Mackenzie Cc: 2723@debbugs.gnu.org, Juanma Barranquero , Leo , Miles Bader Subject: Re: bug#2723: Emacs 23: `interactive': prefix argument "P" and region "r" are mutually exclusive. Message-ID: References: <20090319191524.GA2306@muc.de> <20090319214904.GA1310@muc.de> <20090321152511.GA6890@muc.de> Date: Sat, 21 Mar 2009 15:07:14 -0400 In-Reply-To: <20090321152511.GA6890@muc.de> (Alan Mackenzie's message of "Sat, 21 Mar 2009 15:25:12 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > OK, here's a pair of patches for bug 1. Any comments before I commit them? Only one comment from me: thank you, Stefan From unknown Sat Jun 21 10:16:56 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: $requester Subject: Internal Control Message-Id: bug archived. Date: Sun, 19 Apr 2009 14:24:06 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A log time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator