changeset 47620:d9332e0c9cb3

(Fminibufferp): Add an optional `buffer' argument.
author John Paul Wallington <jpw@pobox.com>
date Thu, 26 Sep 2002 09:59:44 +0000
parents a65ea08814e2
children 2e93b2eb38c8
files src/ChangeLog src/minibuf.c
diffstat 2 files changed, 17 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Thu Sep 26 08:04:18 2002 +0000
+++ b/src/ChangeLog	Thu Sep 26 09:59:44 2002 +0000
@@ -1,3 +1,7 @@
+2002-09-26  John Paul Wallington  <jpw@shootybangbang.com>
+
+	* minibuf.c (Fminibufferp): Add an optional `buffer' argument.
+
 2002-09-26  Kenichi Handa  <handa@etl.go.jp>
 
 	* xfaces.c (try_font_list): New arg PREFER_FACE_FAMILY.  If it is
--- a/src/minibuf.c	Thu Sep 26 08:04:18 2002 +0000
+++ b/src/minibuf.c	Thu Sep 26 09:59:44 2002 +0000
@@ -319,13 +319,22 @@
 }
 
 DEFUN ("minibufferp", Fminibufferp,
-       Sminibufferp, 0, 0, 0,
-       doc: /* Return t if the current buffer is a minibuffer.  */)
-     ()
+       Sminibufferp, 0, 1, 0,
+       doc: /* Return t if BUFFER is a minibuffer.
+No argument or nil as argument means use current buffer as BUFFER.*/)
+     (buffer)
+     Lisp_Object buffer;
 {
   Lisp_Object tem;
 
-  tem = Fmemq (Fcurrent_buffer (), Vminibuffer_list);
+  if (NILP (buffer))
+    buffer = Fcurrent_buffer ();
+  else if (STRINGP (buffer))
+    buffer = Fget_buffer (buffer);
+  else
+    CHECK_BUFFER (buffer);
+
+  tem = Fmemq (buffer, Vminibuffer_list);
   return ! NILP (tem) ? Qt : Qnil;
 }