bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Lars Ingebrigtsen
Subject: bug#7737: 23.2.91; interactive code "r" error
Date: Wed, 02 Jun 2021 10:44:52 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Thierry Volpiatto <thierry.volpiatto@gmail.com> 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]