From 74a8825ef7a5605d9fadc459021f7fff35bbb61f Mon Sep 17 00:00:00 2001 From: morioka Date: Fri, 5 Jun 1998 14:13:28 +0000 Subject: [PATCH] (split-char): New function. --- emu-latin1.el | 5 +++++ emu-mule.el | 12 ++++++++++++ 2 files changed, 17 insertions(+) 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))))) -- 1.7.10.4