emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/lisp/international mule-cmds.el


From: Juri Linkov
Subject: [Emacs-diffs] emacs/lisp/international mule-cmds.el
Date: Wed, 12 Aug 2009 20:43:08 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Juri Linkov <jurta>     09/08/12 20:43:08

Modified files:
        lisp/international: mule-cmds.el 

Log message:
        (ucs-insert): Change arguments from `arg' to `character', `count',
        `inherit' to be the same as in `insert-char'.  Doc fix.  (Bug#4039)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/international/mule-cmds.el?cvsroot=emacs&r1=1.363&r2=1.364

Patches:
Index: mule-cmds.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/international/mule-cmds.el,v
retrieving revision 1.363
retrieving revision 1.364
diff -u -b -r1.363 -r1.364
--- mule-cmds.el        10 Aug 2009 21:42:33 -0000      1.363
+++ mule-cmds.el        12 Aug 2009 20:43:08 -0000      1.364
@@ -2917,19 +2917,28 @@
      (t
       (cdr (assoc-string input (ucs-names) t))))))
 
-(defun ucs-insert (arg)
-  "Insert a character of the given Unicode code point.
+(defun ucs-insert (character &optional count inherit)
+  "Insert COUNT copies of CHARACTER of the given Unicode code point.
 Interactively, prompts for a Unicode character name or a hex number
-using `read-char-by-name'."
-  (interactive (list (read-char-by-name "Unicode (name or hex): ")))
-  (if (stringp arg)
-      (setq arg (string-to-number arg 16)))
+using `read-char-by-name'.
+The optional third arg INHERIT (non-nil when called interactively),
+says to inherit text properties from adjoining text, if those
+properties are sticky."
+  (interactive
+   (list (read-char-by-name "Unicode (name or hex): ")
+        (prefix-numeric-value current-prefix-arg)
+        t))
+  (unless count (setq count 1))
+  (if (stringp character)
+      (setq character (string-to-number character 16)))
   (cond
-   ((not (integerp arg))
-    (error "Not a Unicode character code: %S" arg))
-   ((or (< arg 0) (> arg #x10FFFF))
-    (error "Not a Unicode character code: 0x%X" arg)))
-  (insert-and-inherit arg))
+   ((not (integerp character))
+    (error "Not a Unicode character code: %S" character))
+   ((or (< character 0) (> character #x10FFFF))
+    (error "Not a Unicode character code: 0x%X" character)))
+  (if inherit
+      (dotimes (i count) (insert-and-inherit character))
+    (dotimes (i count) (insert character))))
 
 (define-key ctl-x-map "8\r" 'ucs-insert)
 




reply via email to

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