all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattiase@acm.org>
To: emacs-devel <emacs-devel@gnu.org>
Subject: [PATCH] Replace latin-1-specific case-manipulation
Date: Wed, 20 Feb 2019 15:26:45 +0100	[thread overview]
Message-ID: <23807310-A2F9-4322-8A2C-03A63EFFD2AE@acm.org> (raw)

There is some broken case-manipulation code from the latin-1 era in cmpl-coerce-string-case. OK to apply?

---
Replace latin-1-specific case-manipulation

* lisp/completion.el (cmpl-coerce-string-case):
Rewrite case-changing code written for latin-1 but not valid today.

diff --git a/lisp/completion.el b/lisp/completion.el
index 14ecc9b83d..1073ae8915 100644
--- a/lisp/completion.el
+++ b/lisp/completion.el
@@ -409,10 +409,7 @@ Used to decide whether to save completions.")
 (defun cmpl-coerce-string-case (string case-type)
   (cond ((eq case-type :down) (downcase string))
        ((eq case-type :up) (upcase string))
-       ((eq case-type :capitalized)
-        (setq string (downcase string))
-        (aset string 0 (logand ?\337 (aref string 0)))
-        string)
+       ((eq case-type :capitalized) (capitalize string))
        (t string)))
 
 (defun cmpl-merge-string-cases (string-to-coerce given-string)





             reply	other threads:[~2019-02-20 14:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-20 14:26 Mattias Engdegård [this message]
2019-02-20 17:24 ` [PATCH] Replace latin-1-specific case-manipulation Eli Zaretskii
2019-02-20 20:47   ` Mattias Engdegård
2019-02-21  3:37     ` Eli Zaretskii
2019-02-21  5:25       ` Drew Adams
2019-02-21 14:37         ` Eli Zaretskii
2019-02-21  9:30       ` Mattias Engdegård
     [not found] <<23807310-A2F9-4322-8A2C-03A63EFFD2AE@acm.org>
     [not found] ` <<83va1egypa.fsf@gnu.org>
     [not found]   ` <<779A26F9-FE8F-477E-81BD-86200977E81D@acm.org>
     [not found]     ` <<83ef81hkwb.fsf@gnu.org>
     [not found]       ` <<b5545b1f-2488-4943-a063-09c25ace7b9b@default>
     [not found]         ` <<834l8xgqbx.fsf@gnu.org>
2019-02-21 15:23           ` Drew Adams

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

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

  git send-email \
    --in-reply-to=23807310-A2F9-4322-8A2C-03A63EFFD2AE@acm.org \
    --to=mattiase@acm.org \
    --cc=emacs-devel@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.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.