unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: manipulating (capitalize, lower case) unicode bold and italic characters
Date: Mon, 08 Jul 2019 22:21:30 +0300	[thread overview]
Message-ID: <83wogs5o3p.fsf@gnu.org> (raw)
In-Reply-To: <CAOphizL+X009MDTseuS+8a0T4vfDAVuB0Joyc+JzJrkMRrvrOQ@mail.gmail.com> (message from Dan Hitt on Mon, 8 Jul 2019 11:50:07 -0700)

> From: Dan Hitt <dan.hitt@gmail.com>
> Date: Mon, 8 Jul 2019 11:50:07 -0700
> Cc: help-gnu-emacs@gnu.org
> 
> If you enter a mathematical italic small w (0x1D464) and a mathematical
> italic capital w (0x1D44A) and do 'describe-char' for each, the small one
> has the Lowercase general category, while the capital has the Uppercase
> general category.  I did not know about the concept of 'case pair' in
> unicode, so i guess it is possible that even though emacs knows one is
> Lowercase and one is Uppercase, it is possible that it does not know that
> they are in a pair.

They are not a letter-case pair because Unicode doesn't say they are.
The fact that a character has general category lowercase doesn't yet
imply that it has a defined upper-case variant, these are two separate
attributes.  Emacs defines its case pairs according to what it finds
in the Unicode Character Database.

Of course, you can teach Emacs about the letter-case pairs yourself,
like this:

  (let ((tbl (standard-case-table)))
    (set-downcase-syntax ?𝑊 ?𝑤 tbl)
    (set-upcase-syntax ?𝑤 ?𝑊 tbl))

> (How would i find out, from emacs?)

By looking at the table returned by standard-case-table, for example:

  (aref (standard-case-table) ?A)
    => 97

but

  (aref (standard-case-table) ?𝑊)
    => nil

> The commands downcase-region and upcase-region do not work on them

They won't work on letters that have no case-pairs.

Once again: I do NOT recommend using the characters from the
Mathematical Alphanumeric Symbols block for writing English text,
that's not their purpose.



  reply	other threads:[~2019-07-08 19:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-07 19:13 manipulating (capitalize, lower case) unicode bold and italic characters Dan Hitt
2019-07-08  2:29 ` Eli Zaretskii
2019-07-08 13:11   ` Marcin Borkowski
2019-07-08 13:51     ` Eli Zaretskii
2019-07-08 17:07       ` Stefan Monnier
2019-07-08 17:19         ` Eli Zaretskii
2019-07-08 18:50       ` Dan Hitt
2019-07-08 19:21         ` Eli Zaretskii [this message]
2019-07-08 22:32           ` Dan Hitt

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=83wogs5o3p.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /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.
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).