# HG changeset patch # User Kenichi Handa # Date 1029848744 0 # Node ID 63f566c131d7c2c52869d7d8eca71ddf6055e37e # Parent 0498f08658eb5e5925785887b9e69eab508c681b (Finsert_byte): New function. (syms_of_editfns): Defsubr it. diff -r 0498f08658eb -r 63f566c131d7 src/editfns.c --- a/src/editfns.c Tue Aug 20 11:25:27 2002 +0000 +++ b/src/editfns.c Tue Aug 20 13:05:44 2002 +0000 @@ -2158,6 +2158,29 @@ return Qnil; } +DEFUN ("insert-byte", Finsert_byte, Sinsert_byte, 2, 3, 0, + doc: /* Insert COUNT (second arg) copies of BYTE (first arg). +Both arguments are required. +BYTE is a number of the range 0..255. + +If BYTE is 128..255 and the current buffer is multibyte, the +corresponding eight-bit character is inserted. + +Point, and before-insertion markers, are relocated as in the function `insert'. +The optional third arg INHERIT, if non-nil, says to inherit text properties +from adjoining text, if those properties are sticky. */) + (byte, count, inherit) + Lisp_Object byte, count, inherit; +{ + CHECK_NUMBER (byte); + if (XINT (byte) < 0 || XINT (byte) > 255) + args_out_of_range_3 (byte, make_number (0), make_number (255)); + if (XINT (byte) >= 128 + && ! NILP (current_buffer->enable_multibyte_characters)) + XSETFASTINT (byte, BYTE8_TO_CHAR (XINT (byte))); + Finsert_char (byte, count, inherit); +} + /* Making strings from buffer contents. */ @@ -4103,6 +4126,7 @@ defsubr (&Sinsert_and_inherit); defsubr (&Sinsert_and_inherit_before_markers); defsubr (&Sinsert_char); + defsubr (&Sinsert_byte); defsubr (&Suser_login_name); defsubr (&Suser_real_login_name);