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

From: Michael Heerdegen <[email-masked]>
Date: Thu, 26 Oct 2023 06:18:27 +0200

Thierry Volpiatto <[email-masked]> writes:

> Not sure to understand what you want to do here.

Maybe it's easier if I post a patch.  Will try to do this tomorrow.

What I want to do is that `register-read-with-preview' accepts another
argument, a predicate, that is used to filter the registers to be
included in the preview.

And the hierarchy defining which registers support which operations I
want to define implicitly using method specializers, not explicitly
using types.

Because I think using generics is more flexible.  When the type system
you propose defines, for example, that string registers can be inserted,
and appendend and prepended to (we have commands for that), and
then, say, somebody wants to define a wrapper register type "read-only
register" that can hold anything a register can hold but with the
difference that the read-only register can't be modified, you want to
fall back to the filtering of the base type (which can be anything, so
this has to be done dynamically) - but disallow append and prepend for
string registers, for example.

Just an example, but such wrappers can be useful for registers.  You can
define registers with annotations for example: the annotations are
displayed in the preview but don't affect the behavior of the base
register.

Such things are hard to code using a type system.  Of course there are
more changes to be made to allow everything I outlined, but I want that
we don't do anything that limits what could be added to register.el in
the future.

Michael.