emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r117314: * lisp/international/mule-cmds.el: Use lexi


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r117314: * lisp/international/mule-cmds.el: Use lexical-binding.
Date: Thu, 12 Jun 2014 01:47:34 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117314
revision-id: address@hidden
parent: address@hidden
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Wed 2014-06-11 21:47:28 -0400
message:
  * lisp/international/mule-cmds.el: Use lexical-binding.
  (ucs-names): Simplify.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/international/mule-cmds.el 
mulecmds.el-20091113204419-o5vbwnq5f7feedwu-1043
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-06-12 01:45:33 +0000
+++ b/lisp/ChangeLog    2014-06-12 01:47:28 +0000
@@ -1,3 +1,8 @@
+2014-06-12  Stefan Monnier  <address@hidden>
+
+       * international/mule-cmds.el: Use lexical-binding.
+       (ucs-names): Simplify.
+
 2014-05-18  Eric Hanchrow  <address@hidden>
 
        * progmodes/python.el (run-python): Use read-shell-command.

=== modified file 'lisp/international/mule-cmds.el'
--- a/lisp/international/mule-cmds.el   2014-06-06 14:25:39 +0000
+++ b/lisp/international/mule-cmds.el   2014-06-12 01:47:28 +0000
@@ -1,4 +1,4 @@
-;;; mule-cmds.el --- commands for multilingual environment -*-coding: utf-8 -*-
+;;; mule-cmds.el --- commands for multilingual environment  -*- 
lexical-binding:t -*-
 
 ;; Copyright (C) 1997-2014 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
@@ -2909,16 +2909,14 @@
 (defun ucs-names ()
   "Return alist of (CHAR-NAME . CHAR-CODE) pairs cached in `ucs-names'."
   (or ucs-names
-      (let ((bmp-ranges
+      (let ((ranges
             '((#x0000 . #x33FF)
               ;; (#x3400 . #x4DBF) CJK Ideographs Extension A
               (#x4DC0 . #x4DFF)
               ;; (#x4E00 . #x9FFF) CJK Unified Ideographs
               (#xA000 . #xD7FF)
               ;; (#xD800 . #xFAFF) Surrogate/Private
-              (#xFB00 . #xFFFD)))
-           (upper-ranges
-            '((#x10000 . #x134FF)
+              (#xFB00 . #x134FF)
               ;; (#x13500 . #x167FF) unused
               (#x16800 . #x16A3F)
               ;; (#x16A40 . #x1AFFF) unused
@@ -2928,23 +2926,20 @@
               ;; (#x20000 . #xDFFFF) CJK Ideograph Extension A, B, etc, unused
               (#xE0000 . #xE01FF)))
            (gc-cons-threshold 10000000)
-           c end name names)
-        (dolist (range bmp-ranges)
-          (setq c (car range)
-                end (cdr range))
-         (while (<= c end)
-           (if (setq name (get-char-code-property c 'name))
-               (push (cons name c) names))
-           (if (setq name (get-char-code-property c 'old-name))
-               (push (cons name c) names))
-           (setq c (1+ c))))
-        (dolist (range upper-ranges)
-          (setq c (car range)
-                end (cdr range))
-         (while (<= c end)
-           (if (setq name (get-char-code-property c 'name))
-               (push (cons name c) names))
-           (setq c (1+ c))))
+           names)
+       (dolist (range ranges)
+         (let ((c (car range))
+               (end (cdr range)))
+         (while (<= c end)
+             (let ((new-name (get-char-code-property c 'name))
+                   (old-name (get-char-code-property c 'old-name)))
+               ;; In theory this code could end up pushing an "old-name" that
+               ;; shadows a "new-name" but in practice every time an
+               ;; `old-name' conflicts with a `new-name', the newer one has a
+               ;; higher code, so it gets pushed later!
+               (if new-name (push (cons new-name c) names))
+               (if old-name (push (cons old-name c) names))
+               (setq c (1+ c))))))
        ;; Special case for "BELL" which is apparently the only char which
        ;; doesn't have a new name and whose old-name is shadowed by a newer
        ;; char with that name.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]