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

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

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


From: Thierry Volpiatto
Subject: bug#66394: 29.1; Make register-read-with-preview more useful
Date: Mon, 23 Oct 2023 05:14:07 +0000

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Thierry Volpiatto <thievol@posteo.net> 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.

Not sure to understand what you envisage here, but if you do something
like this you have to make the types used for the two register commands
configurable as well.
Actually we have insert-register that accept '(string number) types and
jump-to-register that accept '(window frame marker) types and this is
hardcoded. I guess you want to make register-type a generic function and
add several method that fit the types we actually have and if one wants
to add a new type he just have to write a new defmethod and add the new
type to the methods suitable for insert or jump.

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

Yes but I think this should go into another commit on top of my patch to
avoid having a "too big patch".

Thanks.

-- 
Thierry

Attachment: signature.asc
Description: PGP signature


reply via email to

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