unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stephen Berman <stephen.berman@gmx.net>
To: Andreas Schwab <schwab@suse.de>, Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: What is a preferred charset?
Date: Wed, 21 Nov 2018 17:48:37 +0100	[thread overview]
Message-ID: <87r2fe4bru.fsf@gmx.net> (raw)
In-Reply-To: <mvmo9aijvx1.fsf@suse.de> (Andreas Schwab's message of "Wed, 21 Nov 2018 16:24:26 +0100")

On Wed, 21 Nov 2018 16:24:26 +0100 Andreas Schwab <schwab@suse.de> wrote:

> On Nov 21 2018, Stephen Berman <stephen.berman@gmx.net> wrote:
>
>> The discussion in bug#33445 made me realize that I don't know what
>> distinguishes a preferred charset from other charsets
>
> It's the first from (charset-priority-list) that can encode the
> character.  The priority is defined by the language environment.

On Wed, 21 Nov 2018 17:37:07 +0200 Eli Zaretskii <eliz@gnu.org> wrote:

> "Preferred" is used there in the sense of "highest priority".  See
> charset-priority-list, set-charset-priority, and char-charset.  They
> are described in the node "Character Sets" of the ELisp manual.
>
> I guess someone tried to say "highest-priority" in fewer characters,
> to avoid making the line too long.

I had read that section of the manual before posting and at first did
conclude that preferred meant highest priority, but the output of
describe-char in HELLO seemed to conflict with that:

>> For example, etc/HELLO uses the non-standard text/enriched
>> annotation "x-charset" to make `describe-char' show
>> "latin-iso8859-1" as the preferred charset of INVERTED EXCLAMATION
>> MARK (#xa1), whereas when I use `C-x 8' to enter that character in a
>> buffer `describe-char' says its preferred charset is "unicode".  Why
>> are there different preferred charsets in these cases and what's the
>> significance and use of that difference in general
>
> When text has the 'charset' property, we show its value as the
> highest-priority charset of the characters having that property.  This
> property is described in "Explicit Encoding".

On my system (where the value of locale-coding-system is utf-8-unix) the
first entries in charset-priority-list are: ascii iso-8859-1 unicode
latin-iso8859-1 ...  And calling char-charset on the character named
INVERTED EXCLAMATION MARK returns "unicode" here.  That accords with
what you both wrote above about highest priority, but...

> In the case of HELLO, each hello phrase was given the 'charset'
> property corresponding to its language's script, so as to instruct
> Emacs to choose the most appropriate font for that greeting.

...this seems to be a different criterion for preferred, not the highest
priority as defined above, but (maybe) the smallest charset able to
encode the character?

>> and should it be documented?
>
> Now that you know what this is about, you tell me ;-)

I'm still not sure.

Steve Berman



  parent reply	other threads:[~2018-11-21 16:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-21 14:55 What is a preferred charset? Stephen Berman
2018-11-21 15:24 ` Andreas Schwab
2018-11-21 15:40   ` Stefan Monnier
2018-11-21 16:04     ` Eli Zaretskii
2018-11-21 16:48   ` Stephen Berman [this message]
2018-11-21 22:30     ` Eli Zaretskii
2018-11-21 22:44       ` Stephen Berman
2018-11-22  3:39         ` Eli Zaretskii
2018-11-22  9:07           ` Stephen Berman
2018-11-22 15:30             ` Eli Zaretskii
2018-11-22 16:28               ` Stephen Berman
2018-11-21 15:37 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r2fe4bru.fsf@gmx.net \
    --to=stephen.berman@gmx.net \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=schwab@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).