Subject: bug#7737: 23.2.91; interactive code "r" error

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 02 Jun 2021 10:44:52 +0200

Thierry Volpiatto <[email-masked]> writes:

> the interactive code "r" return an annoying error when the mark have not
> been set at least one time in current-buffer.
>
> ,----
> | The mark is not set now, so there is no region
> `----
>
> To reproduce use a code similar to this, use a new buffer where you
> didn't set the mark (mark and unmark don't count)
>
> (defun tv-delete-char (beg end arg)
>   (interactive "r\np") ; [1]
>   (if (and transient-mark-mode mark-active (/= (mark t) (point)))
>       (delete-region beg end)
>       (delete-char arg)))
> ;;==> The mark is not set now, so there is no region
>
> When the mark have been set/unset at least one time, the code above work
> as expected.

(I'm going through old bug reports that unfortunately got no response at
the time.)

I'm not sure I understand this bug report.  If no mark has been set,
there is no region, so of course a command like this should signal an
error.  Is the request that there should be a variant of "r" that
doesn't signal an error, but just leaves the parameters as nil?

If so, I'm not sure that's really all that useful.  Anybody got any
opinions here?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no