aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2008-07-31 16:52:11 +0000
committerJuri Linkov2008-07-31 16:52:11 +0000
commitc0a67379ac59dea7b0491b4aa47a07a243f10f54 (patch)
tree938d4ba54c716befd286d011a2d659bc3ce6cd84
parentd6601455c1b34709ee02f45ddba52421a67ffb12 (diff)
downloademacs-c0a67379ac59dea7b0491b4aa47a07a243f10f54.tar.gz
emacs-c0a67379ac59dea7b0491b4aa47a07a243f10f54.zip
(read-char-by-name): Accept hash notation. Doc fix.
(ucs-insert): Doc fix. Convert to number only when `arg' is a string. Use separate error message when `arg' is not an integer. Bind `ucs-insert' to `C-x 8 RET'.
-rw-r--r--lisp/ChangeLog26
-rw-r--r--lisp/international/mule-cmds.el33
2 files changed, 48 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e14832be175..1b950b39586 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,29 @@
12008-07-31 Juri Linkov <juri@jurta.org>
2
3 * dired-aux.el (dired-isearch-filenames-toggle): New command.
4 (dired-isearch-filenames-setup): Bind "\M-sf" to
5 dired-isearch-filenames-toggle in isearch-mode-map.
6 (dired-isearch-filenames-end): Bind "\M-sf" to nil
7 in isearch-mode-map.
8
9 * isearch.el (isearch-edit-string-set-word): New command.
10 (minibuffer-local-isearch-map): Bind "\C-w" to
11 isearch-edit-string-set-word.
12 (isearch-new-word): Temporary internal variable.
13 (isearch-edit-string): Remove special case of reading the
14 first character and checking it for C-w.
15
16 * simple.el (read-shell-command, shell-command):
17 Move code that uses minibuffer-with-setup-hook to set
18 minibuffer-default-add-function to minibuffer-default-add-shell-commands
19 from the interactive spec of `shell-command' to `read-shell-command'.
20
21 * international/mule-cmds.el (read-char-by-name):
22 Accept hash notation. Doc fix.
23 (ucs-insert): Doc fix. Convert to number only when `arg' is
24 a string. Use separate error message when `arg' is not an integer.
25 Bind `ucs-insert' to `C-x 8 RET'.
26
12008-07-31 Joachim Nilsson <joachim.nilsson@member.fsf.org> (tiny change) 272008-07-31 Joachim Nilsson <joachim.nilsson@member.fsf.org> (tiny change)
2 28
3 * progmodes/cc-styles.el (c-style-alist): For the Ellemtel style, 29 * progmodes/cc-styles.el (c-style-alist): For the Ellemtel style,
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index aa45bda2c48..08b50cbee78 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -2858,26 +2858,37 @@ If CODING-SYSTEM can't safely encode CHAR, return nil."
2858 2858
2859(defun read-char-by-name (prompt) 2859(defun read-char-by-name (prompt)
2860 "Read a character by its Unicode name or hex number string. 2860 "Read a character by its Unicode name or hex number string.
2861Display PROMPT and read a string that represents a character 2861Display PROMPT and read a string that represents a character by its
2862by its Unicode property `name' or `old-name'. It also accepts 2862Unicode property `name' or `old-name'. You can type a few of first
2863a hexadecimal number of Unicode code point. Returns a character 2863letters of the Unicode name and use completion. This function also
2864as a number." 2864accepts a hexadecimal number of Unicode code point or a number in
2865hash notation, e.g. #o21430 for octal, #x2318 for hex, or #10r8984
2866for decimal. Returns a character as a number."
2865 (let* ((completion-ignore-case t) 2867 (let* ((completion-ignore-case t)
2866 (input (completing-read prompt ucs-completions))) 2868 (input (completing-read prompt ucs-completions)))
2867 (or (and (string-match "^[0-9a-fA-F]+$" input) 2869 (cond
2868 (string-to-number input 16)) 2870 ((string-match "^[0-9a-fA-F]+$" input)
2869 (cdr (assoc input (ucs-names)))))) 2871 (string-to-number input 16))
2872 ((string-match "^#" input)
2873 (read input))
2874 (t
2875 (cdr (assoc input (ucs-names)))))))
2870 2876
2871(defun ucs-insert (arg) 2877(defun ucs-insert (arg)
2872 "Insert a character of the given Unicode code point. 2878 "Insert a character of the given Unicode code point.
2873Interactively, prompts for a hex string giving the code." 2879Interactively, prompts for a Unicode character name or a hex number
2880using `read-char-by-name'."
2874 (interactive (list (read-char-by-name "Unicode (name or hex): "))) 2881 (interactive (list (read-char-by-name "Unicode (name or hex): ")))
2875 (or (integerp arg) 2882 (if (stringp arg)
2876 (setq arg (string-to-number arg 16))) 2883 (setq arg (string-to-number arg 16)))
2877 (if (or (< arg 0) (> arg #x10FFFF)) 2884 (cond
2878 (error "Not a Unicode character code: 0x%X" arg)) 2885 ((not (integerp arg))
2886 (error "Not a Unicode character code: %S" arg))
2887 ((or (< arg 0) (> arg #x10FFFF))
2888 (error "Not a Unicode character code: 0x%X" arg)))
2879 (insert-and-inherit arg)) 2889 (insert-and-inherit arg))
2880 2890
2891(define-key ctl-x-map "8\r" 'ucs-insert)
2881 2892
2882;; arch-tag: b382c432-4b36-460e-bf4c-05efd0bb18dc 2893;; arch-tag: b382c432-4b36-460e-bf4c-05efd0bb18dc
2883;;; mule-cmds.el ends here 2894;;; mule-cmds.el ends here