From: Richard M. Stallman Date: Wed, 8 Sep 1999 07:56:20 +0000 (+0000) Subject: (Fbufsize): Accept an extra BUFFER parameter. X-Git-Tag: emacs-pretest-21.0.90~6834 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=95dccf758355eb3119d64f6ceabd70763ad8b1ff;p=emacs.git (Fbufsize): Accept an extra BUFFER parameter. --- diff --git a/src/editfns.c b/src/editfns.c index a12954a6ed7..ab96d6f70d0 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -427,13 +427,18 @@ Executes BODY just like `progn'.") 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,