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

From: Thierry Volpiatto <[email-masked]>
Date: Thu, 21 Dec 2023 18:04:02 +0000

Eli Zaretskii <[email-masked]> writes:

>> From: Thierry Volpiatto <[email-masked]>
>> Cc: [email-masked],  [email-masked],  [email-masked],
>>   [email-masked],  [email-masked]
>> Date: Wed, 20 Dec 2023 17:23:14 +0000
>> 
>> >   . I suggest to rename all the "*basic" symbols to "*traditional"
>> >     instead (including such words in some doc strings)
>> 
>> Ok, done.  Have a look though to verify if docstring is correct.
>> 
>> >   . I think we need to update the NEWS entry, and in particular
>> >     describe there the two different "styles" of entering the register
>> >     names and the preview modes
>> 
>> I would prefer you do this, it will be better written.
>> 
>> > (I'm okay with doing these minor changes myself, once you install the
>> > changes.)
>> 
>> Ok, now merged, Thanks.
>
> Thanks, I have a question:
>
> The doc string of register-use-preview says:
>
>   This has no effect when the value of `register--read-with-preview-function'
>   is `register-read-with-preview-traditional'.
>
> However, customizing register-use-preview to the value 'traditional
> has the exact effect of setting register--read-with-preview-function
> to register-read-with-preview-traditional.  OTOH, when
> register-use-preview is set to 'traditional, one can set it to a
> different value, and then the behavior will change.  So I wonder what
> that sentence is about and what I missed?  Is that perhaps a leftover
> from previous versions, and should now be deleted?

Yes exactly, it can be deleted.

> I updated the documentation and NEWS.  I'd appreciate if you could
> spare a few minutes to review the changes and point out any
> inaccuracies or mistakes.

About the documentation or register-use-preview in the manual:

Another difference with the old behavior (traditional) is that the
preview is filtered according to type of registers used by command.  For
example insert-register show only the registers that can be inserted,
not windows, markers etc... Same for jump.

    -  "Returns a function to format a register for previewing.
    -This according to the value of READ-PREVIEW-FUNCTION.")
    +  "Return a function to format a register for previewing.
    +This is according to the value of `read-preview-function'.")

Here READ-PREVIEW-FUNCTION is the argument of function and not a
variable, so IMO it should be upcased and not quoted.

     (cl-defstruct register-preview-info
       "Store data for a specific register command.
    -TYPES are the types of register supported.
    -MSG is the minibuffer message to send when a register is selected.
    +TYPES are the supported types of registers.
    +MSG is the minibuffer message to show when a register is selected.
     ACT is the type of action the command is doing on register.
    -SMATCH accept a boolean value to say if command accept non matching register."
    +SMATCH accept a boolean value to say if the command accepts non-matching
    +registers."
       types msg act smatch noconfirm)

NOCONFIRM is not documented (my fault).
When set to nil don't request confirmation with RET.

Otherwise all looks good to me, thanks.

-- 
Thierry