"""
Close_Blank_Buffers.py - A Jython macro for jEdit that
closes all open and non-dirty buffers that aren't existing
files. This is useful for situations where one deletes or
moves a directory containing a number of files open in jEdit.

Copyright (C) 2002 Ollie Rutherfurd <oliver@rutherfurd.net>

$Id: Close_Blank_Buffers.py 28 2003-03-25 22:40:28Z oliver $
"""

__version__ = '$Revision: 1.6 $'[11:-2]
__author__ = 'Ollie Rutherfurd'


def closeBlankBuffers(view):
	for b in jEdit.getBuffers():
		if b.isDirty() == 0 and b.isNewFile() == 1 and b.getLength() == 0:
			jEdit.closeBuffer(view, b)


if __name__ in ('__main__','main'):
	closeBlankBuffers(init.view)

# :indentSize=4:lineSeparator=\n:noTabs=false:tabSize=4:

