Subject: bug#66394: 29.1; Make register-read-with-preview more useful

From: Michael Heerdegen <[email-masked]>
Date: Mon, 23 Oct 2023 06:09:58 +0200

Thierry Volpiatto <[email-masked]> writes:

> > For jumping?  Why is this useful?
>
> Well, actually with original behavior you can jump to a register
> recorded as a string, which returns an error of course because the
> register is meant to use with insert.  Now the situation is better
> because the candidates are filtered but you can still jump to an
> unwanted place, read-from-minibuffer lets you the time to see where you
> are going.

Ah - ok.  Then that's definitely useful.  Haven't yet tried the complete
code, but I had a look at the link you posted.

It would not be good to carve the current register type system
into stone.  Instead of your `register-type' function I would prefer
something extensible, for the case of new register types being added
(even a normal user might want to do this).  So, when one wants to add a
new register type, it is necessary that one is able to declare, in some
way, whether registers of this type should be included or not for
`insert-register' (and maybe also `jump-to-register').

Instead of a detour via type names a better way seems to be adding new
predicate methods that accept one argument, a register, and should
return non-nil when the argument register can be inserted, or jumped to.

I can try to modify your patch accordingly if you are interested.

Thx,

Michael.