comparison src/editfns.c @ 111779:141d3f14d8c3

Merge changes from emacs-23 branch
author Chong Yidong <cyd@stupidchicken.com>
date Sat, 27 Nov 2010 15:04:57 -0500
parents 6248bcadfd21 0e4f6aed76c8
children 417b1e4d63cd 7df2e30d72ec
comparison
equal deleted inserted replaced
111742:f026c8607795 111779:141d3f14d8c3
216 len = CHAR_STRING (XFASTINT (character), str); 216 len = CHAR_STRING (XFASTINT (character), str);
217 return make_string_from_bytes (str, 1, len); 217 return make_string_from_bytes (str, 1, len);
218 } 218 }
219 219
220 DEFUN ("byte-to-string", Fbyte_to_string, Sbyte_to_string, 1, 1, 0, 220 DEFUN ("byte-to-string", Fbyte_to_string, Sbyte_to_string, 1, 1, 0,
221 doc: /* Convert arg BYTE to a string containing that byte. */) 221 doc: /* Convert arg BYTE to a unibyte string containing that byte. */)
222 (Lisp_Object byte) 222 (Lisp_Object byte)
223 { 223 {
224 unsigned char b; 224 unsigned char b;
225 CHECK_NUMBER (byte); 225 CHECK_NUMBER (byte);
226 if (XINT (byte) < 0 || XINT (byte) > 255)
227 error ("Invalid byte");
226 b = XINT (byte); 228 b = XINT (byte);
227 return make_string_from_bytes (&b, 1, 1); 229 return make_string_from_bytes (&b, 1, 1);
228 } 230 }
229 231
230 DEFUN ("string-to-char", Fstring_to_char, Sstring_to_char, 1, 1, 0, 232 DEFUN ("string-to-char", Fstring_to_char, Sstring_to_char, 1, 1, 0,