emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r107379: * international/mule-cmds.el


From: Juri Linkov
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107379: * international/mule-cmds.el (read-char-by-name): Use \` and \'.
Date: Thu, 23 Feb 2012 01:35:07 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107379
fixes bug(s): http://debbugs.gnu.org/10857
committer: Juri Linkov <address@hidden>
branch nick: trunk
timestamp: Thu 2012-02-23 01:35:07 +0200
message:
  * international/mule-cmds.el (read-char-by-name): Use \` and \'.
  (ucs-insert): Doc fix.  Check for hex digits in the string.
  Don't display `nil' in the error message.
modified:
  lisp/ChangeLog
  lisp/international/mule-cmds.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-02-22 19:34:32 +0000
+++ b/lisp/ChangeLog    2012-02-22 23:35:07 +0000
@@ -1,3 +1,9 @@
+2012-02-22  Juri Linkov  <address@hidden>
+
+       * international/mule-cmds.el (read-char-by-name): Use \` and \'.
+       (ucs-insert): Doc fix.  Check for hex digits in the string.
+       Don't display `nil' in the error message.  (Bug#10857)
+
 2012-02-22  Alan Mackenzie  <address@hidden>
 
        * progmodes/cc-modes: revert change #107149 from 2012-02-06.

=== modified file 'lisp/international/mule-cmds.el'
--- a/lisp/international/mule-cmds.el   2012-02-10 19:35:28 +0000
+++ b/lisp/international/mule-cmds.el   2012-02-22 23:35:07 +0000
@@ -2949,9 +2949,9 @@
                        '(metadata (category . unicode-name))
                      (complete-with-action action (ucs-names) string pred))))))
     (cond
-     ((string-match-p "^[0-9a-fA-F]+$" input)
+     ((string-match-p "\\`[0-9a-fA-F]+\\'" input)
       (string-to-number input 16))
-     ((string-match-p "^#" input)
+     ((string-match-p "\\`#" input)
       (read input))
      (t
       (cdr (assoc-string input (ucs-names) t))))))
@@ -2967,6 +2967,10 @@
 the characters whose names include that substring, not necessarily
 at the beginning of the name.
 
+This function also accepts a hexadecimal number of Unicode code
+point or a number in hash notation, e.g. #o21430 for octal,
+#x2318 for hex, or #10r8984 for decimal.
+
 The optional third arg INHERIT (non-nil when called interactively),
 says to inherit text properties from adjoining text, if those
 properties are sticky."
@@ -2975,9 +2979,12 @@
         (prefix-numeric-value current-prefix-arg)
         t))
   (unless count (setq count 1))
-  (if (stringp character)
+  (if (and (stringp character)
+          (string-match-p "\\`[0-9a-fA-F]+\\'" character))
       (setq character (string-to-number character 16)))
   (cond
+   ((null character)
+    (error "Not a Unicode character"))
    ((not (integerp character))
     (error "Not a Unicode character code: %S" character))
    ((or (< character 0) (> character #x10FFFF))


reply via email to

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