Subject: bug#2723 closed by Stefan Monnier <[email-masked]> (Re: bug#2723: Emacs 23: `interactive': prefix argument "P" and region "r" are mutually exclusive.)

From: [email-masked] (Emacs bug Tracking System)
Date: Thu, 19 Mar 2009 20:45:04 +0000

This is an automatic notification regarding your bug report
which was filed against the emacs package:

#2723: Emacs 23: `interactive': prefix argument "P" and region "r" are mutually exclusive.

It has been closed by Stefan Monnier <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Stefan Monnier <[email-masked]> by
replying to this email.

-- 
2723: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=2723
Emacs Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#2723: Emacs 23: `interactive': prefix argument "P" and region "r" are mutually exclusive.
From: Stefan Monnier <[email-masked]>
To: Alan Mackenzie <[email-masked]>
Cc: [email-masked]
Date: Thu, 19 Mar 2009 16:40:11 -0400

> 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

Subject: Emacs 23: `interactive': prefix argument "P" and region "r" are mutually exclusive.
From: Alan Mackenzie <[email-masked]>
To: [email-masked]
Date: Thu, 19 Mar 2009 19:15:24 +0000

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).