GUIUtilities.advanceProgress("Loading macros...");
propertiesChanged(); initRecent(); initPLAF();
	public static void main(String[] args)	{		// Yes, we want stdio to go to the log		Log.redirectStdio();		// Log some stuff		Log.log(Log.NOTICE,jEdit.class,"jEdit version " + getVersion());		// Parse command line		boolean endOpts = false;		boolean readOnly = false;		boolean reuseView = false;		settingsDirectory = MiscUtilities.constructPath(			System.getProperty("user.home"),".jedit");		String portFile = "server";		boolean defaultSession = true;		session = "default";		boolean showSplash = true;		for(int i = 0; i < args.length; i++)		{			String arg = args[i];			if(arg.startsWith("-") && !endOpts)			{				if(arg.equals("--"))					endOpts = true;				else if(arg.equals("-usage"))				{					version();					System.err.println();					usage();					System.exit(1);				}				else if(arg.equals("-version"))				{					version();					System.exit(1);				}				else if(arg.equals("-nosettings"))					settingsDirectory = null;				else if(arg.startsWith("-settings="))					settingsDirectory = arg.substring(10);				else if(arg.startsWith("-noserver"))					portFile = null;				else if(arg.startsWith("-server="))					portFile = arg.substring(8);				else if(arg.equals("-nosession"))					session = null;				else if(arg.startsWith("-session="))				{					session = arg.substring(9);					defaultSession = false;				}				else if(arg.equals("-nosplash"))					showSplash = false;				else if(arg.equals("-readonly"))					readOnly = true;				else if(arg.equals("-reuseview"))					reuseView = true;				else				{					System.err.println("Unknown option: "						+ arg);					usage();					System.exit(1);				}				args[i] = null;			}		}		Log.log(Log.DEBUG,jEdit.class,"Settings directory is "			+ settingsDirectory);		if(settingsDirectory != null && portFile != null)			portFile = MiscUtilities.constructPath(settingsDirectory,portFile);		else			portFile = null;		Log.log(Log.DEBUG,jEdit.class,"Port file is " + portFile);		if(session != null)			session = Sessions.createSessionFileName(session);		Log.log(Log.DEBUG,jEdit.class,"Session is " + session);		// Connect to server		String userDir = System.getProperty("user.dir");		if(portFile != null && new File(portFile).exists())		{			int port, key;			try			{				BufferedReader in = new BufferedReader(new FileReader(portFile));				port = Integer.parseInt(in.readLine());				key = Integer.parseInt(in.readLine());				in.close();				Socket socket = new Socket(InetAddress.getLocalHost(),port);				Writer out = new OutputStreamWriter(socket.getOutputStream());				out.write(String.valueOf(key));				out.write('\n');				if(!defaultSession && session != null)					out.write("session=" + session + "\n");				if(readOnly)					out.write("readonly\n");				if(reuseView)					out.write("reuseview\n");				out.write("parent=" + userDir + "\n");				out.write("--\n");				for(int i = 0; i < args.length; i++)				{					if(args[i] != null)					{						out.write(args[i]);						out.write('\n');					}				}				out.close();				System.exit(0);			}			catch(Exception e)			{				Log.log(Log.ERROR,jEdit.class,e);			}		}		// Show the kool splash screen		if(showSplash)			GUIUtilities.showSplashScreen();		// Get things rolling		initMisc();		GUIUtilities.advanceProgress("Loading default properties...");		initSystemProperties();		GUIUtilities.advanceProgress("Loading plugins...");		initPlugins();		GUIUtilities.advanceProgress("Loading user properties...");		initUserProperties();		GUIUtilities.advanceProgress("Loading tables and settings...");		initActions();		initModes();		initPLAF();		initKeyBindings();		propertiesChanged();		initRecent();		if(settingsDirectory != null)		{			GUIUtilities.advanceProgress("Loading history...");			String history = MiscUtilities.constructPath(				settingsDirectory,"history");			HistoryModel.loadHistory(history);		}		GUIUtilities.advanceProgress("Loading macros...");		SearchAndReplace.load();		Macros.init();		// Start plugins		GUIUtilities.advanceProgress("Starting plugins...");		JARClassLoader.initPlugins();		// Preload menu and tool bar models		GUIUtilities.advanceProgress("Loading GUI...");		GUIUtilities.loadMenuBarModel("view.mbar");		GUIUtilities.loadMenuModel("view.context");		if("on".equals(getProperty("view.showToolbar")))			GUIUtilities.loadToolBarModel("view.toolbar");		// Start server		if(portFile != null)			server = new EditServer(portFile);		// Load files specified on the command line		GUIUtilities.advanceProgress("Opening files...");		Buffer buffer = null;		for(int i = 0; i < args.length; i++)		{			if(args[i] == null)				continue;			buffer = openFile(null,userDir,args[i],readOnly,false);		}		if(buffer == null)		{			if(defaultSession)			{				if(session != null && "on".equals(getProperty("saveDesktop")))					buffer = Sessions.loadSession(session,true);			}			else				buffer = Sessions.loadSession(session,false);		}		if(buffer == null)			buffer = newFile(null);		GUIUtilities.advanceProgress("Creating initial view...");		// Create the view and hide the splash screen.		// Paranoid thread safety courtesy of Sun.		final Buffer _buffer = buffer;		SwingUtilities.invokeLater(new Runnable() {			public void run()			{				newView(null,_buffer);				GUIUtilities.hideSplashScreen();			}		});	}