Mercurial > emacs
diff src/editfns.c @ 108663:a224d29f3386
* url-util.el (url-unhex-string): Don't accidentally decode as latin-1.
* editfns.c (Fbyte_to_string): New function.
* NEWS: Add sections for Emacs-23.3.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Wed, 19 May 2010 11:23:53 -0400 |
parents | 3c55036637ec |
children | 81d65beb3ea5 |
line wrap: on
line diff
--- a/src/editfns.c Tue May 18 23:51:55 2010 -0400 +++ b/src/editfns.c Wed May 19 11:23:53 2010 -0400 @@ -220,6 +220,16 @@ return make_string_from_bytes (str, 1, len); } +DEFUN ("byte-to-string", Fbyte_to_string, Sbyte_to_string, 1, 1, 0, + doc: /* Convert arg BYTE to a string containing that byte. */) + (byte) + Lisp_Object byte; +{ + CHECK_NUMBER (byte); + unsigned char b = XINT (byte); + return make_string_from_bytes (&b, 1, 1); +} + DEFUN ("string-to-char", Fstring_to_char, Sstring_to_char, 1, 1, 0, doc: /* Convert arg STRING to a character, the first character of that string. A multibyte character is handled correctly. */) @@ -4686,6 +4696,7 @@ defsubr (&Sgoto_char); defsubr (&Sstring_to_char); defsubr (&Schar_to_string); + defsubr (&Sbyte_to_string); defsubr (&Sbuffer_substring); defsubr (&Sbuffer_substring_no_properties); defsubr (&Sbuffer_string);