comparison src/editfns.c @ 177:6075d714658b r20-3b15

Import from CVS: tag r20-3b15
author cvs
date Mon, 13 Aug 2007 09:51:16 +0200
parents 15872534500d
children 3d6bfa290dbd
comparison
equal deleted inserted replaced
176:6866abce6aaf 177:6075d714658b
192 return make_string (str, len); 192 return make_string (str, len);
193 } 193 }
194 194
195 DEFUN ("string-to-char", Fstring_to_char, 1, 1, 0, /* 195 DEFUN ("string-to-char", Fstring_to_char, 1, 1, 0, /*
196 Convert arg STRING to a character, the first character of that string. 196 Convert arg STRING to a character, the first character of that string.
197 An empty string will return the constant `nil'.
197 */ 198 */
198 (str)) 199 (str))
199 { 200 {
200 struct Lisp_String *p; 201 struct Lisp_String *p;
201 CHECK_STRING (str); 202 CHECK_STRING (str);
202 203
203 p = XSTRING (str); 204 p = XSTRING (str);
204 if (string_length (p) != 0) 205 if (string_length (p) != 0)
205 return make_char (string_char (p, 0)); 206 return make_char (string_char (p, 0));
206 else /* #### Gag me! */ 207 else
207 return Qzero; 208 /* This used to return Qzero. That is broken, broken, broken. */
209 /* It might be kinder to signal an error directly. -slb */
210 return Qnil;
208 } 211 }
209 212
210 213
211 static Lisp_Object 214 static Lisp_Object
212 buildmark (Bufpos val, Lisp_Object buffer) 215 buildmark (Bufpos val, Lisp_Object buffer)