From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michal Nazarewicz Newsgroups: gmane.emacs.bugs Subject: bug#24603: [PATCH 3/3] =?UTF-8?Q?Don=E2=80=99t?= generate =?UTF-8?Q?=E2=80=98X?= maps to =?UTF-8?Q?X=E2=80=99?= entries in case tables Date: Tue, 18 Oct 2016 00:03:45 +0200 Message-ID: <1476741825-32172-4-git-send-email-mina86@mina86.com> References: <1476741825-32172-1-git-send-email-mina86@mina86.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1476741901 16999 195.159.176.226 (17 Oct 2016 22:05:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 17 Oct 2016 22:05:01 +0000 (UTC) To: 24603@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 18 00:04:57 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bwG1O-0001bB-0H for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Oct 2016 00:04:38 +0200 Original-Received: from localhost ([::1]:36278 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwG1Q-0001SH-86 for geb-bug-gnu-emacs@m.gmane.org; Mon, 17 Oct 2016 18:04:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38044) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwG0r-00014U-RA for bug-gnu-emacs@gnu.org; Mon, 17 Oct 2016 18:04:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwG0o-0007W4-ND for bug-gnu-emacs@gnu.org; Mon, 17 Oct 2016 18:04:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59188) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bwG0o-0007Vt-IU for bug-gnu-emacs@gnu.org; Mon, 17 Oct 2016 18:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bwG0o-0000J2-Aa for bug-gnu-emacs@gnu.org; Mon, 17 Oct 2016 18:04:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michal Nazarewicz Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 17 Oct 2016 22:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24603 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 24603-submit@debbugs.gnu.org id=B24603.14767418371145 (code B ref 24603); Mon, 17 Oct 2016 22:04:02 +0000 Original-Received: (at 24603) by debbugs.gnu.org; 17 Oct 2016 22:03:57 +0000 Original-Received: from localhost ([127.0.0.1]:37140 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bwG0j-0000IN-DL for submit@debbugs.gnu.org; Mon, 17 Oct 2016 18:03:57 -0400 Original-Received: from mail-qk0-f175.google.com ([209.85.220.175]:34580) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bwG0g-0000Hl-Ek for 24603@debbugs.gnu.org; Mon, 17 Oct 2016 18:03:54 -0400 Original-Received: by mail-qk0-f175.google.com with SMTP id f128so249922176qkb.1 for <24603@debbugs.gnu.org>; Mon, 17 Oct 2016 15:03:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EhA2srxuZI3/imiuxE0fvevLlOxz82N6aj1DLPEwjEo=; b=Wv5LZsMQXWpsXewnaVhCY00aI7t9GmynFfHQIKnW+4LiXJUJv16NTT2Cw8W/4GzPa6 kDaC0Atdkumi+NdmfndMloXKxxhIaN2ZY+TC7NroKDFghPq/Hlnl60Rs787FBRNEDrYy zY6NsluVQo9qV0JIvkBW9T3abpMMQ31J42hi614tCawPqOem5Zkrg/Mj3nQqfVtvhU9a aUlvEIBn+K6mwKltQvrd+gKVbC49i8wV8FuhikQWhNI63LXQsIb6Kpgf3I5xE5KULQcV rdcjSfCCE/kJMUC095HqsTe5qJRrqnmoqihA9d4iQ/gfMlWnpjbSEwezzZgEZwDUSBRr C+Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=EhA2srxuZI3/imiuxE0fvevLlOxz82N6aj1DLPEwjEo=; b=V7zP/E5buA667SNjyC2t2NTI2UWZ4CLbbXF1mnNp556+ixFpIS1zEMIwzYELCjigfk r+qk4NSaCzLEdxNhh58uhXfu+5KnjSy/OPR8SGF/XRvIdXgsoxhYDZIoPOpAwWB6hLa/ l5qdZzfLo84lIG7RZuN2J8I4o8DRr2ZcVR74MFylSP7IVRVG4YMiaGDGW5u2WiCovVMo B6pqdZ3LResHGqizLLlKsIYvH9g+7K6OUQPR+bUUBCSrJtxx4Vn/5+GG+PIz/L57hQFc Mdu7x/rHdog6LibXrkk+Vn7L334Bg9DQQbB9bCmg79yYk0eDd9mSr7KAG4QGWL8ofbyR Sy4g== X-Gm-Message-State: AA6/9RnIeHXMfSIbVzpnCuCHtFs4SE6ddksRqHWX6GJsaMSOgftkgah9zfzfK4+TEKgQd0nj X-Received: by 10.194.18.137 with SMTP id w9mr13816397wjd.198.1476741828685; Mon, 17 Oct 2016 15:03:48 -0700 (PDT) Original-Received: from mpn.zrh.corp.google.com ([2620:0:105f:301:f8c3:9025:683e:3966]) by smtp.gmail.com with ESMTPSA id o1sm56633409wjh.9.2016.10.17.15.03.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Oct 2016 15:03:48 -0700 (PDT) Original-Received: by mpn.zrh.corp.google.com (Postfix, from userid 126942) id 9F0901E02A7; Tue, 18 Oct 2016 00:03:46 +0200 (CEST) X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <1476741825-32172-1-git-send-email-mina86@mina86.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:124608 Archived-At: If character maps to itself when lower or upper casing, do not put that information in the down or up case tables. Such entries only take up space without providing any additional information. This shrinks down and up case tables by around 500 entries each. * lisp/international/characters.el: Don’t set case identity mappings. --- lisp/international/characters.el | 14 ++------------ test/src/casefiddle-tests.el | 2 +- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/lisp/international/characters.el b/lisp/international/characters.el index 8dd9c73..d992d08 100644 --- a/lisp/international/characters.el +++ b/lisp/international/characters.el @@ -715,20 +715,10 @@ ?L (down tbl) (up (case-table-get-table tbl 'up))) - ;; This works on an assumption that if toUpper(x) != x then toLower(x) == - ;; x (and the opposite for toLower/toUpper). This doesn’t hold for title - ;; case characters but those incorrect mappings will be overwritten later. (funcall map-unicode-property 'uppercase - (lambda (lc uc) (aset down lc lc) (aset up uc uc))) + (lambda (lc uc) (aset up lc uc))) (funcall map-unicode-property 'lowercase - (lambda (uc lc) (aset down lc lc) (aset up uc uc))) - - ;; Now deal with the actual mapping. This will correctly assign casing for - ;; title-case characters. - (funcall map-unicode-property 'uppercase - (lambda (lc uc) (aset up lc uc) (aset up uc uc))) - (funcall map-unicode-property 'lowercase - (lambda (uc lc) (aset down uc lc) (aset down lc lc)))) + (lambda (uc lc) (aset down uc lc)))) ;; Clear out the extra slots so that they will be recomputed from the main ;; (downcase) table and upcase table. Since we’re side-stepping the usual diff --git a/test/src/casefiddle-tests.el b/test/src/casefiddle-tests.el index 4142aa0..bfc58f5 100644 --- a/test/src/casefiddle-tests.el +++ b/test/src/casefiddle-tests.el @@ -91,7 +91,7 @@ casefiddle-tests--characters (tabs (list up down))) (while props (let ((got (aref (car tabs) ch))) - (unless (equal (car expected) got) + (unless (equal (car expected) (or got ch)) (push (format "\n%c %s; expected: %s but got: %s" ch (car props) (car expected) got) errors))) -- 2.8.0.rc3.226.g39d4020