From: morioka Date: Fri, 5 Jun 1998 14:13:28 +0000 (+0000) Subject: (split-char): New function. X-Git-Tag: apel-8_14~3 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=74a8825ef7a5605d9fadc459021f7fff35bbb61f;p=elisp%2Fapel.git (split-char): New function. --- diff --git a/emu-latin1.el b/emu-latin1.el index 0422a9c..e47ff64 100644 --- a/emu-latin1.el +++ b/emu-latin1.el @@ -248,6 +248,11 @@ find-file-hooks, etc. "Return number of columns a CHAR occupies when displayed." 1) +(defun split-char (character) + "Return list of charset and one or two position-codes of CHARACTER." + (cons (char-charset character) character) + ) + (defalias 'char-length 'char-bytes) (defmacro char-next-index (char index) diff --git a/emu-mule.el b/emu-mule.el index e3d1f88..8384501 100644 --- a/emu-mule.el +++ b/emu-mule.el @@ -361,6 +361,18 @@ but the contents viewed as characters do change. (defalias 'char-charset 'char-leading-char) +(defun split-char (character) + "Return list of charset and one or two position-codes of CHARACTER." + (let ((len (char-bytes character)) + (i 0) + dest) + (while (< i len) + (setq dest (cons (char-component character i) dest) + i (1+ i)) + ) + (cons (char-charset character) dest) + )) + (defmacro char-next-index (char index) "Return index of character succeeding CHAR whose index is INDEX." (` (+ (, index) (char-bytes (, char)))))