closeBuffer(view,buffersFirst);  return buffersFirst;
path = MiscUtilities.getParentOfPath(view.getBuffer() .getPath()); VFS vfs = VFSManager.getVFSForPath(path);   if((vfs.getCapabilities() & VFS.WRITE_CAP) == 0) path = System.getProperty("user.home");
	public static Buffer newFile(View view, String dir)	{		// If only one new file is open which is clean, just close		// it, which will create an 'Untitled-1'		if(dir != null			&& buffersFirst != null			&& buffersFirst == buffersLast			&& buffersFirst.isUntitled()			&& !buffersFirst.isDirty())		{			closeBuffer(view,buffersFirst);			// return the newly created 'untitled-1'			return buffersFirst;		}		// Find the highest Untitled-n file		int untitledCount = 0;		Buffer buffer = buffersFirst;		while(buffer != null)		{			if(buffer.getName().startsWith("Untitled-"))			{				try				{					untitledCount = Math.max(untitledCount,						Integer.parseInt(buffer.getName()						.substring(9)));				}				catch(NumberFormatException nf)				{				}			}			buffer = buffer.next;		}		return openFile(view,dir,"Untitled-" + (untitledCount+1),true,null);	} //}}}