Subject: bug#16050: 24.3; let copy-to-register choose default location of point for insert-register

From: Lars Ingebrigtsen <[email-masked]>
Date: Tue, 10 May 2022 17:59:36 +0200

Tom Tromey <[email-masked]> writes:

> I sometimes use registers for repetitive insertion of text.
>
> Sometimes I want point to end up at the end of the insertion.
> I know I can do this with a prefix argument, but it would be nicer if I
> could specify this automatically for a given register, say when creating
> the contents.
>
> For example, when I invoke copy-to-register, if point is at the end of
> the region, then that could indicate that I want point to be at the end
> of the region at insertion time.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

I don't think we can change the behaviour of these commands, because
that would be annoying to many users that are used to the current way
they work.

> Or, perhaps a prefix argument to copy-to-register would work ok as well.

Unfortunately, the prefix argument is already taken there.

In addition, "remembering" this data is kinda tricky -- we allow saving
registers to file, and we'd have to extend the on-file format, etc.
Everything's possible with a little programming, of course, but the
interface problems are more difficult -- I don't immediately see any
good way for the user to specify that it's a point-at-the-end register.

We could add a special command for that, but...

Hm...  perhaps we could make `C-u' for insert-register "sticky" for that
register?  That is, if you `C-u C-x r i a', then that "a" register would
keep that behaviour for the rest of the session (until toggled off with
a subsequent `C-u C-x r i a', perhaps).

But that's a pretty convoluted interface, and changes the current
behaviour.

Anybody got any ideas here?

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