Re: Get rid of "set language local"? (was: Re: [PATCH 23/40] Make language_def O(1))

Matt Rice
2017-07-20T23:44:31Z

On Thu, Jul 20, 2017 at 11:11 AM, Pedro Alves <palves@redhat.com> wrote:
> On 07/20/2017 06:40 PM, Pedro Alves wrote:
>> On 07/18/2017 12:03 AM, Keith Seitz wrote:
>>> On 06/02/2017 05:22 AM, Pedro Alves wrote:
>>>
>>>> Note that "local_language_defn" is gone along the way. AFAICT, it's
>>>> just a copy of "auto", so the new code simply maps one to the other.
>>>> One fewer place to update when we need to change the language
>>>> vector...
>>>
>>> I've searched the manual, and the "local" language is mentioned only in two places, once in the description of "set language" (where it explains that "local" and "auto" are the same) and once when we describe -data-evaluate-expression's --language flag.
>>>
>>> Honestly, is there any reason to keep it at all given it is a synonym of auto? [I realize that it doesn't cost much to maintain with this patch.] I'm not asking for any changes in this regard, just throwing the possibility out there. TBH, I didn't even know "local" existed.
>>
>> I didn't know about "local" until I stumbled on it working on this
>> series, either. :-)
>>
>> I'll send a follow up reply with a different subject
>> to see if anyone else has comments on that.
>
> Does anyone here ever use "set language local" instead
> of "set language auto"? Do we need to keep "set language local" ?
> Seems odd to have two ways to do the exact same thing.

Never knew about "local", and if it is a straight copy of auto don't
much see the point of keeping it. if local came with some other flag,
that says "when the language inference fails, fall back to the local
language instead of minimal"

however that would probably be better achieved by adding python/guile
hooks called by the language inference mechanism for adding e.g. file
extensions, or even per-symbol heuristics if that would be possible.

my $0.02 from someone who has debugged some stuff where failure to
infer language leads to a pretty terrible experience.