Karsten Hopp f10910
To: vim_dev@googlegroups.com
Karsten Hopp f10910
Subject: Patch 7.4.791
Karsten Hopp f10910
Fcc: outbox
Karsten Hopp f10910
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp f10910
Mime-Version: 1.0
Karsten Hopp f10910
Content-Type: text/plain; charset=UTF-8
Karsten Hopp f10910
Content-Transfer-Encoding: 8bit
Karsten Hopp f10910
------------
Karsten Hopp f10910
Karsten Hopp f10910
Patch 7.4.791
Karsten Hopp f10910
Problem:    The buffer list can be very long.
Karsten Hopp f10910
Solution:   Add an argument to ":ls" to specify the type of buffer to list.
Karsten Hopp f10910
            (Marcin Szamotulski)
Karsten Hopp f10910
Files:      runtime/doc/windows.txt, src/buffer.c, src/ex_cmds.h
Karsten Hopp f10910
Karsten Hopp f10910
Karsten Hopp f10910
*** ../vim-7.4.790/runtime/doc/windows.txt	2015-01-07 16:52:53.506792420 +0100
Karsten Hopp f10910
--- runtime/doc/windows.txt	2015-07-21 14:59:59.925184307 +0200
Karsten Hopp f10910
***************
Karsten Hopp f10910
*** 986,994 ****
Karsten Hopp f10910
  list of buffers. |unlisted-buffer|
Karsten Hopp f10910
  
Karsten Hopp f10910
  
Karsten Hopp f10910
! :files[!]					*:files*
Karsten Hopp f10910
! :buffers[!]					*:buffers* *:ls*
Karsten Hopp f10910
! :ls[!]		Show all buffers.  Example:
Karsten Hopp f10910
  
Karsten Hopp f10910
  			1 #h   "/test/text"		line 1 ~
Karsten Hopp f10910
  			2u     "asdf"			line 0 ~
Karsten Hopp f10910
--- 986,995 ----
Karsten Hopp f10910
  list of buffers. |unlisted-buffer|
Karsten Hopp f10910
  
Karsten Hopp f10910
  
Karsten Hopp f10910
! :files[!] [flags]				*:files*
Karsten Hopp f10910
! :buffers[!] [flags]				*:buffers* *:ls*
Karsten Hopp f10910
! :ls[!] [flags]
Karsten Hopp f10910
! 		Show all buffers.  Example:
Karsten Hopp f10910
  
Karsten Hopp f10910
  			1 #h   "/test/text"		line 1 ~
Karsten Hopp f10910
  			2u     "asdf"			line 0 ~
Karsten Hopp f10910
***************
Karsten Hopp f10910
*** 998,1005 ****
Karsten Hopp f10910
  		(the term "unlisted" is a bit confusing then...).
Karsten Hopp f10910
  
Karsten Hopp f10910
  		Each buffer has a unique number.  That number will not change,
Karsten Hopp f10910
! 		so you can always go to a specific buffer with ":buffer N" or
Karsten Hopp f10910
! 		"N CTRL-^", where N is the buffer number.
Karsten Hopp f10910
  
Karsten Hopp f10910
  		Indicators (chars in the same column are mutually exclusive):
Karsten Hopp f10910
  		u	an unlisted buffer (only displayed when [!] is used)
Karsten Hopp f10910
--- 999,1006 ----
Karsten Hopp f10910
  		(the term "unlisted" is a bit confusing then...).
Karsten Hopp f10910
  
Karsten Hopp f10910
  		Each buffer has a unique number.  That number will not change,
Karsten Hopp f10910
! 		thus you can always go to a specific buffer with ":buffer N"
Karsten Hopp f10910
! 		or "N CTRL-^", where N is the buffer number.
Karsten Hopp f10910
  
Karsten Hopp f10910
  		Indicators (chars in the same column are mutually exclusive):
Karsten Hopp f10910
  		u	an unlisted buffer (only displayed when [!] is used)
Karsten Hopp f10910
***************
Karsten Hopp f10910
*** 1014,1019 ****
Karsten Hopp f10910
--- 1015,1035 ----
Karsten Hopp f10910
  		    +	a modified buffer
Karsten Hopp f10910
  		    x   a buffer with read errors
Karsten Hopp f10910
  
Karsten Hopp f10910
+ 		[flags] can be a combination of the following characters,
Karsten Hopp f10910
+ 		which restrict the buffers to be listed:
Karsten Hopp f10910
+ 		     +   modified buffers
Karsten Hopp f10910
+ 		     -   buffers with 'modifiable' off
Karsten Hopp f10910
+ 		     =   readonly buffers
Karsten Hopp f10910
+ 		     a   active buffers
Karsten Hopp f10910
+ 		     u   unloaded buffers (overrides the "!")
Karsten Hopp f10910
+ 		     h   hidden buffers
Karsten Hopp f10910
+ 		     x   buffers with a read error
Karsten Hopp f10910
+ 		     %   current buffer
Karsten Hopp f10910
+ 		     #   alternate buffer
Karsten Hopp f10910
+ 		Combining flags means they are "and"ed together, e.g.:
Karsten Hopp f10910
+ 		     h+   hidden buffers which are modified
Karsten Hopp f10910
+ 		     a+   active buffers which are modified
Karsten Hopp f10910
+ 
Karsten Hopp f10910
  						*:bad* *:badd*
Karsten Hopp f10910
  :bad[d]	[+lnum] {fname}
Karsten Hopp f10910
  		Add file name {fname} to the buffer list, without loading it.
Karsten Hopp f10910
*** ../vim-7.4.790/src/buffer.c	2015-07-17 14:16:49.842596797 +0200
Karsten Hopp f10910
--- src/buffer.c	2015-07-21 14:59:08.989668192 +0200
Karsten Hopp f10910
***************
Karsten Hopp f10910
*** 2761,2767 ****
Karsten Hopp f10910
      for (buf = firstbuf; buf != NULL && !got_int; buf = buf->b_next)
Karsten Hopp f10910
      {
Karsten Hopp f10910
  	/* skip unlisted buffers, unless ! was used */
Karsten Hopp f10910
! 	if (!buf->b_p_bl && !eap->forceit)
Karsten Hopp f10910
  	    continue;
Karsten Hopp f10910
  	msg_putchar('\n');
Karsten Hopp f10910
  	if (buf_spname(buf) != NULL)
Karsten Hopp f10910
--- 2761,2780 ----
Karsten Hopp f10910
      for (buf = firstbuf; buf != NULL && !got_int; buf = buf->b_next)
Karsten Hopp f10910
      {
Karsten Hopp f10910
  	/* skip unlisted buffers, unless ! was used */
Karsten Hopp f10910
! 	if ((!buf->b_p_bl && !eap->forceit && !vim_strchr(eap->arg, 'u'))
Karsten Hopp f10910
! 		|| (vim_strchr(eap->arg, 'u') && buf->b_p_bl)
Karsten Hopp f10910
! 		|| (vim_strchr(eap->arg, '+')
Karsten Hopp f10910
! 			&& ((buf->b_flags & BF_READERR) || !bufIsChanged(buf)))
Karsten Hopp f10910
! 		|| (vim_strchr(eap->arg, 'a')
Karsten Hopp f10910
! 			 && (buf->b_ml.ml_mfp == NULL || buf->b_nwindows == 0))
Karsten Hopp f10910
! 		|| (vim_strchr(eap->arg, 'h')
Karsten Hopp f10910
! 			 && (buf->b_ml.ml_mfp == NULL || buf->b_nwindows != 0))
Karsten Hopp f10910
! 		|| (vim_strchr(eap->arg, '-') && buf->b_p_ma)
Karsten Hopp f10910
! 		|| (vim_strchr(eap->arg, '=') && !buf->b_p_ro)
Karsten Hopp f10910
! 		|| (vim_strchr(eap->arg, 'x') && !(buf->b_flags & BF_READERR))
Karsten Hopp f10910
! 		|| (vim_strchr(eap->arg, '%') && buf != curbuf)
Karsten Hopp f10910
! 		|| (vim_strchr(eap->arg, '#')
Karsten Hopp f10910
! 		      && (buf == curbuf || curwin->w_alt_fnum != buf->b_fnum)))
Karsten Hopp f10910
  	    continue;
Karsten Hopp f10910
  	msg_putchar('\n');
Karsten Hopp f10910
  	if (buf_spname(buf) != NULL)
Karsten Hopp f10910
*** ../vim-7.4.790/src/ex_cmds.h	2015-01-20 19:30:46.665275623 +0100
Karsten Hopp f10910
--- src/ex_cmds.h	2015-07-21 14:40:57.480043462 +0200
Karsten Hopp f10910
***************
Karsten Hopp f10910
*** 217,223 ****
Karsten Hopp f10910
  			NEEDARG|EXTRA|NOTRLCOM|CMDWIN,
Karsten Hopp f10910
  			ADDR_LINES),
Karsten Hopp f10910
  EX(CMD_buffers,		"buffers",	buflist_list,
Karsten Hopp f10910
! 			BANG|TRLBAR|CMDWIN,
Karsten Hopp f10910
  			ADDR_LINES),
Karsten Hopp f10910
  EX(CMD_bufdo,		"bufdo",	ex_listdo,
Karsten Hopp f10910
  			BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL,
Karsten Hopp f10910
--- 217,223 ----
Karsten Hopp f10910
  			NEEDARG|EXTRA|NOTRLCOM|CMDWIN,
Karsten Hopp f10910
  			ADDR_LINES),
Karsten Hopp f10910
  EX(CMD_buffers,		"buffers",	buflist_list,
Karsten Hopp f10910
! 			BANG|EXTRA|TRLBAR|CMDWIN,
Karsten Hopp f10910
  			ADDR_LINES),
Karsten Hopp f10910
  EX(CMD_bufdo,		"bufdo",	ex_listdo,
Karsten Hopp f10910
  			BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL,
Karsten Hopp f10910
***************
Karsten Hopp f10910
*** 526,532 ****
Karsten Hopp f10910
  			RANGE|NOTADR|ZEROR|BANG|FILE1|TRLBAR,
Karsten Hopp f10910
  			ADDR_LINES),
Karsten Hopp f10910
  EX(CMD_files,		"files",	buflist_list,
Karsten Hopp f10910
! 			BANG|TRLBAR|CMDWIN,
Karsten Hopp f10910
  			ADDR_LINES),
Karsten Hopp f10910
  EX(CMD_filetype,	"filetype",	ex_filetype,
Karsten Hopp f10910
  			EXTRA|TRLBAR|CMDWIN,
Karsten Hopp f10910
--- 526,532 ----
Karsten Hopp f10910
  			RANGE|NOTADR|ZEROR|BANG|FILE1|TRLBAR,
Karsten Hopp f10910
  			ADDR_LINES),
Karsten Hopp f10910
  EX(CMD_files,		"files",	buflist_list,
Karsten Hopp f10910
! 			BANG|EXTRA|TRLBAR|CMDWIN,
Karsten Hopp f10910
  			ADDR_LINES),
Karsten Hopp f10910
  EX(CMD_filetype,	"filetype",	ex_filetype,
Karsten Hopp f10910
  			EXTRA|TRLBAR|CMDWIN,
Karsten Hopp f10910
***************
Karsten Hopp f10910
*** 847,853 ****
Karsten Hopp f10910
  			RANGE|NOTADR|COUNT|TRLBAR,
Karsten Hopp f10910
  			ADDR_LINES),
Karsten Hopp f10910
  EX(CMD_ls,		"ls",		buflist_list,
Karsten Hopp f10910
! 			BANG|TRLBAR|CMDWIN,
Karsten Hopp f10910
  			ADDR_LINES),
Karsten Hopp f10910
  EX(CMD_move,		"move",		ex_copymove,
Karsten Hopp f10910
  			RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN|MODIFY,
Karsten Hopp f10910
--- 847,853 ----
Karsten Hopp f10910
  			RANGE|NOTADR|COUNT|TRLBAR,
Karsten Hopp f10910
  			ADDR_LINES),
Karsten Hopp f10910
  EX(CMD_ls,		"ls",		buflist_list,
Karsten Hopp f10910
! 			BANG|EXTRA|TRLBAR|CMDWIN,
Karsten Hopp f10910
  			ADDR_LINES),
Karsten Hopp f10910
  EX(CMD_move,		"move",		ex_copymove,
Karsten Hopp f10910
  			RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN|MODIFY,
Karsten Hopp f10910
*** ../vim-7.4.790/src/version.c	2015-07-21 10:57:35.379311166 +0200
Karsten Hopp f10910
--- src/version.c	2015-07-21 14:41:25.219779629 +0200
Karsten Hopp f10910
***************
Karsten Hopp f10910
*** 743,744 ****
Karsten Hopp f10910
--- 743,746 ----
Karsten Hopp f10910
  {   /* Add new patch number below this line */
Karsten Hopp f10910
+ /**/
Karsten Hopp f10910
+     791,
Karsten Hopp f10910
  /**/
Karsten Hopp f10910
Karsten Hopp f10910
-- 
Karsten Hopp f10910
"Women marry men hoping they will change. Men marry women hoping
Karsten Hopp f10910
they will not. So each is inevitably disappointed."
Karsten Hopp f10910
 - Einstein
Karsten Hopp f10910
Karsten Hopp f10910
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp f10910
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp f10910
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp f10910
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///