Subject: bug#51459: C-u RET fails with "Wrong type argument" (was: bug#51459: 29.0.50; org-return and org-return-and-maybe-indent)

From: Kévin Le Gouguec <[email-masked]>
Date: Thu, 28 Oct 2021 16:53:28 +0200

Kévin Le Gouguec <[email-masked]> writes:

>> When calling C-u RET, get "org--newline: Wrong type argument:
>> number-or-marker-p, (4)"
>
> That does look like a bug, however.

And it's not tied to Org, AFAICT.  C-u RET borks in fundamental-mode as
well, since ARG is (1) interactively obtained as a raw prefix argument
(2) used in a numeric comparison:

(defun newline (&optional arg interactive)
  […]
  (interactive "*P\np")
  (barf-if-buffer-read-only)
  (when (and arg
             (< arg 0))

IIUC this comparison comes from 2021-09-30 "Make `newline' check the
argument earlier" (d1aacceae9); Lars, should there be a
prefix-numeric-value or something thrown in there somewhere?