*** runtime/doc/eval.txt.orig	2013-05-05 18:05:08.000000000 -0700
--- runtime/doc/eval.txt	2013-05-05 18:30:09.000000000 -0700
*************** atan2( {expr}, {expr})		Float   arc tang
*** 1693,1698 ****
--- 1693,1699 ----
  browse( {save}, {title}, {initdir}, {default})
  				String	put up a file requester
  browsedir( {title}, {initdir})	String	put up a directory requester
+ bufferlist()			List	list of buffers
  bufexists( {expr})		Number	TRUE if buffer {expr} exists
  buflisted( {expr})		Number	TRUE if buffer {expr} is listed
  bufloaded( {expr})		Number	TRUE if buffer {expr} is loaded
*************** browsedir({title}, {initdir})
*** 2137,2142 ****
--- 2138,2154 ----
  		When the "Cancel" button is hit, something went wrong, or
  		browsing is not possible, an empty string is returned.
  
+ bufferlist()						*bufferlist()*
+ 		Returns a List of buffers. Each list item is a dictionary with
+ 		the following entries:
+ 			num		buffer number.
+ 			name		full path to the file in the buffer.
+ 			listed		TRUE if the buffer is listed.
+ 			loaded		TRUE if the buffer is loaded.
+ 			hidden		TRUE if the buffer is hidden.
+ 			changed		TRUE if the buffer is modified.
+ 			changedtick	number of changes made to the buffer.
+ 
  bufexists({expr})					*bufexists()*
  		The result is a Number, which is non-zero if a buffer called
  		{expr} exists.
*** src/eval.c.orig	2013-05-05 16:53:45.000000000 -0700
--- src/eval.c	2013-05-05 18:28:39.000000000 -0700
*************** static void f_atan2 __ARGS((typval_T *ar
*** 478,483 ****
--- 478,484 ----
  #endif
  static void f_browse __ARGS((typval_T *argvars, typval_T *rettv));
  static void f_browsedir __ARGS((typval_T *argvars, typval_T *rettv));
+ static void f_bufferlist __ARGS((typval_T *argvars, typval_T *rettv));
  static void f_bufexists __ARGS((typval_T *argvars, typval_T *rettv));
  static void f_buflisted __ARGS((typval_T *argvars, typval_T *rettv));
  static void f_bufloaded __ARGS((typval_T *argvars, typval_T *rettv));
*************** static struct fst
*** 7860,7865 ****
--- 7861,7867 ----
      {"buffer_exists",	1, 1, f_bufexists},	/* obsolete */
      {"buffer_name",	1, 1, f_bufname},	/* obsolete */
      {"buffer_number",	1, 1, f_bufnr},		/* obsolete */
+     {"bufferlist",	0, 0, f_bufferlist},
      {"buflisted",	1, 1, f_buflisted},
      {"bufloaded",	1, 1, f_bufloaded},
      {"bufname",		1, 1, f_bufname},
*************** find_buffer(avar)
*** 8985,8990 ****
--- 8987,9028 ----
  }
  
  /*
+  * "bufferlist()" function
+  */
+     static void
+ f_bufferlist(argvars, rettv)
+     typval_T	*argvars;
+     typval_T	*rettv;
+ {
+     buf_T	*buf = NULL;
+     dict_T	*dict;
+ 
+     rettv->vval.v_number = FALSE;
+ 
+     if (rettv_list_alloc(rettv) == OK)
+     {
+ 	for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+ 	{
+ 	    dict = dict_alloc();
+ 	    if (dict == NULL)
+ 		return;
+ 
+ 	    dict_add_nr_str(dict, "num", buf->b_fnum, NULL);
+ 	    dict_add_nr_str(dict, "name", 0L, buf->b_ffname);
+ 	    dict_add_nr_str(dict, "listed", buf->b_p_bl, NULL);
+ 	    dict_add_nr_str(dict, "loaded", buf->b_ml.ml_mfp != NULL, NULL);
+ 	    dict_add_nr_str(dict, "changed", bufIsChanged(buf), NULL);
+ 	    dict_add_nr_str(dict, "changedtick", buf->b_changedtick, NULL);
+ 	    dict_add_nr_str(dict, "hidden",
+ 			    buf->b_ml.ml_mfp != NULL && buf->b_nwindows == 0,
+ 			    NULL);
+ 
+ 	    list_append_dict(rettv->vval.v_list, dict);
+ 	}
+     }
+ }
+ 
+ /*
   * "bufexists(expr)" function
   */
      static void
