From: morioka Date: Thu, 9 Apr 1998 00:21:36 +0000 (+0000) Subject: (char-next-index): New macro. X-Git-Tag: apel-7_6-char-next-index~2 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=d414170754dc3d6016cb12268d3eab08ed2d3650;p=elisp%2Fapel.git (char-next-index): New macro. --- diff --git a/emu-e19.el b/emu-e19.el index af1a841..f4f22ab 100644 --- a/emu-e19.el +++ b/emu-e19.el @@ -243,32 +243,37 @@ find-file-hooks, etc. ;;; @ character ;;; -(defun char-charset (chr) - "Return the character set of char CHR. -\[emu-e19.el; XEmacs 20 emulating function]" +(defun char-charset (char) + "Return the character set of char CHAR." (if (< chr 128) charset-ascii charset-latin-iso8859-1)) (defun char-bytes (char) - "Return number of bytes a character in CHAR occupies in a buffer. -\[emu-e19.el; MULE emulating function]" + "Return number of bytes a character in CHAR occupies in a buffer." 1) -(defalias 'char-length 'char-bytes) - -(defun char-columns (character) - "Return number of columns a CHARACTER occupies when displayed. -\[emu-e19.el]" +(defun char-width (char) + "Return number of columns a CHAR occupies when displayed." 1) -;;; @@ for old MULE emulation -;;; +(defmacro char-next-index (char index) + "Return index of character succeeding CHAR whose index is INDEX." + (` (1+ index))) -(defalias 'char-width 'char-columns) +;;; @@ Mule emulating aliases +;;; +;;; You should not use them. (defalias 'char-leading-char 'char-charset) +;;; @@ obsoleted aliases +;;; +;;; You should not use them. + +(defalias 'char-length 'char-bytes) +(defalias 'char-columns 'char-width) + ;;; @ string ;;; diff --git a/emu-e20.el b/emu-e20.el index 5eaafcf..6f51347 100644 --- a/emu-e20.el +++ b/emu-e20.el @@ -174,10 +174,9 @@ code conversion will not take place." ;;; @ character ;;; -(defalias 'char-length 'char-bytes) - -(defalias 'char-columns 'char-width) - +(defmacro char-next-index (char index) + "Return index of character succeeding CHAR whose index is INDEX." + `(+ index (char-bytes char))) ;;; @@ Mule emulating aliases ;;; @@ -190,6 +189,13 @@ TABLE defaults to the current buffer's category table." (category-set-mnemonics (char-category-set character)) ) +;;; @@ obsoleted aliases +;;; +;;; You should not use them. + +(defalias 'char-length 'char-bytes) +(defalias 'char-columns 'char-width) + ;;; @ string ;;; diff --git a/emu-mule.el b/emu-mule.el index c726ab9..eed2bd7 100644 --- a/emu-mule.el +++ b/emu-mule.el @@ -317,8 +317,15 @@ It must be symbol.") (defalias 'char-charset 'char-leading-char) -(defalias 'char-length 'char-bytes) +(defmacro char-next-index (char index) + "Return index of character succeeding CHAR whose index is INDEX." + (` (+ index (char-bytes char)))) + +;;; @@ obsoleted aliases +;;; +;;; You should not use them. +(defalias 'char-length 'char-bytes) (defalias 'char-columns 'char-width) diff --git a/emu-nemacs.el b/emu-nemacs.el index 0ded890..62826c8 100644 --- a/emu-nemacs.el +++ b/emu-nemacs.el @@ -314,7 +314,7 @@ find-file-hooks, etc. (defun char-charset (chr) "Return the character set of char CHR. -\[emu-nemacs.el; XEmacs 20 emulating function]" +\[emu-nemacs.el; MULE emulating function]" (if (< chr 128) charset-ascii charset-jisx0208)) @@ -324,21 +324,29 @@ find-file-hooks, etc. \[emu-nemacs.el; Mule emulating function]" (if (< chr 128) 1 2)) -(defalias 'char-length 'char-bytes) - -(defun char-columns (character) - "Return number of columns a CHARACTER occupies when displayed. +(defun char-width (char) + "Return number of columns a CHAR occupies when displayed. \[emu-nemacs.el]" - (if (< character 128) + (if (< char 128) 1 2)) -;;; @@ for Mule emulation +(defmacro char-next-index (char index) + "Return index of character succeeding CHAR whose index is INDEX." + (` (1+ index))) + +;;; @@ Old Mule emulating aliases ;;; +;;; You should not use them. (defalias 'char-leading-char 'char-charset) -(defalias 'char-width 'char-columns) +;;; @@ obsoleted aliases +;;; +;;; You should not use them. + +(defalias 'char-length 'char-bytes) +(defalias 'char-columns 'char-width) ;;; @ string diff --git a/emu-x20.el b/emu-x20.el index 32a0618..873bdc7 100644 --- a/emu-x20.el +++ b/emu-x20.el @@ -144,6 +144,10 @@ find-file-hooks, etc. ;;; @ character ;;; +(defmacro char-next-index (char index) + "Return index of character succeeding CHAR whose index is INDEX." + `(1+ index)) + ;;; @@ Mule emulating aliases ;;; ;;; You should not use them.