Mercurial > emacs
comparison src/charset.c @ 55505:7abf0e14a59e
(Fget_unused_iso_final_char): Fix typos in docstring.
(Fchar_bytes, Fchar_width, Fstring_width, Fchar_direction, Fsplit_char)
(Fchar_charset): Make argument names match their use in docstring.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Mon, 10 May 2004 17:51:27 +0000 |
parents | dbd73534e01e |
children | f7711455b84f 4c90ffeb71c5 |
comparison
equal
deleted
inserted
replaced
55504:05e8ea84c376 | 55505:7abf0e14a59e |
---|---|
1 /* Basic multilingual character support. | 1 /* Basic multilingual character support. |
2 Copyright (C) 1995, 1997, 1998 Electrotechnical Laboratory, JAPAN. | 2 Copyright (C) 1995, 1997, 1998 Electrotechnical Laboratory, JAPAN. |
3 Licensed to the Free Software Foundation. | 3 Licensed to the Free Software Foundation. |
4 Copyright (C) 2001 Free Software Foundation, Inc. | 4 Copyright (C) 2001, 2004 Free Software Foundation, Inc. |
5 | 5 |
6 This file is part of GNU Emacs. | 6 This file is part of GNU Emacs. |
7 | 7 |
8 GNU Emacs is free software; you can redistribute it and/or modify | 8 GNU Emacs is free software; you can redistribute it and/or modify |
9 it under the terms of the GNU General Public License as published by | 9 it under the terms of the GNU General Public License as published by |
728 return Vgeneric_character_list; | 728 return Vgeneric_character_list; |
729 } | 729 } |
730 | 730 |
731 DEFUN ("get-unused-iso-final-char", Fget_unused_iso_final_char, | 731 DEFUN ("get-unused-iso-final-char", Fget_unused_iso_final_char, |
732 Sget_unused_iso_final_char, 2, 2, 0, | 732 Sget_unused_iso_final_char, 2, 2, 0, |
733 doc: /* Return an unsed ISO's final char for a charset of DIMENISION and CHARS. | 733 doc: /* Return an unused ISO's final char for a charset of DIMENSION and CHARS. |
734 DIMENSION is the number of bytes to represent a character: 1 or 2. | 734 DIMENSION is the number of bytes to represent a character: 1 or 2. |
735 CHARS is the number of characters in a dimension: 94 or 96. | 735 CHARS is the number of characters in a dimension: 94 or 96. |
736 | 736 |
737 This final char is for private use, thus the range is `0' (48) .. `?' (63). | 737 This final char is for private use, thus the range is `0' (48) .. `?' (63). |
738 If there's no unused final char for the specified kind of charset, | 738 If there's no unused final char for the specified kind of charset, |
1026 invalid_code_posints: | 1026 invalid_code_posints: |
1027 error ("Invalid code points for charset ID %d: %d %d", charset_id, c1, c2); | 1027 error ("Invalid code points for charset ID %d: %d %d", charset_id, c1, c2); |
1028 } | 1028 } |
1029 | 1029 |
1030 DEFUN ("split-char", Fsplit_char, Ssplit_char, 1, 1, 0, | 1030 DEFUN ("split-char", Fsplit_char, Ssplit_char, 1, 1, 0, |
1031 doc: /* Return list of charset and one or two position-codes of CHAR. | 1031 doc: /* Return list of charset and one or two position-codes of CH. |
1032 If CHAR is invalid as a character code, | 1032 If CH is invalid as a character code, |
1033 return a list of symbol `unknown' and CHAR. */) | 1033 return a list of symbol `unknown' and CH. */) |
1034 (ch) | 1034 (ch) |
1035 Lisp_Object ch; | 1035 Lisp_Object ch; |
1036 { | 1036 { |
1037 int c, charset, c1, c2; | 1037 int c, charset, c1, c2; |
1038 | 1038 |
1046 Fcons (make_number (c1), Fcons (make_number (c2), Qnil))) | 1046 Fcons (make_number (c1), Fcons (make_number (c2), Qnil))) |
1047 : Fcons (CHARSET_SYMBOL (charset), Fcons (make_number (c1), Qnil))); | 1047 : Fcons (CHARSET_SYMBOL (charset), Fcons (make_number (c1), Qnil))); |
1048 } | 1048 } |
1049 | 1049 |
1050 DEFUN ("char-charset", Fchar_charset, Schar_charset, 1, 1, 0, | 1050 DEFUN ("char-charset", Fchar_charset, Schar_charset, 1, 1, 0, |
1051 doc: /* Return charset of CHAR. */) | 1051 doc: /* Return charset of CH. */) |
1052 (ch) | 1052 (ch) |
1053 Lisp_Object ch; | 1053 Lisp_Object ch; |
1054 { | 1054 { |
1055 CHECK_NUMBER (ch); | 1055 CHECK_NUMBER (ch); |
1056 | 1056 |
1177 error ("Can't convert to unibyte character: %d", XINT (ch)); | 1177 error ("Can't convert to unibyte character: %d", XINT (ch)); |
1178 return make_number (c); | 1178 return make_number (c); |
1179 } | 1179 } |
1180 | 1180 |
1181 DEFUN ("char-bytes", Fchar_bytes, Schar_bytes, 1, 1, 0, | 1181 DEFUN ("char-bytes", Fchar_bytes, Schar_bytes, 1, 1, 0, |
1182 doc: /* Return 1 regardless of the argument CHAR. */) | 1182 doc: /* Return 1 regardless of the argument CH. */) |
1183 (ch) | 1183 (ch) |
1184 Lisp_Object ch; | 1184 Lisp_Object ch; |
1185 { | 1185 { |
1186 CHECK_NUMBER (ch); | 1186 CHECK_NUMBER (ch); |
1187 return make_number (1); | 1187 return make_number (1); |
1221 && BASE_LEADING_CODE_P (c)) \ | 1221 && BASE_LEADING_CODE_P (c)) \ |
1222 ? WIDTH_BY_CHAR_HEAD (c) \ | 1222 ? WIDTH_BY_CHAR_HEAD (c) \ |
1223 : 4)))) | 1223 : 4)))) |
1224 | 1224 |
1225 DEFUN ("char-width", Fchar_width, Schar_width, 1, 1, 0, | 1225 DEFUN ("char-width", Fchar_width, Schar_width, 1, 1, 0, |
1226 doc: /* Return width of CHAR when displayed in the current buffer. | 1226 doc: /* Return width of CH when displayed in the current buffer. |
1227 The width is measured by how many columns it occupies on the screen. | 1227 The width is measured by how many columns it occupies on the screen. |
1228 Tab is taken to occupy `tab-width' columns. */) | 1228 Tab is taken to occupy `tab-width' columns. */) |
1229 (ch) | 1229 (ch) |
1230 Lisp_Object ch; | 1230 Lisp_Object ch; |
1231 { | 1231 { |
1404 Width is measured by how many columns it occupies on the screen. | 1404 Width is measured by how many columns it occupies on the screen. |
1405 When calculating width of a multibyte character in STRING, | 1405 When calculating width of a multibyte character in STRING, |
1406 only the base leading-code is considered; the validity of | 1406 only the base leading-code is considered; the validity of |
1407 the following bytes is not checked. Tabs in STRING are always | 1407 the following bytes is not checked. Tabs in STRING are always |
1408 taken to occupy `tab-width' columns. */) | 1408 taken to occupy `tab-width' columns. */) |
1409 (str) | 1409 (string) |
1410 Lisp_Object str; | 1410 Lisp_Object string; |
1411 { | 1411 { |
1412 Lisp_Object val; | 1412 Lisp_Object val; |
1413 | 1413 |
1414 CHECK_STRING (str); | 1414 CHECK_STRING (string); |
1415 XSETFASTINT (val, lisp_string_width (str, -1, NULL, NULL)); | 1415 XSETFASTINT (val, lisp_string_width (string, -1, NULL, NULL)); |
1416 return val; | 1416 return val; |
1417 } | 1417 } |
1418 | 1418 |
1419 DEFUN ("char-direction", Fchar_direction, Schar_direction, 1, 1, 0, | 1419 DEFUN ("char-direction", Fchar_direction, Schar_direction, 1, 1, 0, |
1420 doc: /* Return the direction of CHAR. | 1420 doc: /* Return the direction of CH. |
1421 The returned value is 0 for left-to-right and 1 for right-to-left. */) | 1421 The returned value is 0 for left-to-right and 1 for right-to-left. */) |
1422 (ch) | 1422 (ch) |
1423 Lisp_Object ch; | 1423 Lisp_Object ch; |
1424 { | 1424 { |
1425 int charset; | 1425 int charset; |