unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: emacs-devel@gnu.org
Cc: Fatih Aydin <fataydin138@gmail.com>
Subject: Letter-case conversions in network protocols
Date: Sat, 08 May 2021 12:50:11 +0300	[thread overview]
Message-ID: <83h7jda71o.fsf@gnu.org> (raw)

For the immediate trigger, see bug#44604.

The general problem that I'd like us to discuss is how to deal with
letter-case conversions in code that deals with protocols, such as
network-related protocols, that need to recognize certain keywords.

The problem here is that when Emacs starts in certain locales, or
changes to the corresponding language-environments, we modify the case
tables to comply with the rules of those locales.  An example (though
not the only one) is the Turkish locale; see
turkish-case-conversion-enable.  As result of calling that, downcasing
'I' no longer produces 'i', and code which attempts to match keywords
including 'i' case-insensitively fails.

Since we generally use the same text-search and matching APIs both for
implementing the keyword-based protocols and for more general
processing of human-readable code, there's no easy solutions when we
need to ignore language-specific case-conversion rules in some of the
code.  For example, let-binding case-table cannot be done on a too
high level, because it will then affect any text processing below that
level, and a high-level function has no way of knowing what kind of
text processing will be needed by the code it calls, directly or
indirectly.

So what would be the best/easiest solution to this class of problems?

An immediate, but not necessarily easy, candidate is to use

  (with-case-table ascii-case-table

everywhere where we use text-search facilities for keyword processing.
However, this means we will have to go over all the places which do
this, and manually change the code there, and so will developers of
any 3rd-party packages.

Are there better solutions?  Ideas are welcome.



             reply	other threads:[~2021-05-08  9:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-08  9:50 Eli Zaretskii [this message]
2021-05-08 10:20 ` Letter-case conversions in network protocols Lars Ingebrigtsen
2021-05-08 13:47 ` Stefan Monnier
2021-05-08 15:41   ` Daniel Martín
2021-05-08 19:45     ` Lars Ingebrigtsen
2022-01-17  9:41       ` Fatih Aydin
2022-01-20  9:21         ` Lars Ingebrigtsen

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=83h7jda71o.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=fataydin138@gmail.com \
    /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).