[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Improve find-sibling-rules option type
From: |
Mauro Aranda |
Subject: |
Re: [PATCH] Improve find-sibling-rules option type |
Date: |
Mon, 25 Sep 2023 06:52:30 -0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 |
On 24/9/23 22:17, Paul W. Rankin wrote:
>
> On 2023-09-24 19:44, Mauro Aranda wrote:
>> In particular, AFAICT there could be more than one EXPANSION. In that
>> case, :value-type should be a repeat of strings, not just a string. In
>> addition, regexp should be used as the :key-type type. (I see that
>> Philip already spotted this)
>
> Just looking at `find-sibling-file-search' and it looks like maybe?
But if this is the case I think the docstring should be rewritten.
Looking at it from a user's perspective if the docstring says "a string"
but there's a repeat of strings, that would be confusing.
My clue was (MATCH EXPANSION...) and then it says EXPANSIONS. And each
EXPANSION is a string, hence we have a repeat of strings.
>> In general, when converting from sexp to a more specific type, I think
>> we have to take extra precaution and check the code for how the
>> variable it's used (i.e., the docstring might not tell the whole story).
>> If ever in doubt, then it might be better and safer to offer a choice
>> with the more specific type first, and keep sexp as a catch-all
>> alternative.
>
> Customize already provides for this! The user can click [State] >
Show Saved Lisp Expression to edit/override the value with their own sexp.
That was not my point. My point was that in a "sexp to
more-specific-type" change, there's always a risk to introduce a minor
regression: that the user starts seeing a MISMATCH instead of SET/SAVED
as a message in Customize. IMO, that needs to be avoided as much as
possible.
But AFAICS, there will be no trouble here, provided that :value-type is
a repeat of strings.
> I think the main thing is not to have user options that demand sexps.
I agree. I'm in favor of avoiding sexp as much as possible, be it by
providing a more specific type, or a not-that-complicated user option.