Commit 41d33032 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* lisp/international/mule-cmds.el: Use lexical-binding.

(ucs-names): Simplify.
parent 846e6e84
2014-06-12 Stefan Monnier <>
* international/mule-cmds.el: Use lexical-binding.
(ucs-names): Simplify.
2014-05-18 Eric Hanchrow <>
* progmodes/python.el (run-python): Use read-shell-command.
;;; 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 @@ on encoding."
(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)))
'((#x10000 . #x134FF)
(#xFB00 . #x134FF)
;; (#x13500 . #x167FF) unused
(#x16800 . #x16A3F)
;; (#x16A40 . #x1AFFF) unused
......@@ -2928,23 +2926,20 @@ on encoding."
;; (#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))
(dolist (range ranges)
(let ((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))))
(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.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment