[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Filter registers before preview
From: |
Evgenii Klimov |
Subject: |
Re: [PATCH] Filter registers before preview |
Date: |
Mon, 31 Jul 2023 13:45:51 +0100 |
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Evgenii Klimov <eugene.dev@lipklim.org>
>> Date: Sun, 30 Jul 2023 19:27:09 +0100
>>
>> Hi, I find registers very useful (especially with elaborate
>> `register-preview-function'), but as they become more and more numerous,
>> it gets difficult to select the right one, because every command
>> (`jump-to-register', `insert-register', etc.) shows every register in
>> the preview buffer, even if the register is not applicable in this
>> context.
[...]
> Can you describe the idea in a few words?
The idea is simple. For example, if user calls `jumt-to-register' it
means that they want to use registers that support "jump" action. But
the preview buffer offers them all registers. I don't find it useful,
since if the user chooses incorrect register it won't lead to the
desired result (there will be an error that this type of registers
is not supported by this command).
We can save the user from the burden of figuring out if this particular
command support this type of registers or not. Sometimes it's not very
intuitive, e.g. `increment-register' supports string registers and
`insert-register' supports marker registers.
It's not a big deal if there are two or three registers, but as you add
more and more of them the list of irrelevant entries in the current
context grows.
> And do I understand correctly that with this change it will be
> impossible to preview all of the registers? If so, I think we should
> provide that as well, in some way.
>
> Thanks.
No, this change affects only commands that are designed for specific
register types. Commands that add new registers are not affected.
If users want to previw all registers, they can use `list-registers', or
`point-to-register' and other *-to-register commands. One could say
that the latter is a hack, but previewing, for example, rectangle or
string registers via `jump-to-register' is a much greater hack.