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

From: Alan Mackenzie <[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).