# HG changeset patch # User Richard M. Stallman # Date 936777380 0 # Node ID 1cdab17df2b3059d4f319b87aa5fb3ff033e7b67 # Parent e1f5592218c14255bd20d6538b3aff33d0975a69 (Fbufsize): Accept an extra BUFFER parameter. diff -r e1f5592218c1 -r 1cdab17df2b3 src/editfns.c --- a/src/editfns.c Wed Sep 08 07:54:18 1999 +0000 +++ b/src/editfns.c Wed Sep 08 07:56:20 1999 +0000 @@ -427,13 +427,18 @@ return unbind_to (count, val); } -DEFUN ("buffer-size", Fbufsize, Sbufsize, 0, 0, 0, - "Return the number of characters in the current buffer.") - () +DEFUN ("buffer-size", Fbufsize, Sbufsize, 0, 1, 0, + "Return the number of characters in the current buffer.\n\ +If BUFFER, return the number of characters in that buffer instead.") + (buffer) + Lisp_Object buffer; { - Lisp_Object temp; - XSETFASTINT (temp, Z - BEG); - return temp; + if (NILP (buffer)) + return make_number (Z - BEG); + else { + CHECK_BUFFER (buffer, 1); + return make_number (BUF_Z (XBUFFER (buffer)) - BUF_BEG (XBUFFER (buffer))); + } } DEFUN ("point-min", Fpoint_min, Spoint_min, 0, 0, 0,