[Top][All Lists]

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

Re: per-buffer language environments

From: Eli Zaretskii
Subject: Re: per-buffer language environments
Date: Fri, 17 Dec 2010 13:51:59 +0200

> From: "Stephen J. Turnbull" <address@hidden>
> Cc: address@hidden,
>     address@hidden
> Date: Fri, 17 Dec 2010 06:10:44 +0900
> I know you were talking about something else, but I can't figure out
> what or why.

Sorry for not making myself clear.  Let me try again:

  . The issue is what it means to have a separate buffer-local
    "language environment".

  . The current machinery of language environments was invented and
    evolved to its current form as a global session-wide setting.  I'm
    not sure the same set of heuristics, or even the extent of what
    "language environment" means and what settings it affects, are
    still correct for a buffer-local setting.

  . There's any number of possible use-cases for needing this kind of
    feature.  They are all quite rare (if they weren't, we would have
    many complaints about not having such a feature, which we don't).
    The current heuristics encoded in the global language environment
    does not cover well rare and marginal use-cases, being just that
    -- a set of heuristics.  It is therefore quite probable that just
    making the language environment buffer-local and keeping all the
    rest of its machinery and semantics would do the wrong thing for a
    large portion of the use-cases which need such a buffer-local

  . IMO, the way we set priorities for selecting an encoding based on
    the language runs the highest risk being inappropriate for this
    kind of buffer-local "language environment".  That's because
    selection of an appropriate encoding depends on factors that have
    nothing to do with the language, for those languages which have
    several alternative encodings.  These factors include the locale,
    the filesystem on which the buffer's file lives (which could be
    local or remote), the purpose of the text that is edited (it could
    be a text file, or a program source, or an email message meant to
    be sent, or text to be sent to a subsidiary program or copy/pasted
    through a selection), and possibly some more.  Setting the
    language can surely identify a small set of appropriate encodings,
    but I very much doubt that it can correctly select The Right One.

  . Therefore, I think that buffer-local "language environments"
    should not automatically select the encodings given just the
    language name, but instead let the user specify them separately
    when she selects the buffer-local language.

>  > > That's an honest question; the way you are going, I have to wonder.
>  > 
>  > Knowing me for as long as you do, I wonder how can such a question be
>  > honest.  But I digress.
> Usually you don't miss a point like "nobody is proposing anything new
> here for how language environments work".  (All that is being proposed
> is making them buffer-local.)  Since you did miss it, I have to wonder
> if you know anything about how encoding detection works internally.

Since you have the logs to get you straight about the degree of my
knowledge in that issue, you should rather wonder whether I'm missing
your point because I misunderstood what you are saying or because you
failed to explain it clearly.

reply via email to

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