Mercurial > hg > xemacs-beta
comparison lisp/tl/emu-x20.el @ 82:6a378aca36af r20-0b91
Import from CVS: tag r20-0b91
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:07:36 +0200 |
parents | 54cc21c15cbb |
children | 364816949b59 |
comparison
equal
deleted
inserted
replaced
81:ebca3d831cea | 82:6a378aca36af |
---|---|
2 | 2 |
3 ;; Copyright (C) 1995 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1995 Free Software Foundation, Inc. |
4 ;; Copyright (C) 1994,1995,1996 MORIOKA Tomohiko | 4 ;; Copyright (C) 1994,1995,1996 MORIOKA Tomohiko |
5 | 5 |
6 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp> | 6 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp> |
7 ;; Version: $Id: emu-x20.el,v 1.1.1.2 1996/12/21 20:50:48 steve Exp $ | 7 ;; Version: $Id: emu-x20.el,v 1.2 1997/01/23 05:29:40 steve Exp $ |
8 ;; Keywords: emulation, compatibility, Mule, XEmacs | 8 ;; Keywords: emulation, compatibility, Mule, XEmacs |
9 | 9 |
10 ;; This file is part of tl (Tiny Library). | 10 ;; This file is part of tl (Tiny Library). |
11 | 11 |
12 ;; This program is free software; you can redistribute it and/or | 12 ;; This program is free software; you can redistribute it and/or |
168 | 168 |
169 | 169 |
170 ;;; @ character | 170 ;;; @ character |
171 ;;; | 171 ;;; |
172 | 172 |
173 (defun char-bytes (chr) 1) | 173 ;(defun char-bytes (chr) 1) |
174 | 174 |
175 (defun char-length (character) | 175 ;(defun char-length (character) |
176 "Return number of elements a CHARACTER occupies in a string or buffer. | 176 ; "Return number of elements a CHARACTER occupies in a string or buffer. |
177 \[emu-x20.el]" | 177 ;\[emu-x20.el]" |
178 1) | 178 ; 1) |
179 | 179 |
180 (defun char-columns (character) | 180 ;(defun char-columns (character) |
181 "Return number of columns a CHARACTER occupies when displayed. | 181 ; "Return number of columns a CHARACTER occupies when displayed. |
182 \[emu-x20.el]" | 182 ;\[emu-x20.el]" |
183 (charset-columns (char-charset character)) | 183 ; (charset-columns (char-charset character)) |
184 ) | 184 ; ) |
185 | 185 |
186 ;;; @@ Mule emulating aliases | 186 ;;; @@ Mule emulating aliases |
187 ;;; | 187 ;;; |
188 ;;; You should not use them. | 188 ;;; You should not use them. |
189 | 189 |
190 (defalias 'char-width 'char-columns) | 190 ;(defalias 'char-width 'char-columns) |
191 | 191 |
192 (defalias 'char-leading-char 'char-charset) | 192 (defalias 'char-leading-char 'char-charset) |
193 | 193 |
194 (defun char-category (character) | 194 (defun char-category (character) |
195 "Return string of category mnemonics for CHAR in TABLE. | 195 "Return string of category mnemonics for CHAR in TABLE. |
204 | 204 |
205 | 205 |
206 ;;; @ string | 206 ;;; @ string |
207 ;;; | 207 ;;; |
208 | 208 |
209 (defun string-columns (string) | 209 ;(defun string-columns (string) |
210 "Return number of columns STRING occupies when displayed. | 210 ; "Return number of columns STRING occupies when displayed. |
211 \[emu-x20.el]" | 211 ;\[emu-x20.el]" |
212 (let ((col 0) | 212 ; (let ((col 0) |
213 (len (length string)) | 213 ; (len (length string)) |
214 (i 0)) | 214 ; (i 0)) |
215 (while (< i len) | 215 ; (while (< i len) |
216 (setq col (+ col (char-columns (aref string i)))) | 216 ; (setq col (+ col (char-columns (aref string i)))) |
217 (setq i (1+ i)) | 217 ; (setq i (1+ i)) |
218 ) | 218 ; ) |
219 col)) | 219 ; col)) |
220 | 220 |
221 (defalias 'string-width 'string-columns) | 221 ;(defalias 'string-width 'string-columns) |
222 | 222 |
223 (defun string-to-int-list (str) | 223 (defun string-to-int-list (str) |
224 (mapcar #'char-int str) | 224 (mapcar #'char-int str) |
225 ) | 225 ) |
226 | 226 |
227 (defalias 'sref 'aref) | 227 ;(defalias 'sref 'aref) |
228 | 228 |
229 (defun truncate-string (str width &optional start-column) | 229 ;(defun truncate-string (str width &optional start-column) |
230 "Truncate STR to fit in WIDTH columns. | 230 ; "Truncate STR to fit in WIDTH columns. |
231 Optional non-nil arg START-COLUMN specifies the starting column. | 231 ;Optional non-nil arg START-COLUMN specifies the starting column. |
232 \[emu-x20.el; Mule 2.3 emulating function]" | 232 ;\[emu-x20.el; Mule 2.3 emulating function]" |
233 (or start-column | 233 ; (or start-column |
234 (setq start-column 0)) | 234 ; (setq start-column 0)) |
235 (substring str start-column width) | 235 ; (substring str start-column width) |
236 ) | 236 ; ) |
237 | 237 |
238 | 238 |
239 ;;; @ end | 239 ;;; @ end |
240 ;;; | 240 ;;; |
241 | 241 |