]> git.eshelyaron.com Git - emacs.git/commitdiff
(Fclear_string): New function.
authorRichard M. Stallman <rms@gnu.org>
Tue, 29 Jul 2003 17:36:52 +0000 (17:36 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 29 Jul 2003 17:36:52 +0000 (17:36 +0000)
(syms_of_fns): defsubr it.

src/fns.c

index 93ef4093b29597058aca2ff46045139fada6006d..9ee15ff4994f5f5699c807820d80a690915e6db9 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -2325,6 +2325,20 @@ ARRAY is a vector, string, char-table, or bool-vector.  */)
     }
   return array;
 }
+
+DEFUN ("clear-string", Fclear_string, Sclear_string,
+       1, 1, 0,
+       doc: /* Clear the contents of STRING.
+This makes STRING unibyte and may change its length.  */)
+     (string)
+     Lisp_Object string;
+{
+  int len = SBYTES (string);
+  bzero (SDATA (string), len);
+  STRING_SET_CHARS (string, len);
+  STRING_SET_UNIBYTE (string);
+  return Qnil;
+}
 \f
 DEFUN ("char-table-subtype", Fchar_table_subtype, Schar_table_subtype,
        1, 1, 0,
@@ -5659,6 +5673,7 @@ invoked by mouse clicks and mouse menu items.  */);
   defsubr (&Slax_plist_put);
   defsubr (&Sequal);
   defsubr (&Sfillarray);
+  defsubr (&Sclear_string);
   defsubr (&Schar_table_subtype);
   defsubr (&Schar_table_parent);
   defsubr (&Sset_char_table_parent);