[jedit] 02/09: Imported Upstream version 5.2.0+dfsg

Tony Mancill tmancill at moszumanska.debian.org
Fri Oct 9 04:47:24 UTC 2015


This is an automated email from the git hooks/post-receive script.

tmancill pushed a commit to branch master
in repository jedit.

commit b1530f19585a4e746aa2db8cbe78fe73369f4f5b
Author: tony mancill <tmancill at debian.org>
Date:   Wed Sep 30 22:11:41 2015 -0700

    Imported Upstream version 5.2.0+dfsg
---
 .gitaccess                                         |  16 +
 README.SRC.txt                                     |  10 +-
 build.xml                                          | 180 ++++----
 doc/CHANGES.txt                                    | 333 ++++++---------
 doc/FAQ/faq-contrib.xml                            |   2 +-
 doc/FAQ/faq-general.xml                            |   4 +-
 doc/FAQ/faq-install.xml                            |   4 +-
 doc/FAQ/faq-intro.xml                              |   2 +-
 doc/FAQ/faq-macros.xml                             |   2 +-
 doc/FAQ/faq-plugins.xml                            |   2 +-
 doc/FAQ/faq-problems.xml                           |  41 +-
 doc/FAQ/faq-use.xml                                |  34 +-
 doc/FAQ/faq.xml                                    |   6 +-
 doc/README.txt                                     |   2 +-
 doc/releasing-jedit.txt                            | 185 +++-----
 doc/stylesheet.css                                 | 473 +++++++++++++++++++++
 doc/tips/tip17.html                                |   1 +
 doc/users-guide/activity-log.xml                   |   2 +-
 doc/users-guide/basics.xml                         | 134 +++---
 doc/users-guide/bsh-commands.xml                   |   2 +-
 doc/users-guide/conventions.xml                    |   2 +-
 doc/users-guide/customizing.xml                    |  74 +++-
 doc/users-guide/dialog-macro.xml                   |   4 +-
 doc/users-guide/files.xml                          |  15 +-
 doc/users-guide/globs.xml                          |   2 +-
 doc/users-guide/history.xml                        |   2 +-
 doc/users-guide/installing-modes.xml               |  12 +-
 doc/users-guide/launcher-guide.xml                 |   2 +-
 doc/users-guide/macro-basics.xml                   |   2 +-
 doc/users-guide/macro-index.xml                    |   2 +-
 doc/users-guide/macro-tips.xml                     |   2 +-
 doc/users-guide/plugin-implement.xml               |  51 ++-
 doc/users-guide/plugin-intro.xml                   |   6 +-
 doc/users-guide/plugin-tips.xml                    |  26 +-
 doc/users-guide/regexps.xml                        |   4 +-
 doc/users-guide/shortcuts.xml                      |   2 +-
 doc/users-guide/source-edit.xml                    |   2 +-
 doc/users-guide/starting.xml                       |  78 +++-
 doc/users-guide/text-edit.xml                      |  58 ++-
 doc/users-guide/updating-modes.xml                 |   2 +-
 doc/users-guide/users-guide.xml                    |  12 +-
 doc/users-guide/using-macros.xml                   |   2 +-
 doc/users-guide/using-plugins.xml                  |   2 +-
 doc/users-guide/writing-modes.xml                  |   2 +-
 doc/welcome.html                                   |   2 +-
 doc/whatsnew/news.xml                              |  49 +--
 installer/Install.java                             |   4 +-
 installer/InstallThread.java                       |  14 +
 installer/done-MacOS.html                          |   2 +-
 installer/done-Unix.html                           |   2 +-
 installer/done-VMS.html                            |   4 +-
 ivy.xml                                            |  21 +-
 ivysettings.xml                                    |   6 -
 jEdit.iml                                          |   1 +
 keymaps/jEdit_keys.props                           |   1 +
 macros/Editing/Go_to_Column.bsh                    |   8 +-
 macros/Editing/Go_to_Offset.bsh                    |  53 +++
 macros/Emacs/Emacs_Kill_Line.bsh                   |  72 +---
 macros/Misc/Generate Encodings List.bsh            |   6 +-
 macros/Misc/Generate Modes List.bsh                |   6 +-
 macros/Text/Reverse_Selection.bsh                  |  33 ++
 modes/catalog                                      |   6 +-
 modes/html.xml                                     | 133 ++----
 modes/powercenter_parameter_file.xml               |  37 ++
 .../jarbundler/AppBundleProperties.java            | 159 ++++++-
 net/sourceforge/jarbundler/DocumentType.java       |  45 +-
 net/sourceforge/jarbundler/HelpBook.java           |  16 +
 net/sourceforge/jarbundler/JarBundler.java         | 269 +++++++-----
 net/sourceforge/jarbundler/JavaProperty.java       |  16 +
 net/sourceforge/jarbundler/PropertyListWriter.java | 343 +++++++++------
 net/sourceforge/jarbundler/Service.java            |  56 ++-
 org/gjt/sp/jedit/Autosave.java                     |   5 +-
 org/gjt/sp/jedit/Buffer.java                       |  30 +-
 org/gjt/sp/jedit/Debug.java                        |  13 +-
 org/gjt/sp/jedit/EditPane.java                     |  24 +-
 org/gjt/sp/jedit/EditPlugin.java                   |   2 +-
 org/gjt/sp/jedit/EditServer.java                   |  18 +-
 org/gjt/sp/jedit/GUIUtilities.java                 |  43 +-
 org/gjt/sp/jedit/JARClassLoader.java               |  30 +-
 org/gjt/sp/jedit/JEditActionContext.java           |  20 +-
 org/gjt/sp/jedit/JEditActionSet.java               |  23 +-
 org/gjt/sp/jedit/Macros.java                       |  39 +-
 org/gjt/sp/jedit/MiscUtilities.java                |  85 ++--
 org/gjt/sp/jedit/Mode.java                         |  12 +-
 org/gjt/sp/jedit/OperatingSystem.java              |  30 +-
 org/gjt/sp/jedit/PluginJAR.java                    | 271 ++++++++----
 org/gjt/sp/jedit/Registers.java                    |  10 +-
 org/gjt/sp/jedit/ServiceManager.java               |  13 +-
 org/gjt/sp/jedit/View.java                         |  60 +--
 org/gjt/sp/jedit/browser/BrowserCommandsMenu.java  |  18 +-
 org/gjt/sp/jedit/browser/VFSBrowser.java           |  88 ++--
 .../sp/jedit/browser/VFSDirectoryEntryTable.java   |   8 +-
 .../jedit/browser/VFSDirectoryEntryTableModel.java |   6 +-
 org/gjt/sp/jedit/browser/VFSFileChooserDialog.java |   7 +-
 org/gjt/sp/jedit/buffer/JEditBuffer.java           |  75 ++--
 org/gjt/sp/jedit/buffer/LineManager.java           |   6 +-
 org/gjt/sp/jedit/bufferio/BufferLoadRequest.java   |  10 +-
 org/gjt/sp/jedit/bufferset/BufferSet.java          |  15 +-
 org/gjt/sp/jedit/gui/ActionBar.java                |   6 +-
 org/gjt/sp/jedit/gui/BufferSwitcher.java           | 291 ++++++++++++-
 org/gjt/sp/jedit/gui/CloseDialog.java              |  19 +-
 org/gjt/sp/jedit/gui/CompleteWord.java             |  20 +-
 org/gjt/sp/jedit/gui/ContextAddDialog.java         |   7 +-
 org/gjt/sp/jedit/gui/DockableWindowContainer.java  |   4 +-
 org/gjt/sp/jedit/gui/DockableWindowManager.java    |  15 +-
 .../sp/jedit/gui/DockableWindowManagerImpl.java    |  67 ++-
 org/gjt/sp/jedit/gui/EnhancedDialog.java           |  52 ++-
 org/gjt/sp/jedit/gui/ExtendedGridLayout.java       |  13 +-
 org/gjt/sp/jedit/gui/FilePropertiesDialog.java     |  22 +-
 org/gjt/sp/jedit/gui/FilesChangedDialog.java       |  30 +-
 org/gjt/sp/jedit/gui/FilteredListModel.java        |  10 +-
 org/gjt/sp/jedit/gui/GrabKeyDialog.java            |   8 +-
 org/gjt/sp/jedit/gui/JCheckBoxList.java            |   4 +-
 org/gjt/sp/jedit/gui/KeyEventTranslator.java       |  56 +--
 org/gjt/sp/jedit/gui/KeyEventWorkaround.java       |  33 +-
 org/gjt/sp/jedit/gui/LogViewer.java                |  70 ++-
 org/gjt/sp/jedit/gui/OptionsDialog.java            |  13 +-
 org/gjt/sp/jedit/gui/PanelWindowContainer.java     |  14 +-
 org/gjt/sp/jedit/gui/PasteFromListDialog.java      |   6 +-
 org/gjt/sp/jedit/gui/SplashScreen.java             | 200 ++++++---
 org/gjt/sp/jedit/gui/StatusBar.java                |   7 +-
 .../jedit/gui/statusbar/ErrorsWidgetFactory.java   |  18 +
 .../gui/statusbar/MultiSelectWidgetFactory.java    |   6 +-
 .../gui/statusbar/TaskMonitorWidgetFactory.java    |  32 +-
 org/gjt/sp/jedit/gui/tray/JTrayIconManager.java    |   6 +-
 org/gjt/sp/jedit/help/HelpHistoryModel.java        |  16 +-
 org/gjt/sp/jedit/help/HelpIndex.java               |  40 +-
 org/gjt/sp/jedit/help/HelpTOCPanel.java            |  13 +-
 org/gjt/sp/jedit/help/HelpViewer.java              |  86 +++-
 org/gjt/sp/jedit/help/HistoryButton.java           |  10 +-
 org/gjt/sp/jedit/icons/splash.png                  | Bin 65086 -> 65559 bytes
 org/gjt/sp/jedit/icons/themes/classic/loader.gif   | Bin 0 -> 673 bytes
 org/gjt/sp/jedit/icons/themes/tango/loader.gif     | Bin 0 -> 673 bytes
 org/gjt/sp/jedit/io/FavoritesVFS.java              |   8 +-
 org/gjt/sp/jedit/io/FileRootsVFS.java              |   8 +-
 org/gjt/sp/jedit/io/FileVFS.java                   |  24 +-
 org/gjt/sp/jedit/io/VFS.java                       |   7 +-
 org/gjt/sp/jedit/io/VFSFile.java                   |  10 +
 org/gjt/sp/jedit/io/VFSManager.java                |  22 +-
 org/gjt/sp/jedit/jEdit.java                        | 210 ++++-----
 org/gjt/sp/jedit/jedit.props                       |  19 +-
 org/gjt/sp/jedit/jedit_gui.props                   |  10 +-
 .../sp/jedit/menu/EnhancedCheckBoxMenuItem.java    |   2 +-
 org/gjt/sp/jedit/menu/EnhancedMenuItem.java        |   2 +-
 org/gjt/sp/jedit/menu/FavoritesProvider.java       |  17 +-
 org/gjt/sp/jedit/menu/MacrosProvider.java          |   6 +-
 org/gjt/sp/jedit/menu/PluginsProvider.java         |  32 +-
 org/gjt/sp/jedit/msg/PluginUpdate.java             |  54 ++-
 org/gjt/sp/jedit/options/AbbrevsOptionPane.java    |  12 +-
 org/gjt/sp/jedit/options/EditingOptionPane.java    |  19 +-
 org/gjt/sp/jedit/options/IconTheme.java            |   2 +-
 org/gjt/sp/jedit/options/IntegerInputVerifier.java |   2 +-
 org/gjt/sp/jedit/options/PluginOptions.java        |  25 +-
 org/gjt/sp/jedit/options/ShortcutsOptionPane.java  |  94 ++--
 .../sp/jedit/options/SyntaxHiliteOptionPane.java   |   8 +-
 org/gjt/sp/jedit/options/TextAreaOptionPane.java   |   9 +-
 org/gjt/sp/jedit/options/ToolBarOptionPane.java    |  18 +-
 org/gjt/sp/jedit/pluginmgr/InstallPanel.java       | 203 ++++++---
 org/gjt/sp/jedit/pluginmgr/ManagePanel.java        | 106 +++--
 org/gjt/sp/jedit/pluginmgr/PluginDetailPanel.java  |  51 ++-
 org/gjt/sp/jedit/pluginmgr/PluginList.java         |  42 +-
 org/gjt/sp/jedit/pluginmgr/PluginManager.java      |   6 +-
 org/gjt/sp/jedit/pluginmgr/Roster.java             |  41 +-
 org/gjt/sp/jedit/print/BufferPrintable.java        |  22 +-
 org/gjt/sp/jedit/print/BufferPrinter1_4.java       |   3 +-
 .../jeditresource/PluginResURLConnection.java      |  37 +-
 org/gjt/sp/jedit/search/AllBufferSet.java          |   7 +-
 .../sp/jedit/search/BoyerMooreSearchMatcher.java   |   6 +-
 org/gjt/sp/jedit/search/BufferListSet.java         |  11 +-
 .../sp/jedit/search/HyperSearchOperationNode.java  |  27 +-
 org/gjt/sp/jedit/search/HyperSearchRequest.java    |  18 +-
 org/gjt/sp/jedit/search/SearchAndReplace.java      |  11 +-
 org/gjt/sp/jedit/search/SearchDialog.java          |  11 +-
 org/gjt/sp/jedit/syntax/Chunk.java                 |  27 +-
 org/gjt/sp/jedit/syntax/KeywordMap.java            |  18 +-
 org/gjt/sp/jedit/syntax/ModeProvider.java          |   6 +-
 org/gjt/sp/jedit/syntax/TokenMarker.java           |   7 +-
 org/gjt/sp/jedit/textarea/AntiAlias.java           |   2 +-
 .../textarea/ElasticTabStopBufferListener.java     |   2 +-
 org/gjt/sp/jedit/textarea/ExtensionManager.java    |  10 +-
 org/gjt/sp/jedit/textarea/FirstLine.java           |   4 +-
 org/gjt/sp/jedit/textarea/Gutter.java              |   8 +-
 org/gjt/sp/jedit/textarea/JEditTextArea.java       |  69 ++-
 org/gjt/sp/jedit/textarea/MouseHandler.java        |  10 +-
 org/gjt/sp/jedit/textarea/ScrollLayout.java        | 327 ++++++++++----
 org/gjt/sp/jedit/textarea/SelectionManager.java    |   5 +-
 org/gjt/sp/jedit/textarea/StandaloneTextArea.java  |  12 +-
 org/gjt/sp/jedit/textarea/TextArea.java            | 233 ++++++----
 org/gjt/sp/jedit/textarea/TextAreaDropHandler.java |   5 +-
 org/gjt/sp/jedit/textarea/TextAreaPainter.java     |   9 +-
 org/gjt/sp/jedit/textarea/package.html             |   2 -
 org/gjt/sp/util/IOUtilities.java                   | 117 +----
 org/gjt/sp/util/Log.java                           |  21 +-
 org/gjt/sp/util/PropertiesBean.java                |  32 +-
 org/gjt/sp/util/StandardUtilities.java             |   4 +-
 org/gjt/sp/util/StringList.java                    |   6 +-
 org/gjt/sp/util/StringModel.java                   |   7 +-
 org/jedit/core/FileOpenerService.java              |   2 +-
 org/jedit/keymap/EmacsUtil.java                    | 393 +++++++++++++++++
 org/jedit/localization/jedit_cs.props              |   5 +-
 org/jedit/localization/jedit_de.props              |  39 +-
 org/jedit/localization/jedit_en.props              |  20 +-
 org/jedit/localization/jedit_fr.props              |   4 +-
 org/jedit/localization/jedit_ja.props              |   5 +-
 org/jedit/localization/jedit_ru.props              |   7 +-
 org/jedit/localization/jedit_zh.props              |   5 +-
 org/jedit/options/OptionGroupPane.java             |  12 +-
 org/jedit/options/PluginOptionGroup.java           |  26 +-
 org/jedit/options/TabbedOptionDialog.java          |   4 +-
 org/jedit/package.html                             |   5 +-
 package-files/linux/deb/control                    |   6 +-
 package-files/linux/deb/jedit.desktop              |   2 +-
 package-files/linux/jedit.1                        |   2 +-
 package-files/linux/slackware/slack-desc           |   2 +-
 package-files/osx/.background/background.png       | Bin 0 -> 159959 bytes
 package-files/osx/DS_Store                         | Bin 0 -> 15364 bytes
 package-files/osx/jedit                            | Bin 0 -> 18604 bytes
 package-files/windows/jedit.launch4j.xml           |  30 +-
 properties/README.txt                              |  11 +-
 startup/startup.bsh                                |  61 ++-
 220 files changed, 5211 insertions(+), 2915 deletions(-)

diff --git a/.gitaccess b/.gitaccess
new file mode 100644
index 0000000..63f235e
--- /dev/null
+++ b/.gitaccess
@@ -0,0 +1,16 @@
+ezust
+daleanson
+vanza
+jarekczek
+elberry
+shlomy
+jojaba_67
+rschwenn
+kpouer
+vampire0
+spestov
+kerik-sf
+thomasmey
+tanakahisateru
+evanpw
+k_satoda
diff --git a/README.SRC.txt b/README.SRC.txt
index e807af7..21d8306 100644
--- a/README.SRC.txt
+++ b/README.SRC.txt
@@ -19,15 +19,15 @@ General jEdit documentation can be found in the 'doc' directory.
  For building jEdit, the API documentation or any of the
  distribution files except of the source package:
 
-  - A Java compiler of at least version 1.6, such as Sun's javac
+  - A Java compiler of at least version 1.7, such as Oracle's javac
     which is included in the JDK. Get it from <http://www.java.com/download> or
-    from your package manager - e. g. sun-java6-jdk.
+    from your package manager - e. g. openjdk-7-jdk.
 
  For building the API documentation:
 
   - Sun's javadoc tool, which is included in the JDK.
     Get it from <http://www.java.com/download> or from your package
-    manager - e. g. sun-java6-jdk.
+    manager - e. g. sun-java7-jdk.
 
  For building the windows installer (for the final step):
 
@@ -36,10 +36,6 @@ General jEdit documentation can be found in the 'doc' directory.
     run via wine, a wine version of at least 1.3.10 is required because
     of a bug in earlier wine versions.
 
- For building the EXE launcher on Mac OS X:
-
-  - Rosetta. Get it from your installation DVD at "Optional Installs".
-
  For building the Mac OS X disk image (DMG) for easy distribution
  (for the final step):
 
diff --git a/build.xml b/build.xml
index 30f7fd5..f34934f 100644
--- a/build.xml
+++ b/build.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0"?>
 <project name="jedit"
 	 default="build"
 	 xmlns:mod="antlib:de.masters_of_disaster.ant.tasks"
@@ -15,12 +16,12 @@
 
 	<!-- Target Java Versions -->
 	<property name="target.java.version"
-		  value="1.6"/>
+		  value="1.7"/>
 	<property name="mac.target.java.version"
-		  value="1.6+"/>
+		  value="1.7+"/>
 	<!-- based on http://packages.slackverse.org/?v=1&p=92 -->
 	<property name="slackware.target.java.version"
-		  value="1_6_0_20-i586-1"/>
+		  value="1_7_0"/>
 
 	<!-- Various Paths -->
 	<property name="config.lib.dir"
@@ -107,7 +108,7 @@
 
 	<target name="init-ivy"
 		depends="init,download-ivy"
-		unless="${ivy.done}">
+		unless="ivy.done">
 		<property name="ivy.retrieve.pattern"
 			  value="${lib.dir}/[conf]/[artifact](-[classifier]).[ext]"/>
 		<taskdef resource="org/apache/ivy/ant/antlib.xml"
@@ -120,7 +121,7 @@
 	<target name="retrieve"
 		description="retrieve the dependencies"
 		depends="init,init-ivy"
-		unless="${ivy.done}">
+		unless="ivy.done">
 		<ivy:retrieve sync="true"/>
 		<ivy:retrieve pattern="${lib.dir}/ivy/[artifact]-[revision].[ext]"
 			      organisation="org.apache.ivy"
@@ -299,9 +300,9 @@
 				<include name="org/gjt/sp/jedit/buffer/LineManager.java"/>
 				<include name="org/gjt/sp/jedit/buffer/PositionManager.java"/>
 				<include name="org/gjt/sp/jedit/buffer/UndoManager.java"/>
-                
+
 				<include name="org/gjt/sp/jedit/bufferio/IoTask.java"/>
-                
+
 				<include name="org/gjt/sp/jedit/gui/KeyEventTranslator.java"/>
 				<include name="org/gjt/sp/jedit/gui/KeyEventWorkaround.java"/>
 				<include name="org/gjt/sp/jedit/gui/MutableListModel.java"/>
@@ -417,17 +418,15 @@
 		       compiler="modern"
 		       encoding="UTF-8"
 		       includeAntRuntime="false">
+			<classpath refid="classpath.compile"/>
 			<compilerarg line="${config.build.compilerarg}"/>
-            <classpath id="classpath.compile">
-				<fileset dir="${lib.dir}/compile"
-					 includes="*.jar"/>
-			</classpath>
 		</javac>
 	</target>
 
 	<target name="test"
 		depends="init,retrieve,compile,compile-test"
-		description="run unit tests">
+		description="run unit tests"
+		unless="skip.tests">
 		<delete dir="${build.dir}/test/raw-reports"/>
 		<mkdir dir="${build.dir}/test/raw-reports"/>
 		<junit printsummary="true"
@@ -505,6 +504,7 @@
 				</copy>
 			</contrib:then>
 		</contrib:if>
+		<antcall target="test" />
 	</target>
 
 	<target name="build-exe-launcher"
@@ -533,22 +533,29 @@
 		</contrib:if>
 		<contrib:switch value="${osfamily}">
 			<contrib:case value="windows">
-				<unzip src="${lib.dir}/launch4j/launch4j-win32.zip"
-				       dest="${build.dir}/"/>
+				<unjar src="${lib.dir}/launch4j/launch4j-workdir-win32.jar"
+				       dest="${build.dir}/launch4j"/>
+				<copy todir="${lib.dir}/launch4j">
+					<fileset dir="${build.dir}/launch4j/launch4j-3.5.0-workdir-win32/"/>
+				</copy>
 			</contrib:case>
 			<contrib:case value="unix">
-				<untar src="${lib.dir}/launch4j/launch4j-linux.tgz"
-				       dest="${build.dir}/"
-				       compression="gzip"/>
-				<chmod dir="${build.dir}/launch4j/bin/"
+				<unjar src="${lib.dir}/launch4j/launch4j-workdir-linux.jar"
+				       dest="${build.dir}/launch4j/"/>
+				<copy todir="${lib.dir}/launch4j">
+					<fileset dir="${build.dir}/launch4j/launch4j-3.5.0-workdir-linux/"/>
+				</copy>
+				<chmod dir="${lib.dir}/launch4j/bin"
 				       perm="+x"
 				       includes="**"/>
 			</contrib:case>
 			<contrib:case value="mac">
-				<untar src="${lib.dir}/launch4j/launch4j-macosx.tgz"
-				       dest="${build.dir}/"
-				       compression="gzip"/>
-				<chmod dir="${build.dir}/launch4j/bin/"
+				<unjar src="${lib.dir}/launch4j/launch4j-workdir-mac.jar"
+				       dest="${build.dir}/launch4j/"/>
+				<copy todir="${lib.dir}/launch4j">
+					<fileset dir="${build.dir}/launch4j/launch4j-3.5.0-workdir-mac/"/>
+				</copy>
+				<chmod dir="${lib.dir}/launch4j/bin"
 				       perm="+x"
 				       includes="**"
 				       osfamily="mac"/>
@@ -559,8 +566,12 @@
 		</contrib:switch>
 		<taskdef name="create"
 			 classname="net.sf.launch4j.ant.Launch4jTask"
-			 classpath="${build.dir}/launch4j/launch4j.jar"
-			 uri="antlib:net.sf.launch4j.ant"/>
+			 uri="antlib:net.sf.launch4j.ant">
+			<classpath>
+				<fileset dir="${lib.dir}/launch4j"
+					 includes="*.jar"/>
+			</classpath>
+		 </taskdef>
 		<launch4j:create configFile="${classes.dir}/package-files/windows/jedit.launch4j.xml"
 				 outfile="${jar.location}/jedit.exe"/>
 	</target>
@@ -639,6 +650,8 @@
 				<fileset dir="${lib.dir}/docbook"
 					 includes="*.jar"/>
 			</classpath>
+			<!-- ant 1.9 compatibility: explicitly set the processor to Saxon (see bug #3818) -->
+			<factory name="com.icl.saxon.TransformerFactoryImpl"/>
 			<xmlcatalog>
 				<entity publicid="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"
 					location="${build.dir}/docbook-xsl/docbook/html/chunk.xsl"/>
@@ -773,8 +786,7 @@
 				       includeAntRuntime="true">
 					<compilerarg line="${config.build.compilerarg}"/>
 				</javac>
-				<javadoc
-					 locale="en"
+				<javadoc locale="en"
 					 sourcepath="${basedir}"
 					 destdir="${classes.dir}/javadoc/api"
 					 packagenames="org.*"
@@ -792,19 +804,17 @@
 					 docencoding="UTF-8"
 					 charset="UTF-8">
 					<group title="jEdit 5 API"
-					       packages="org.jedit.*"/>					       
+					       packages="org.jedit.*"/>
 					<group title="jEdit 4 API"
-					       packages="org.gjt.*"/>
+					       packages="org.gjt.sp.*"/>
 					<group title="BeanShell"
 					       packages="org.gjt.sp.jedit.bsh*"/>
 					<tag name="todo" scope="all" description="To do:"/>
 					<tag name="example" scope="all" description="Example:"/>
-						<classpath>
-							<fileset dir="${classes.dir}/core/"
-								includes="*.class"/>
-							<fileset dir="${lib.dir}/compile"
-								includes="*.jar"/>
-						</classpath>
+					<classpath id="classpath.javadoc">
+						<path refid="classpath.compile"/>
+						<pathelement location="${classes.dir}/core"/>
+					</classpath>
 				</javadoc>
 			</contrib:else>
 		</contrib:if>
@@ -835,6 +845,9 @@
 				</tokenfilter>
 			</filterchain>
 		</copy>
+		<copy file="${basedir}/doc/stylesheet.css"
+		      todir="${jar.location}/doc/api"
+		      overwrite="true"/>
 	</target>
 
 	<target name="generate-pdf-users-guide"
@@ -946,8 +959,6 @@
 		       debuglevel="${config.build.debuglevel}"
 		       nowarn="${config.build.nowarn}"
 		       deprecation="${config.build.deprecation}"
-		       source="${target.java.version}"
-		       target="${target.java.version}"
 		       compiler="modern"
 		       encoding="UTF-8"
 		       includeAntRuntime="false">
@@ -1159,15 +1170,11 @@
 		       debuglevel="${config.build.debuglevel}"
 		       nowarn="${config.build.nowarn}"
 		       deprecation="${config.build.deprecation}"
-		       source="1.4"
-		       target="1.4"
+		       source="1.6"
+		       target="1.6"
 		       compiler="modern"
 		       encoding="UTF-8"
 		       includeAntRuntime="true">
-			<classpath>
-				<fileset dir="${lib.dir}/jarbundler"
-					 includes="*.jar"/>
-			</classpath>
 			<compilerarg line="${config.build.compilerarg}"/>
 		</javac>
 	</target>
@@ -1186,10 +1193,6 @@
 			 classname="net.sourceforge.jarbundler.JarBundler"
 			 classpath="${dist.dir}/classes/jarbundler"
 			 uri="antlib:net.sourceforge.jarbundler">
-			<classpath>
-				<fileset dir="${lib.dir}/jarbundler"
-					 includes="*.jar"/>
-			</classpath>
 		</taskdef>
 		<tstamp>
 			<format property="current.year"
@@ -1203,20 +1206,19 @@
 				   arguments="-background"
 				   build="${jedit.build.number}"
 				   bundleid="org.gjt.sp.jedit"
+				   developmentregion="English"
 				   extraclasspath="/System/Library/Java"
 				   icon="icons/icon.icns"
 				   infostring="jEdit ${jedit.version}, Copyright © 1998-${current.year} Contributors"
+				   copyright="Copyright © 1998-${current.year} Contributors"
 				   jvmversion="${mac.target.java.version}"
 				   shortname="jEdit"
 				   signature="JESP"
-				   stubfile="jedit"
-				   version="${jedit.version}">
-			<javaproperty name="apple.awt.antialiasing" value="true"/>
-			<javaproperty name="apple.awt.textantialiasing" value="true"/>
-			<javaproperty name="apple.laf.useScreenMenuBar" value="true"/>
-			<!-- Commented due https://sourceforge.net/tracker/?func=detail&atid=100588&aid=2820535&group_id=588 discussion -->
-			<!--javaproperty name="apple.awt.graphics.UseQuartz" value="true" />
-			<javaproperty name="apple.awt.rendering"          value="speed" /-->
+				   stubfile="package-files/osx/jedit"
+				   version="${jedit.version}"
+				   antialiasedgraphics="true"
+				   antialiasedtext="true"
+				   screenmenu="true">
 			<javafileset dir="${dist.dir}"
 				     includes="doc/**
 					       jars/**
@@ -1228,41 +1230,63 @@
 			<documenttype name="jEdit TEXT Document"
 				      extensions="*"
 				      ostypes="TEXT ****"
+				      utis="public.text"
 				      iconfile="icons/file.icns"
 				      role="Editor"/>
-			<service message="openFile"
-				 menuitem="jEdit/Open Files"
-				 sendtypes="NSStringPboardType,NSFilenamesPboardType"/>
-			<service message="insertSelection"
-				 menuitem="jEdit/Insert Text"
-				 sendtypes="NSStringPboardType"/>
-			<service message="openSelection"
-				 menuitem="jEdit/New Buffer with Text"
-				 sendtypes="NSStringPboardType"/>
 		</jarbundler:create>
-		<delete file="${dist.dir}/classes/mac/jEdit.app/Contents/MacOS/jedit" />
-		<exec executable="ln"
-		      failonerror="true">
-			<arg value="-s" />
-			<arg file="/System/Library/Frameworks/JavaVM.framework/Resources/MacOS/JavaApplicationStub" />
-			<arg file="${dist.dir}/classes/mac/jEdit.app/Contents/MacOS/jedit" />
-		</exec>
-		<delete file="${dist.dir}/${mac.disk.image.filename}"
-			failonerror="false"/>
+		<delete failonerror="false">
+			<fileset dir="${dist.dir}"
+				 includes="*${mac.disk.image.filename}"/>
+		</delete>
 		<exec executable="hdiutil"
 		      failonerror="true">
 			<arg value="create"/>
-			<arg value="-quiet"/>
 			<arg value="-volname"/>
-			<arg value="jEdit ${jedit.version}"/>
+			<arg value="jEdit"/>
 			<arg value="-srcfolder"/>
 			<arg file="${dist.dir}/classes/mac/jEdit.app"/>
-			<arg file="${dist.dir}/${mac.disk.image.filename}"/>
+			<arg value="-srcfolder"/>
+			<arg file="package-files/osx/.background"/>
+			<arg file="${dist.dir}/orig-${mac.disk.image.filename}"/>
+		</exec>
+		<exec executable="hdiutil"
+		      failonerror="true">
+			<arg value="convert"/>
+			<arg file="${dist.dir}/orig-${mac.disk.image.filename}"/>
+			<arg value="-format"/>
+			<arg value="UDRW"/>
+			<arg value="-o"/>
+			<arg file="${dist.dir}/udrw-${mac.disk.image.filename}"/>
+		</exec>
+		<exec executable="hdiutil"
+		      failonerror="true">
+			<arg value="attach"/>
+			<arg file="${dist.dir}/udrw-${mac.disk.image.filename}"/>
+		</exec>
+		<exec executable="ln"
+		      failonerror="true">
+			<arg value="-sF" />
+			<arg file="/Applications" />
+			<arg file="/Volumes/jEdit/ " />
+		</exec>
+		<copy file="package-files/osx/DS_Store"
+		      tofile="/Volumes/jEdit/.DS_Store"
+		      overwrite="true"/>
+		<exec executable="hdiutil"
+		      failonerror="true">
+			<arg value="detach"/>
+			<arg file="/Volumes/jEdit"/>
+			<arg value="-force"/>
 		</exec>
 		<exec executable="hdiutil"
 		      failonerror="true">
-			<arg value="internet-enable"/>
-			<arg value="-quiet"/>
+			<arg value="convert"/>
+			<arg file="${dist.dir}/udrw-${mac.disk.image.filename}"/>
+			<arg value="-format"/>
+			<arg value="UDZO"/>
+			<arg value="-imagekey"/>
+			<arg value="zlib-level=9"/>
+			<arg value="-o"/>
 			<arg file="${dist.dir}/${mac.disk.image.filename}"/>
 		</exec>
 		<property name="wipe.dist.files"
@@ -1297,6 +1321,7 @@
 					       icons/file.icns
 					       icons/icon.icns
 					       org/gjt/sp/jedit/jEdit.java
+					       package-files/osx/**
 					       ${config.dist.dir}/${jar.filename}
 					       ${config.dist.dir}/classes/jarbundler/**
 					       ${config.dist.dir}/doc/**
@@ -2061,6 +2086,7 @@ Press Return key to continue...
 									  negate="true"/>
 							</and>
 							<filename name="classes/**"/>
+							<filename name="*-${mac.disk.image.filename}"/>
 						</or>
 					</fileset>
 				</delete>
diff --git a/doc/CHANGES.txt b/doc/CHANGES.txt
index db1434f..1fb826b 100644
--- a/doc/CHANGES.txt
+++ b/doc/CHANGES.txt
@@ -1,286 +1,213 @@
-jEdit 5.1 version history
-       (changes since jEdit 5.0.0)
+jEdit 5.2 version history
+       (changes since jEdit 5.1.0)
 :encoding=UTF-8:
 
-{{{ Version 5.1.0
+{{{ Version 5.2.0
 
-Thanks to Alan Ezust, Matthieu Casanova, and Björn "Vampire" Kautler
-for contributing to this release.
+Thanks to Björn "Vampire" Kautler, Makarius, Dale Anson, Alan Ezust,
+Matt Galligan, Eric Le Lay, Makarius, and Matthieu Casanova for contributing to
+this release.
 
-{{{ UI improvements
-
-- The column titles were missing in shortcuts option pane
-  (#3614404 Matthieu Casanova)
-
-- Made TextArea thick caret thicker, and also thick when in overwrite mode.
-  (#3614784 Alan Ezust)
-
-- Added a new column "ActionSet" in Shortcuts option pane to know
-  to which actionSet an action belongs (feature #3614386 Matthieu Casanova)
+{{{ Bug Fixes
 
-}}}
-
-}}}
+- EnhancedDialog does not throw NullPointerExceptions anymore when checking
+  whether a pressed key is the buffer close shortcut. (Björn "Vampire" Kautler)
 
-{{{ Version 5.1pre1
+- When using extra vertical line spacing and a selection foreground color, the
+  selected text was painted twice, once with the extra spacing, once without.
+  Now the selected text is drawn correctly. (Björn "Vampire" Kautler)
 
-Thanks to Björn "Vampire" Kautler, Jarek Czekalski, Thomas Meyer,
-Matthieu Casanova, cnvince, Alan Ezust, Malathi, Vladimir Avdonin, Eric Le Lay,
-Darien Brown, Steve snarum-micron, EdorFaus, Brian Clapper, Uwe Stöhr,
-Marc Häfner, stone1343, Richard The, Dale Anson, Benjamin Gmurczyk,
-Makarius, Marco Hunsicker, and Maik Nijhuis for contributing to this release.
+- Make the TextArea a JPanel instead of a JComponent, so that it draws its
+  background and set the background color to the Gutter background color. This
+  prevents the parent component to shine through, which would e. g. show blue
+  edges with the BufferTabs plugin installed and active.
+  (Björn "Vampire" Kautler)
 
-{{{ Bug fixes
+- Fix a bug preventing from removing an unloaded plugin
+  (#3877 - Matthieu Casanova)
 
-- The contextInsensitive flag of the edit mode was not used at the first use
-  of the edit mode (Matthieu Casanova)
+- The native splashscreen is removed as it was not possible to disable it
+  (#3876 - Matthieu Casanova)
 
-- Fix mode loading for temporary buffers (patch #3609469 Thomas Meyer)
+- Bugfix in EditPane.java related to file status checks.
+  (Patch #534 - Matt Galligan)
 
-- Fix #3598661 - Don't allow negative values in the general option pane.
-  (Thomas Meyer)
+- Fix for bug #3389 in BufferSwitcher.java where look and feel was locked to
+  Metal. (Dale Anson)
 
-- Fix #3596215 - NPE from docking layout save/loads when started with
-  -nosettings. (Alan Ezust)
+- Fix for bug #3893 where PluginResURLConnection.openStream returning null for
+  non existing resources made jEdit hang on Java 8, Mac OS 10.10. (Eric Le Lay)
 
-- Fix #3597101, #3596600 - Bad error handling when an invalid path is entered
-  into the VFS Browser inputs. (Patch# 3602318 Benjamin Gmurczyk)
+- Fix for Bugs #3895, #3897: Invalid HelpIndex URLs on windows.
+  (Alan Ezust,  Eric Le Lay)
 
-- Bug no. #3590540 revealed a performance problem in the ChunkCache, because
-  every scroll action resulted in a tokenization of the really long line, which
-  takes a considerable time and makes jEdit unusable.
-  Fix is to always keep all Chunks of the tokenization process and use it as an
-  buffer in the ChunkCache class.
-  Tokenization of the physical line still happens for every insertion or
-  deletion of the Buffer. Tokenization also happens when the cursor enters the
-  physical line, as only the Chunks from the current physical line are keeped
-  in the ChunkCache.
-  (#3590540 Thomas Meyer)
-
-- Bug no. #3590540 produced a soft wrap for a single physical line that was
-  greater than 16383 screen lines. Increased this limit to 65535 in
-  the ScreenLineManager (#3590540 Thomas Meyer)
-
-- Fixed Insert_Selection macro when the selection is empty (#3596616
-  Matthieu Casanova)
+}}}
+{{{ Miscellaneous
+- MiscUtilities.openInDesktop() works with URIs on Windows now. (Alan Ezust)
 
-- fixed bug when pressing down if the is no selection (#3599630
-  Matthieu Casanova)
+- Upgrade Launch4J to the latest version 3.5.0. This makes it possible to UTF-8
+  encode the config file and build the EXE launcher on Mac OS again, removing
+  the need for Rosetta being installed, which is not supported anymore anyway
+  since Mac OS 10.7. (Björn "Vampire" Kautler)
 
-- Fixed macros cut lines and copy lines when the buffer is empty (#3596612
-  Matthieu Casanova)
+}}}
+{{{ API Changes
 
-- Fixed negative values used in recent file history count (#3598661 Matthieu
-  Casanova)
+- DockableWindowContainer interface is now public (Patch #528 - Makarius)
 
-- Fixed Run script macro when the file is empty (#3596609 Matthieu
-  Casanova)
+- PluginResURLConnection.openStream() is garanteed to return non-null stream;
+  PluginResURLConnection.connect() and PluginResURLConnection.openStream()
+  throw an IOException when the resource is not found. (Eric Le Lay)
 
-- Fixed Get_Class_Name macro when the file is empty (#3596752 Matthieu
-  Casanova)
+}}}
+{{{ Editing
 
-- Re-added missing OS/2 support code. (#3589903 Alan Ezust)
 
-- Added missing localization string:
-  options.plugin-manager.list-cache.minutes (#3574373 Matthieu Casanova)
+}}}
 
-- Fix AutoSave exception after multiline cut (#3017650 Thomas Meyer)
+}}}
 
-- Undomanager: Don't compact significant edits (#patch 3560615 Thomas Meyer)
+{{{ Version 5.2pre1
 
-- Fixed undo after replace all with beanshell only first occurance
-  (#3551910 Thomas Meyer)
+Thanks to Björn "Vampire" Kautler, Matthieu Casanova, Dale Anson, Thomas Meyer,
+Patrick Eibl, László Schmidt, Zsombor Franczia, Bence Pintér, Makarius,
+Benjamin Zengin, Yihua Zhang, Marc Häfner, EdorFaus, Jordan Miner,
+Thiemo Kellner, Tim Blackler, Alan Ezust, and Eric Le Lay for contributing to
+this release.
 
-- Search all buffers now observes current BufferSet scope and can be restricted
-  to the current view's buffers when scope is not global. (#3423442 Alan Ezust)
+{{{ Bug Fixes
 
-- Fix File status checking after buffer switch (#1871440 Alan Ezust)
+- Fix for bug #3843: Russian localization breaks Search dialog
 
-- Undo restores selection state in simple cases (deletions, replaces
-  on simple range selections). (patch #1570553 Maik Nijhuis, Thomas Meyer,
-  Jarek Czekalski)
+- Fixed Whole word search (bug #3824, patch #516 - Benjamin Zengin)
 
-- Filter not synchronizing in search dialog when
-  "All buffers" is selected. (#1646584, patch #3549905 Eric Le Lay)
+- Fixed the systray not added on EDT thread (Matthieu Casanova)
 
-- Fixed VFS session not ended in VFS.copy() api (#3522406 Matthieu Casanova)
+- Fix the integration with Unity and other Linux Desktop Environments,
+  broken by patch #464 (Björn "Vampire" Kautler)
 
-- Use of a scrollable list for delete dialog confirmation
-  (#2911520 Matthieu Casanova)
+- Reload optionally dependent plugins when a plugin is unloaded.
+  (bug #3807 - Dale Anson)
 
-- Fix selecting mode based on exact filename match. (#3562935 Dale Anson)
+- Applied patch #513 (Makarius), plus some additional cleanup of setting
+  the look and feel (Dale Anson)
 
-- Fix old modes/catalog entries clutter properties. (#3533751 Eric Le Lay)
-  [Merged into 5.0.x]
+- Fixed a bug in pluginmanager: transitive deps not installed when filtering
+  (bug #3825 - Eric Le Lay)
 
-- When checking a box to select a plugin to install, the description was
-  appearing and immediately disappearing. (#3398605 Dale Anson)
+- Fix java installer bug: Installing from jedit5.1.0install.jar failure
+  (bug #3837 - Eric Le Lay)
 
-- Fix Exception when clicking Find orphan when disabled plugins (#2940864 Eric
-  Le Lay)
+- HelpIndex includes .txt files again. (Bug #3896 - Alan Ezust)
 
 }}}
 {{{ API Changes
 
-- TaskManager: Refactor io task - New class IoTask, a subclass of Task
-  Remove the code of the io special case in TaskManager (Thomas Meyer)
-
-- Make SearchMatcher interrupttible (Thomas Meyer)
-  1.) API change: let SearchMatcher.nextMatch() throw InterruptedException
-  2.) BoyerMooreSearchMatcher: Switch to the new API and react on thread
-      interruption
-
-- HyperSearch: Make search interruptible even when in VFS.listFiles():
-  New method TaskManager.cancelTasksByClass(): Interrupt all currently running
-  Tasks of the given type. (Thomas Meyer)
-
-- Deprecated extra overloads of IOUtilities.closeQuietly() in favor of
-  using Java5 closeQuietly(Closeable) instead. (Alan Ezust)
-
-- New class: OneTimeMigrationStep, for adding property migration services
-  (used by fix for #1871440 Alan Ezust)
-
-- New method VFSBrowser.getLastVisitedPath() (Jarek Czekalski)
+- jEdit now depends on Java 1.7
 
-- New method IOUtilities.closeQuietly(ObjectInput) (Matthieu Casanova)
+- StandardUtilities.objectsEqual() is deprecated as Objects.equals() does the
+  same job in Java 7 (Matthieu Casanova)
 
-- New method IOUtilities.closeQuietly(ObjectOutput) (Matthieu Casanova)
+- New method: VFSFile.getModified() which allows sorting by date in the FSB
+  for other VFSs (plugin patch #161 Yihua Zhang)
 
-- New method GUIUtilities.setAutoMnemonic(AbstractButton) (Jarek Czekalski)
+- GUIUtilities.getShortcutLabel() has a second boolean argument to specify
+  whether platform modifier symbols are desired or not. (patch #514 Makarius)
 
-- New method: View.getBuffers(), aware of bufferset scope. (Alan Ezust)
+- Removed deprecated (ambiguous) overloads of IOUtilities.closeQuietly().
 
-- Removed View.setBuffer(Buffer, boolean, boolean) and
-  View.setBuffer(Buffer, boolean): methods that had disableFileCheck flag in
-  since View no longer checks file status there. (#1871440 Alan Ezust)
+- View.getBuffers() returns an array that is now sorted according to View
+  option. (Alan Ezust)
 
-- AllBufferSet.AllBufferSet(String glob, View v) - additional required
-  argument for View in constructor argument list. (#3423442 Alan Ezust)
-
-- Removed classes: IOProgressMonitor, WorkRequest, WorkThreadPool,
-  WorkThreadProgressListener (Thomas Meyer)
-
-- Removed VFSManager.getIOThreadPool() (Thomas Meyer)
-
-- Converted BufferIORequest, VFSFileChooserDialog.GetFileTypeRequest and
-  TextAreaTransferHandler.DraggedURLLoader to a Task (Thomas Meyer)
-
-- Converted TaskManager to an enum singelton (Thomas Meyer)
-
-- Changed VFSManager.runInWorkThread(Runnable) to
-  VFSManager.runInWorkThread(Task) and made it accept only IO tasks
-
-- New class: AwtRunnableQueue (Thomas Meyer)
+- New status "REMOVED" added to PluginUpdate message. (Dale Anson)
 
 }}}
-{{{ Editing
-
-- Fixed bug in ruby multiline comments (Patch#3605738 fixing bug #3605168
-  Richard The)
-
-- Fixed shellscript highlight (patch #3602461 fixing bug #3594428 Richard The)
-
-- Updated lua mode file (patch #2126692 stone1343)
-
-- Macros move lines up/down now keep the current selection (feature #3600082
-  Matthieu Casanova)
-
-- Updated nsis2 mode (#3586538 Uwe Stöhr)
-
-- There is now a new encoding Native2ASCII which collapses unicode
-  escapes in ISO-8859-1 files on read and expands characters that cannot be
-  encoded with ASCII as unicode escapes on write. This encoding is the one Java
-  properties files should be in. (Björn "Vampire" Kautler)
+{{{ UI improvements
 
-- Highlight entity references in xml attributes (#3559971 Eric Le Lay)
+- Relative line offsets are allowed in "Goto Line" dialog. (Patch #526,
+  Feature Request #286, Tim Blackler)
 
-- Added highlight of chapter title in rfc edit mode (Matthieu Casanova)
+- OptionsDialog now remembers and restores the last selected pane
+  under more circumstances. See Project Options Dialog for example.
+  (Alan Ezust)
 
-- Fixed shellscript do escape single quote with backslash
-  (#3557453 Matthieu Casanova)
+- KP_ARROW keys now behave the same way as the regular arrow keys,
+  with modifiers, on all platforms. (startup/startup.bsh:100 - Alan Ezust)
 
-- Updated ColdFusion mode (#3518536, #3561048 Darien Brown)
+- Focus the text area when scroll bar is clicked (patch #521 - Jordan Miner)
 
-- Updated Verilog mode (#3536967 Steve snarum-micron)
+- Selecting line from gutter should move caret (patch #520 - Jordan Miner)
 
-- Updated HTML mode (#3594526 Marc Häfner)
+- Fix for the scroll click suppression (patch #505 - EdorFaus)
 
-- Updated CSS mode (#3595041 Marc Häfner)
+- Important speedup of LogViewer (Matthieu Casanova)
 
-- Updated Coffeescript mode (#3595105 Marc Häfner)
+- Support for shortcuts to "copy" the error in Error widget (Matthieu Casanova)
 
-- new PostgreSQL mode (feature #2833378 Thiemo Kellner, Eric Le Lay)
+- The bufferSwitcher now supports Drag&Drop (patch #515 - Yihua Zhang)
 
-}}}
-{{{ UI improvements
+- Added "loading" icon for task status bar widget (request #474 -
+  Matthieu Casanova)
 
-- Better information in the plugin manager when loading plugin list
+- The TextArea will not scroll anymore when dragging files on jEdit
   (Matthieu Casanova)
 
-- Initial view hidden by other windows at startup (#3610089)
-
-- Remove empty root node in OptionGroupPane
-  (#3608324, #3608327: Marco Hunsicker)
+- EnhancedDialog instances (Search/Replace, Options, Open) now can be closed
+  using a single-key close-buffer.shortcut. (patch #497, request #454 -
+  László Schmidt, Zsombor Franczia, Bence Pintér)
 
-- More accurate treatment of ALT_KEY_PRESSED_DISABLED (#3604532: Makarius)
+- Plugin dependencies are shown in the plugin manager details pane for all three
+  tabs. (request #469 - Dale Anson)
 
-- New view option: "Abbreviate paths with environment variables when possible".
-  (#3606329 Alan Ezust)
+- Increased the scrolling speed in option pane (Matthieu Casanova)
 
-- Made view option, "alternate toolbar placement" the default for jEdit.
+- In plugin manager's install panel plugin dependencies are unchecked
+  if they are not required (Eric Le Lay)
 
-- Emacs macros and keymap updates. (Brian Clapper)
+- Use a native splash screen if available (patch #519 - Eric Le Lay)
 
-- Use separate (shorter) label for "whole word search" in the search bar.
-  (Shlomy Reinstein)
+- Improved layout manager for text area (patch #518 - Dale Anson)
 
-- Added a right click popup menu with a copy action in the Error dialog
-  (#3557023 Matthieu Casanova)
+- "Copy link to clipboard" popup menu in HelpViewer (Eric Le Lay)
 
-- Avoid trouble with horizontal scrolling (Patch #3134788, EdorFaus)
+}}}
+{{{ Editing
 
-- Enable ContextMenu via keyboard to VFS-BrowserView (#3560239, Thomas Meyer)
+- Patch to toggle word completion of words with digits.
+  (patch #503, Patrick Eibl)
 
-- Added a possibility to suppress synchronization of the filter in search
-  dialog, using a hidden setting in jedit.props: search.dontSyncFilter.
-  (Jarek Czekalski)
+- New PowerCenter Parameter File format (Patch # 524, Thiemo Kellner)
 
-- Added mnemonics for popup menus in File System Browser (Commands, Plugins,
-  Favorites). (Jarek Czekalski)
+- Several fixes for html mode: (Dale Anson/Marc Häfner)
+  patch #504 HTML mode: Fix mode properties in <script> blocks.
+  bug #3850 Html edit mode
+  bug #3842 HTML syntax highlighting error: & in href
+  bug #3839 Syntax highlight is wrong for some HTML file
 
 }}}
 {{{ Miscellaneous
 
-- Added Chinese translation (patch #3611777 cnvince)
-
-- Made the plugin manager loading much faster (up to 3 time faster)
-  (Matthieu Casanova)
-
-- New macro in Files section: "Open Selection In Desktop" (Jarek Czekalski)
-
-- Open Selection macro improvements. An attempt is made to use current
-  VFS browser directory as a parent for the highlighted filename.
-  In case of no selection the path under caret is used. (Jarek Czekalski)
+- MiscUtilities.expandVariables() converts from Windows to Linux-style paths
+  when necessary (the reverse was already true). (Alan Ezust)
 
-- Fixed unreasonable quadratic operations which could be observable on
-  big search&replace-all. (Patch #3533838 by Thomas Meyer)
+- New macros: Go To Offset, Reverse Selection (patch #501, #502 Thomas Meyer)
 
-- Avoided unreasonable memory consumption by duplicate String instances
-  that could be allocated for each occurrence in a big
-  search&replace-all. (Patch #3528619 by Thomas Meyer)
+- Removed some no longer needed pre-Java7 MacOSX key handling workaround code
+  (patch #511, #512, Makarius, Alan Ezust)
 
-- Fix high memory usage for large search&replace all operations.
-  (Patch #3531515 by Thomas Meyer)
+- Make the OS X application bundle work with Oracle Java 7
+  (bug #3743, #3841, #3862 - Björn "Vampire" Kautler)
 
-- Fix memory usage of Buffer.calculateHash() (patch# 3560429, Thomas Meyer)
+- Add copyright tag to the OS X application bundle (Björn "Vampire" Kautler)
 
-- Make_Bug_Report macro now use logs edit mode to have a little coloring
-  in the result (Matthieu Casanova)
+- Add UTI to the document type in the OS X application bundle
+  (Björn "Vampire" Kautler)
 
-- Beep on output option in Activity log settings
-  (request #3551931 Jarek Czekalski)
+- Bundle version 1.3 of the MacOSX plugin (Björn "Vampire" Kautler)
 
-- New Plugin Manager option: Disable obsolete plugins (#2931321 Alan Ezust)
+- Customize the look of the DMG root folder to provide a simple yet convenient
+  installation GUI for OS X users and to tell them how to work-around Gatekeeper
+  blocking jEdit (bug #3821, #3757 - Björn "Vampire" Kautler)
 
 }}}
 
diff --git a/doc/FAQ/faq-contrib.xml b/doc/FAQ/faq-contrib.xml
index c07dd1a..a6c5d74 100644
--- a/doc/FAQ/faq-contrib.xml
+++ b/doc/FAQ/faq-contrib.xml
@@ -2,7 +2,7 @@
 <appendix id="appendix">
     <title>Contributors</title>
     <!-- jEdit buffer-local properties:                      -->
-    <!-- :indentSize=4:noTabs=false:maxLineLen=80:tabSize=4: -->
+    <!-- :indentSize=2:noTabs=false:maxLineLen=90:tabSize=2: -->
     <!-- :xml.root=faq.xml:                                  -->
     <!-- jEdit FAQ                                           -->
 
diff --git a/doc/FAQ/faq-general.xml b/doc/FAQ/faq-general.xml
index af0ffa0..11e9fd9 100644
--- a/doc/FAQ/faq-general.xml
+++ b/doc/FAQ/faq-general.xml
@@ -2,7 +2,7 @@
 <section id="general">
     <title>General Questions</title>
     <!-- jEdit buffer-local properties:                      -->
-    <!-- :indentSize=4:noTabs=false:maxLineLen=80:tabSize=4: -->
+    <!-- :indentSize=2:noTabs=false:maxLineLen=90:tabSize=2: -->
     <!-- :xml.root=faq.xml:                                  -->
     <!-- jEdit FAQ                                           -->
     <para>This section deals with some background information, how to obtain the
@@ -364,7 +364,7 @@
                     a full Java Development Kit (JDK) package. We recommend
                     obtaining a JDK package.</para>
                     <para>The current version of jEdit requires a
-                    Java runtime environment having a release version of 1.6 or greater. The <ulink
+                    Java runtime environment having a release version of 1.7 or greater. The <ulink
                     url="http://www.jedit.org/index.php?page=compatibility">jEdit
                     web site</ulink> contains a detailed discussion on the
                     compatibility of various publicly available JDK's for the
diff --git a/doc/FAQ/faq-install.xml b/doc/FAQ/faq-install.xml
index e209607..6a16a86 100644
--- a/doc/FAQ/faq-install.xml
+++ b/doc/FAQ/faq-install.xml
@@ -2,7 +2,7 @@
 <section id="installation">
     <title>Installation Questions</title>
     <!-- jEdit buffer-local properties:                      -->
-    <!-- :indentSize=4:noTabs=false:maxLineLen=80:tabSize=4: -->
+    <!-- :indentSize=2:noTabs=false:maxLineLen=90:tabSize=2: -->
     <!-- :xml.root=faq.xml:                                  -->
     <!-- jEdit FAQ                                           -->
 
@@ -22,7 +22,7 @@
                 <answer>
                     <para>First, make sure you have a working installation of
                     the Java platform. To run jEdit, you will a platform package
-                    having a version number of at least 1.6. If you do not
+                    having a version number of at least 1.7. If you do not
                     have the Java platform, we recommend downloading the larger
                     <quote>Software Development Kit</quote> (SDK), instead of
                     the smaller <quote>Java Runtime Environment</quote> (JRE),
diff --git a/doc/FAQ/faq-intro.xml b/doc/FAQ/faq-intro.xml
index 8ec3702..dfb99e4 100644
--- a/doc/FAQ/faq-intro.xml
+++ b/doc/FAQ/faq-intro.xml
@@ -2,7 +2,7 @@
 <section id="intro">
     <title>Introduction</title>
     <!-- jEdit buffer-local properties:                      -->
-    <!-- :indentSize=4:noTabs=false:maxLineLen=80:tabSize=4: -->
+    <!-- :indentSize=2:noTabs=false:maxLineLen=90:tabSize=2: -->
     <!-- :xml.root=faq.xml:                                  -->
     <!-- jEdit FAQ                                           -->
     <para>This document explains many of the basic features of jEdit and
diff --git a/doc/FAQ/faq-macros.xml b/doc/FAQ/faq-macros.xml
index 7a3f82f..c155df6 100644
--- a/doc/FAQ/faq-macros.xml
+++ b/doc/FAQ/faq-macros.xml
@@ -2,7 +2,7 @@
 <section id="macros">
     <title>Macros</title>
     <!-- jEdit buffer-local properties:                      -->
-    <!-- :indentSize=4:noTabs=false:maxLineLen=80:tabSize=4: -->
+    <!-- :indentSize=2:noTabs=false:maxLineLen=90:tabSize=2: -->
     <!-- :xml.root=faq.xml:                                  -->
     <!-- jEdit FAQ                                           -->
     <para>This section deals with questions on writing and running
diff --git a/doc/FAQ/faq-plugins.xml b/doc/FAQ/faq-plugins.xml
index 8f7b6ea..65b94ab 100644
--- a/doc/FAQ/faq-plugins.xml
+++ b/doc/FAQ/faq-plugins.xml
@@ -2,7 +2,7 @@
 <section id="plugins">
     <title>Plugin Questions</title>
     <!-- jEdit buffer-local properties:                      -->
-    <!-- :indentSize=4:noTabs=false:maxLineLen=80:tabSize=4: -->
+    <!-- :indentSize=2:noTabs=false:maxLineLen=90:tabSize=2: -->
     <!-- :xml.root=faq.xml:                                  -->
     <!-- jEdit FAQ                                           -->
     <para>This section deals with questions concerning the use of jEdit's
diff --git a/doc/FAQ/faq-problems.xml b/doc/FAQ/faq-problems.xml
index ac4c4b9..c407ac9 100644
--- a/doc/FAQ/faq-problems.xml
+++ b/doc/FAQ/faq-problems.xml
@@ -2,7 +2,7 @@
 <section id="problems">
     <title>Problems</title>
     <!-- jEdit buffer-local properties:                      -->
-    <!-- :indentSize=4:noTabs=false:maxLineLen=80:tabSize=4: -->
+    <!-- :indentSize=2:noTabs=false:maxLineLen=90:tabSize=2: -->
     <!-- :xml.root=faq.xml:                                  -->
     <!-- jEdit FAQ                                           -->
     <para>This section deals with problems you may experience while using or
@@ -126,7 +126,7 @@
                     the allocation of memory to the heap for Java objects
                     created by the Java Virtual Machine in which jEdit is
                     running. Add a command line option
-                    <userinput>-Xmx640m</userinput> to the options passed to the
+                    <userinput>-mx640m</userinput> to the options passed to the
                     version of the Java application loader you are using (such
                     as <filename>java</filename>, <filename>java.exe</filename>
                     or <filename>javaw.exe</filename>). In place of the
@@ -134,19 +134,15 @@
                     of megabytes you think is appropriate for the maximum heap
                     size. If you already are using the option, try doubling it. 
                     </para>
-                    <para>If you are using the <userinput>-jar</userinput>
-                    command line option with Java to run jEdit, remember that
-                    the <userinput>-jar</userinput> parameter must be the last
-                    Java option, followed immediately by the path to
-                    <filename>jedit.jar</filename> and then any jEdit command
-                    line options.</para>
+                    
+                    <para> For more information about JVM options, see the <ulink url="../users-guide/jvm-options.html">page on JVM options</ulink> in the users guide. </para>
                     
                     <para> On Windows, if you are using the <literal>jedit.exe</literal> launcher, you can add
                     or change the JVM arguments by editing a file called <literal>jEdit.l4j.ini</literal> in the same directory
                     as the <literal>jedit.exe</literal>. Place one 
-                    JVM argument (e.g. <literal>-Xmx512m</literal>) on each
+                    JVM argument (e.g. <literal>-mx640m</literal>) on each
                     line by itself. </para> 
-                    
+                                       
                     <para>If out of memory errors occur while running a build or
                     compilation operation from within jEdit, you can also have
                     the operation run in an external process rather than inside
@@ -161,23 +157,26 @@
             </qandaentry>
             <qandaentry>
                 <question id="textarea-corruption">
-                    <para>My textarea gets confused about the end of the buffer or in some other way corrupted (the characters are in the wrong place on the screen) every now and then. What
-                    should I do?</para>
+                    <para>My textarea gets confused about the end of the buffer or in some other way corrupted (the characters are in the wrong place on the screen, or I get an exception when I scroll to the bottom). What should I do?</para>
                 </question>
                 <answer>
-                    <para>It happens to me sometimes too. I have this macro to work around it for now:
+                    <para>Before jEdit 5.0, it happened to me quite a bit too.
+                    I use this macro to help avoid the need to restart jEdit. 
 <programlisting>
 /** Reset_TextArea.bsh */
 view.splitVertically();
 view.unsplitCurrent();
 </programlisting>
 					Run this, and jEdit creates
-                    a new TextArea for you, and that one won't be confused. This
-                    can help avoid the need to restart jEdit. If you can
-                    reproduce the steps you took to cause this, please submit a
-                    bug report that details what plugins/versions you were
-                    using, and how to reproduce it. It may be specific to a file you are editing, or a particular combination of settings you are using, or sequence of actions you performed. </para>
-                </answer>
+                    a new TextArea for you, one that is in a valid state. </para>
+                    
+                    <para>If you can reproduce the steps you took to cause this,
+                    please submit a bug report that details what
+                    plugins/versions you were using, and how to reproduce it. It
+                    may be specific to a file you are editing, or a particular
+                    combination of settings you are using, or sequence of
+                    actions you performed. </para>
+                    </answer>
             </qandaentry>
             <qandaentry>
                 <question id="general-borders">
@@ -355,9 +354,9 @@ Exception in thread "main" java.awt.AWTError: Cannot load AWT toolkit: gnu.java.
 </programlisting>
 				</question>
 				<answer>
-				 <para> Make sure the version of Java you are running is Sun Java 1.6 or higher.
+				 <para> Make sure the version of Java you are running is Sun Java 1.7 or higher.
 				 In debian/ubuntu,
-				 <literal> apt-get install sun-java6-jdk </literal>
+				 <literal> apt-get install openjdk-7-jdk </literal>
 				 </para>
 		        </answer>
 				</qandaentry>
diff --git a/doc/FAQ/faq-use.xml b/doc/FAQ/faq-use.xml
index 0707509..f5fc1b7 100644
--- a/doc/FAQ/faq-use.xml
+++ b/doc/FAQ/faq-use.xml
@@ -3,7 +3,7 @@
     <title>Usage Questions</title>
 
     <!-- jEdit buffer-local properties:                      -->
-    <!-- :indentSize=4:noTabs=false:tabSize=4: -->
+    <!-- :indentSize=2:noTabs=false:tabSize=2: -->
     <!-- :xml.root=faq.xml:                                  -->
     <!-- jEdit FAQ                                           -->
 
@@ -156,7 +156,7 @@
                     wish to use from <guisubmenu> Encoding</guisubmenu> in the
                     <guimenu>Commands</guimenu> menu of the File System Browser.
                     You can also designate a default encoding in the
-                    <ulink url="jeditresource:/doc/users-guide/global-opts.html#encodings-pane">
+                    <ulink url="../users-guide/global-opts.html#encodings-pane">
                     <guimenuitem>Encoding</guimenuitem></ulink> pane of the
                     Global Options; if you do not, jEdit uses
                     
@@ -311,6 +311,19 @@
         <qandadiv id="text-format">
             <title>Formatting text</title>
 
+			<qandaentry>
+                <question id="toggle-auto-indent">
+                    <para>How do I toggle jEdit's auto-indent behavior? </para>
+                </question>
+                <answer>
+                   <para> By default, the <literal>Return</literal> key is bound to
+                   the <guimenuitem>Insert Newline and Indent</guimenuitem> action.
+                   If you bind it to <guimenuitem>Insert Newline</guimenuitem> from
+                   <guimenuitem>Global Options - Shortcuts</guimenuitem>, that will
+                   disable the auto-indent behavior. There is no way to "toggle"
+                   this feature. </para>
+                </answer>
+            </qandaentry>
             <qandaentry>
                 <question id="text-indent">
                     <para>How do I indent or unindent selections of text?</para>
@@ -502,9 +515,7 @@
                 </question>
 
                 <answer>
-                    <para>Start with the "Emacs" Keymap and customize it by setting 
-                    your own shortcuts to make it more like your flavor of Emacs.
-                    Emacs macros are contributed by Brian Clapper. 
+                    <para>As of jEdit 5.1, it is much easier than before:  <guimenuitem> Global Options - Shortcuts - Choose Keymap: Emacs</guimenuitem>. Customize it by setting your own shortcuts to make it more like your flavor of Emacs. Emacs macros are contributed by Brian Clapper. 
                     </para>
                 </answer>
             </qandaentry>
@@ -532,17 +543,8 @@
                     <para>How can I get antialiased text everywhere, even dockables and menus? </para>
                 </question>
                 <answer>
-                   <para>For the text area, go to <guimenuitem>Global Options - TextArea - Anti Aliased Smooth Text</guimenuitem>.
-                   Note that enabling the related option for "Fractional font metrics" potentially
-                   improves character shapes, but can make the text look blurry. </para>
-                   
-                   <para>For the dockables, starting <command>java</command> with command line options <literal>"-Dawt.useSystemAAFontSettings=on" "-Dswing.aatext=true"</literal> will give you antialiased text everywhere else.
-                   You can add these options to the batch file or shell script line that starts jEdit. </para>
-                   
-                   <para> On Windows with the .exe launcher, you create a file called <literal>jedit.l4j.ini</literal> in the same directory as the .exe file, 
-                   and place one line for each java argument you want to pass. For example:
-                   <programlisting>-Dawt.useSystemAAFontSettings=on
--Dswing.aatext=true</programlisting>
+                   <para>
+                   See the <ulink url="../users-guide/jvm-options.html">page on JVM options</ulink> in the users guide.  
                    </para>
                    
                    <para> On Mac OS X, the jEdit.app bundle already provides certain antialiasing properties in
diff --git a/doc/FAQ/faq.xml b/doc/FAQ/faq.xml
index b79c900..07bc53a 100644
--- a/doc/FAQ/faq.xml
+++ b/doc/FAQ/faq.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- jEdit buffer-local properties:                       -->
-<!-- :indentSize=1   -->
+<!-- :indentSize=2   -->
 <!-- jEdit FAQ                                            -->
 <!-- Command line for processing:                         -->
 <!--                                                      -->
@@ -86,9 +86,9 @@
 
             <revision>
                 <revnumber>1.4</revnumber>
-                <date>2006,2012</date>
+                <date>2006,2014</date>
                 <author> <firstname>Alan </firstname> <surname>Ezust </surname></author>
-                <revremark>Updates for jEdit 4.3-5.1 releases</revremark>
+                <revremark>Updates for jEdit 4.3-5.2 releases</revremark>
             </revision>
         </revhistory>
 
diff --git a/doc/README.txt b/doc/README.txt
index adc4136..d1b95b2 100644
--- a/doc/README.txt
+++ b/doc/README.txt
@@ -3,7 +3,7 @@ jEdit README
 * About jEdit
 
 jEdit is a cross platform programmer's text editor written in Java.
-jEdit requires Java 2 version 1.6 or later.
+jEdit requires Java 7 Runtime or later.
 It will not run with earlier versions of Java.
 
 jEdit comes with full online help; to read it, select 'jEdit Help' from
diff --git a/doc/releasing-jedit.txt b/doc/releasing-jedit.txt
index 87aadaf..f4415c3 100644
--- a/doc/releasing-jedit.txt
+++ b/doc/releasing-jedit.txt
@@ -15,17 +15,17 @@ Workflow
 
 1. Execute the BeanShell snippet at the end of this file ("Utilities -> BeanShell -> Evaluate Selection"). This will replace the version tags in this document by actual version numbers for easy copy & paste.
 
-2. Review http://jedit.svn.sourceforge.net/svnroot/jedit/jEdit/branches/[branch]/doc/CHANGES.txt for formatting errors (like missing newline characters, wrong indentation or empty blocks), fix them and check them in.
+2. Review https://svn.code.sf.net/p/jedit/svn/jEdit/branches/5.2.x/doc/CHANGES.txt for formatting errors (like missing newline characters, wrong indentation or empty blocks), fix them and check them in.
 
 3. Tag the sourcecode for release in the SVN repository by doing
-        svn copy https://jedit.svn.sourceforge.net/svnroot/jedit/jEdit/branches/[branch] https://jedit.svn.sourceforge.net/svnroot/jedit/jEdit/tags/[tag] -m "Tagging [version] for release."
+        svn copy https://svn.code.sf.net/p/jedit/svn/jEdit/branches/5.2.x https://svn.code.sf.net/p/jedit/svn/jEdit/tags/jedit-5-2-0 -m "Tagging 5.2.0 for release."
    with the correct version in the second URL and in the commit message
 
 4. To be sure to work with the exact tagged source, check out the newly tagged source in a new directory by doing
-        svn checkout https://jedit.svn.sourceforge.net/svnroot/jedit/jEdit/tags/[tag]
-   no matter where. You will find the source in a subfolder [tag] where you executed the command
+        svn checkout https://svn.code.sf.net/p/jedit/svn/jEdit/tags/jedit-5-2-0
+   no matter where. You will find the source in a subfolder jedit-5-2-0 where you executed the command
 
-5. Copy build.properties from your jEdit source directory to the newly created [tag] source directory if needed. If you don't have it, then create it if needed. You find a template called build.properties.sample in the root directory.
+5. Copy build.properties from your jEdit source directory to the newly created jedit-5-2-0 source directory if needed. If you don't have it, then create it if needed. You find a template called build.properties.sample in the root directory.
    To give an example, in build.properties I customized the following properties:
     - wine.executable=wine
     - winepath.executable=winepath
@@ -37,89 +37,89 @@ Workflow
 
 6.1. Build the distribution files by doing
           ant dist
-     in the [tag] directory
-     In the newly created directory [tag]/dist you find [ifdevel]8[/ifdevel][iffinal]13[/iffinal] files:
-      - jedit[version]manual-a4.pdf
-      - jedit[version]manual-letter.pdf
-      - jedit[version]source.tar.bz2
-      - jedit[version]install.jar
-      - jedit-[version]-noarch-1sao.tgz
-      - jedit_[version]_all.deb
-      - jedit[version]install.exe or jedit[version]-dist-win-finish.tar.bz2
-      - jedit[version]install.dmg or jedit[version]-dist-mac-finish.tar.bz2
-[iffinal]      - Packages
+     in the jedit-5-2-0 directory
+     In the newly created directory jedit-5-2-0/dist you find 13 files:
+      - jedit5.2.0manual-a4.pdf
+      - jedit5.2.0manual-letter.pdf
+      - jedit5.2.0source.tar.bz2
+      - jedit5.2.0install.jar
+      - jedit-5.2.0-noarch-1sao.tgz
+      - jedit_5.2.0_all.deb
+      - jedit5.2.0install.exe or jedit5.2.0-dist-win-finish.tar.bz2
+      - jedit5.2.0install.dmg or jedit5.2.0-dist-mac-finish.tar.bz2
+      - Packages
       - Packages.gz
       - Packages.bz2
       - Release
       - Release.gpg
-[/iffinal]
-6.2. If you have jedit[version]-dist-win-finish.tar.bz2 in your [tag]/dist folder you probably don't run a Windows box and don't have wine installed and set up, so please hand over this file to someone (e. g. <Björn "Vampire" Kautler> Vampire at jEdit.org) who does and ask him to unpack the file and run
+
+6.2. If you have jedit5.2.0-dist-win-finish.tar.bz2 in your jedit-5-2-0/dist folder you probably don't run a Windows box and don't have wine installed and set up, so please hand over this file to someone (e. g. <Björn "Vampire" Kautler> Vampire at jEdit.org) who does and ask him to unpack the file and run
           ant dist-win-finish
-     and to hand over the resulting file jedit[version]install.exe to you. The requirements for this are described in README.SRC.txt
+     and to hand over the resulting file jedit5.2.0install.exe to you. The requirements for this are described in README.SRC.txt
 
-6.3. If you have jedit[version]-dist-mac-finish.tar.bz2 in your [tag]/dist folder you probably don't run a Mac OS X box, so please hand over this file to someone (e. g. Björn "Vampire" Kautler <Vampire at jEdit.org>) who does and ask him to unpack the file and run
+6.3. If you have jedit5.2.0-dist-mac-finish.tar.bz2 in your jedit-5-2-0/dist folder you probably don't run a Mac OS X box, so please hand over this file to someone (e. g. Björn "Vampire" Kautler <Vampire at jEdit.org>) who does and ask him to unpack the file and run
           ant dist-mac-finish
-     and to hand over the resulting file jedit[version]install.dmg to you. The requirements for this are described in README.SRC.txt
+     and to hand over the resulting file jedit5.2.0install.dmg to you. The requirements for this are described in README.SRC.txt
+
+6.4. After you received the final distribution files jedit5.2.0install.exe and jedit5.2.0install.dmg you can delete jedit5.2.0-dist-win-finish.tar.bz2 and jedit5.2.0-dist-mac-finish.tar.bz2
 
-6.4. After you received the final distribution files jedit[version]install.exe and jedit[version]install.dmg you can delete jedit[version]-dist-win-finish.tar.bz2 and jedit[version]-dist-mac-finish.tar.bz2
-[iffinal]
 6.5. If you don't have Release.gpg, you didn't have setup a GPG secring. Either create a GPG secring, run
           ant dist-sign-deb-Release
      , upload the public key to a public keyserver and make sure your key is mentioned on http://jedit.org/index.php?page=download&platform=unix#option_two so the users know the key is valid for signing jEdit releases. Alternatively send Release to someone whose key is already mentioned on the download page (e. g. Björn "Vampire" Kautler <Vampire at jEdit.org>) and ask him to put Release in the dist folder, to run
           ant dist-sign-deb-Release
      and to hand over the resulting file Release.gpg to you. The second way is preferable if you only create a release once or from time to time as a new key means the user will get confused and has to react for verifying and installing the new key.
-[/iffinal]
+
 7. - Connect to the SourceForge servers via one of the methods described in https://sourceforge.net/apps/trac/sourceforge/wiki/Release%20files%20for%20download
-   - Add the sub-folder "[version]" under "/home/frs/project/j/je/jedit/jedit[ifdevel]-devel[/ifdevel]"
-   - Upload the 8 final distribution files [iffinal]starting with "jedit" [/iffinal]to the newly created folder on the SourceForge servers
-[iffinal]   - Upload the 5 remaining distribution files not starting with "jedit" to the folder "/home/frs/project/j/je/jedit" on the SourceForge servers.
-[/iffinal]
-8. - Go to https://sourceforge.net/projects/jedit/files/jedit[ifdevel]-devel[/ifdevel]/[version]/
+   - Add the sub-folder "5.2.0" under "/home/frs/project/j/je/jedit/jedit"
+   - Upload the 8 final distribution files starting with "jedit" to the newly created folder on the SourceForge servers
+   - Upload the 5 remaining distribution files not starting with "jedit" to the folder "/home/frs/project/j/je/jedit" on the SourceForge servers.
+
+8. - Go to https://sourceforge.net/projects/jedit/files/jedit/5.2.0/
    - Make the following settings for each file after clicking on the respective "i" icon
-        - jedit_[version]_all.deb
+        - jedit_5.2.0_all.deb
             - Download Button: Debian Installer
             - Default Download For: <none>
-        - jedit[version]source.tar.bz2
+        - jedit5.2.0source.tar.bz2
             - Download Button: Source Package
             - Default Download For: <none>
-        - jedit[version]install.jar
+        - jedit5.2.0install.jar
             - Download Button: Java based Installer
-            - Default Download For: [ifdevel]<none>[/ifdevel][iffinal]linux, bsd, solaris, others[/iffinal]
-        - jedit[version]manual-letter.pdf
+            - Default Download For: linux, bsd, solaris, others
+        - jedit5.2.0manual-letter.pdf
             - Download Button: Manual in Letter Paper size
             - Default Download For: <none>
-        - jedit[version]manual-a4.pdf
+        - jedit5.2.0manual-a4.pdf
             - Download Button: Manual in A4 Paper size
             - Default Download For: <none>
-        - jedit[version]install.dmg
+        - jedit5.2.0install.dmg
             - Download Button: Mac OS X Installer
-            - Default Download For: [ifdevel]<none>[/ifdevel][iffinal]mac[/iffinal]
-        - jedit[version]install.exe
+            - Default Download For: mac
+        - jedit5.2.0install.exe
             - Download Button: Windows Installer
-            - Default Download For: [ifdevel]<none>[/ifdevel][iffinal]windows[/iffinal]
-        - jedit-[version]-noarch-1sao.tgz
+            - Default Download For: windows
+        - jedit-5.2.0-noarch-1sao.tgz
             - Download Button: Slackware Installer
             - Default Download For: <none>
 
 9. Update the website in the following places and also update this state in SVN:
-    - Open sftp://[sourceForgeUsername],jedit at web.sourceforge.net/home/project-web/jedit/htdocs/download.html e. g. in jEdit with installed FTP plugin and update the website for the new release, means the filenames, filesizes and amount of pages in the User's Guides
-    - Open sftp://[sourceForgeUsername],jedit at web.sourceforge.net/home/project-web/jedit/htdocs/jEdit-version.txt e. g. in jEdit with installed FTP plugin and update the versions in the file, which is needed by the LatestVersion Plugin
-    - Open sftp://[sourceForgeUsername],jedit at web.sourceforge.net/home/project-web/jedit/htdocs/CHANGES[major][minor].txt e. g. in jEdit with installed FTP plugin and copy the contents of [tag]/doc/CHANGES.txt to this file
-    - Open sftp://[sourceForgeUsername],jedit at web.sourceforge.net/home/project-web/jedit/htdocs/index.php e. g. in jEdit with installed FTP plugin and update the version number and the Last Site Update date
-    - Open sftp://[sourceForgeUsername],jedit at web.sourceforge.net/home/project-web/jedit/htdocs/devel.html e. g. in jEdit with installed FTP plugin and add a line for [version] in the Release Schedule
+    - Open sftp://elberry,jedit@web.sourceforge.net/home/project-web/jedit/htdocs/download.html e. g. in jEdit with installed FTP plugin and update the website for the new release, means the filenames, filesizes and amount of pages in the User's Guides
+    - Open sftp://elberry,jedit@web.sourceforge.net/home/project-web/jedit/htdocs/jEdit-version.txt e. g. in jEdit with installed FTP plugin and update the versions in the file, which is needed by the LatestVersion Plugin
+    - Open sftp://elberry,jedit@web.sourceforge.net/home/project-web/jedit/htdocs/CHANGES52.txt e. g. in jEdit with installed FTP plugin and copy the contents of jedit-5-2-0/doc/CHANGES.txt to this file
+    - Open sftp://elberry,jedit@web.sourceforge.net/home/project-web/jedit/htdocs/index.php e. g. in jEdit with installed FTP plugin and update the version number and the Last Site Update date
+    - Open sftp://elberry,jedit@web.sourceforge.net/home/project-web/jedit/htdocs/devel.html e. g. in jEdit with installed FTP plugin and add a line for 5.2.0 in the Release Schedule
 
 10. Update the plugin wizard
      - Go to http://plugins.jedit.org/wiz/release_list.php?package_id=24
      - Find or create the entry for this jEdit Release
           The entry may already exist but have an invalid date 
           if a plugin was released that depends on it. 
-     - Switch "Head of Branch" to "[ifdevel]devel[/ifdevel][iffinal]main[/iffinal]"
+     - Switch "Head of Branch" to "main"
      - Check the "Remove" checkbox for the jEdit dependency
-     - Switch the "Low Version" of the JDK dependency to "1.6 [jdk-1.6]"
+     - Switch the "Low Version" of the JDK dependency to "1.7 [jdk-1.7]"
      - Click "Update Dependencies"
      - Click "Create Release"
 
-11. Send an announcement eMail to the jEdit-announce list. The announcement should contain some announcing text and in the end the contents of [tag]/doc/CHANGES.txt for this release.
+11. Send an announcement eMail to the jEdit-announce list. The announcement should contain some announcing text and in the end the contents of jedit-5-2-0/doc/CHANGES.txt for this release.
     You have to be set up to be able to post to jEdit-announce list.
     The mail should automatically get forwarded to the jedit-users list, but for that you have to be subscribed to that list too.
 
@@ -133,12 +133,12 @@ Workflow
      - Send a mail to the Community Growth Hacker of SourceForge for promotion of the release, currently this is Rich Bowen <communityteam at sourceforge.net>
      - Send a mail to Heise for inclusion in the weekly Heise Developer Snapshots at developer at ix.de
 
-14. Delete the [tag] folder
+14. Delete the jedit-5-2-0 folder
 
 15. Update the version number on the release branch
      - Add the following section to doc/CHANGES.txt
 
-{{{ Version [nextVersion]
+{{{ Version 5.2.1
 
 Thanks to  for contributing to this release.
 
@@ -161,90 +161,23 @@ Thanks to  for contributing to this release.
 
 }}}
      - Update the build number in org/gjt/sp/jedit/jEdit.java getBuild() method to
-            return "[nextBuild]";
+            return "05.02.99.01";
      - Submit your changes by doing
-            svn commit -m "Update the version number to [nextVersion]"
+            svn commit -m "Update the version number to 5.2.1"
        in the root source directory
 
-16. It the release is from the latest release branch, clean up doc/CHANGES.txt on trunk.
+16. If the release is from the latest release branch, clean up doc/CHANGES.txt on trunk.
      - Update the version number which is the base of CHANGES.txt.
-       "changes since jEdit [version]".
-     - Remove all entries which has been released in [version].
-       The entries to be removed are those which are listed in CHANGES in the release you just finished.
+            "changes since jEdit 5.2.0"
+     - Remove all entries which have been released in 5.2.0.
+       The entries to be removed are tagged with "[merged into 5.2.x]".
      - Submit your changes by doing
-            svn commit -m "Update the base version of CHANGES.txt to [version]" doc/CHANGES.txt
+            svn commit -m "Update the base version of CHANGES.txt to 5.2.0" doc/CHANGES.txt
        in trunk.
 
 ====================================================================================================
-import java.util.regex.Pattern;
-file = new File(new File(buffer.getPath()).getParentFile(), "../org/gjt/sp/jedit/jEdit.java");
-fileChars = new char[file.length()];
-reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
-reader.read(fileChars, 0, fileChars.length);
-pattern = Pattern.compile("public static String getBuild\\(\\)[^}]+return \"([^\"]{11})\"");
-matcher = pattern.matcher(new String(fileChars));
-matcher.find();
-build = matcher.group(1);
-major = Integer.parseInt(build.substring(0,2));
-minor = Integer.parseInt(build.substring(3,5));
-beta = Integer.parseInt(build.substring(6,8));
-micro = Integer.parseInt(build.substring(9,11));
-branch = major + "." + minor + ".x";
-tag = "jedit-"
-      + major
-      + "-" + minor
-      + (beta != 99 ? "-pre" + beta : "-" + micro);
-version = major
-          + "." + minor
-          + (beta != 99 ? "pre" + beta : "." + micro);
-nextVersion = major
-              + "." + minor
-              + (beta != 99 ? "pre" + (beta + 1) : "." + (micro + 1));
-nextBuild = String.format("%02d.%02d.%02d.%02d",
-                          new Object[] { Integer.valueOf(major),
-                                         Integer.valueOf(minor),
-                                         Integer.valueOf(beta == 99 ? beta : beta + 1),
-                                         Integer.valueOf(beta == 99 ? micro + 1 : micro) });
-sourceForgeUsername = Macros.input(view, "Your SourceForge Username?", "Vampire0");
-SearchAndReplace.setBeanShellReplace(false);
-SearchAndReplace.setIgnoreCase(false);
-SearchAndReplace.setRegexp(false);
-SearchAndReplace.setSearchFileSet(new CurrentBufferSet());
-buffer.beginCompoundEdit();
-SearchAndReplace.setSearchString("[branch]");
-SearchAndReplace.setReplaceString(branch);
-SearchAndReplace.replaceAll(view);
-SearchAndReplace.setSearchString("[tag]");
-SearchAndReplace.setReplaceString(tag);
-SearchAndReplace.replaceAll(view);
-SearchAndReplace.setSearchString("[version]");
-SearchAndReplace.setReplaceString(version);
-SearchAndReplace.replaceAll(view);
-SearchAndReplace.setSearchString("[major]");
-SearchAndReplace.setReplaceString(Integer.toString(major));
-SearchAndReplace.replaceAll(view);
-SearchAndReplace.setSearchString("[minor]");
-SearchAndReplace.setReplaceString(Integer.toString(minor));
-SearchAndReplace.replaceAll(view);
-SearchAndReplace.setSearchString("[nextVersion]");
-SearchAndReplace.setReplaceString(nextVersion);
-SearchAndReplace.replaceAll(view);
-SearchAndReplace.setSearchString("[nextBuild]");
-SearchAndReplace.setReplaceString(nextBuild);
-SearchAndReplace.replaceAll(view);
-SearchAndReplace.setSearchString("[sourceForgeUsername]");
-SearchAndReplace.setReplaceString(sourceForgeUsername);
-SearchAndReplace.replaceAll(view);
-SearchAndReplace.setRegexp(true);
-SearchAndReplace.setBeanShellReplace(true);
-SearchAndReplace.setSearchString("\\[ifdevel\\]((?:.|\n)*?)\\[/ifdevel\\]");
-SearchAndReplace.setReplaceString(beta != 99 ? "_1" : "");
-SearchAndReplace.replaceAll(view);
-SearchAndReplace.setSearchString("\\[iffinal\\]((?:.|\n)*?)\\[/iffinal\\]");
-SearchAndReplace.setReplaceString(beta != 99 ? "" : "_1");
-SearchAndReplace.replaceAll(view);
-textArea.replaceSelection("Variables replaced\n");
-buffer.endCompoundEdit();
+Variables replaced
+
 ====================================================================================================
 
 :wrap=soft:maxLineLen=0:folding=indent:
diff --git a/doc/stylesheet.css b/doc/stylesheet.css
new file mode 100644
index 0000000..96e6664
--- /dev/null
+++ b/doc/stylesheet.css
@@ -0,0 +1,473 @@
+/* Javadoc style sheet, customized so it can be viewed in 
+   the old Swing Browser that comes with the JRE. */
+
+body {
+    background-color:#ffffff;
+    color:#353833;
+    font-family:Arial, Helvetica, sans-serif;
+/*    font-size:76%; */
+    margin:0;
+}
+a:link, a:visited {
+    text-decoration:none;
+    color:#4c6b87;
+}
+a:hover, a:focus {
+    text-decoration:none;
+    color:#bb7a2a;
+}
+a:active {
+    text-decoration:none;
+    color:#4c6b87;
+}
+a[name] {
+    color:#353833;
+}
+a[name]:hover {
+    text-decoration:none;
+    color:#353833;
+}
+pre {
+    font-size:1.3em;
+}
+h1 {
+    font-size:1.8em;
+}
+h2 {
+    font-size:1.5em;
+}
+h3 {
+    font-size:1.4em;
+}
+h4 {
+    font-size:1.3em;
+}
+h5 {
+    font-size:1.2em;
+}
+h6 {
+    font-size:1.1em;
+}
+ul {
+    list-style-type:disc;
+}
+code, tt {
+    font-size:1.2em;
+}
+dt code {
+    font-size:1.2em;
+}
+table tr td dt code {
+    font-size:1.2em;
+    vertical-align:top;
+}
+sup {
+    font-size:.6em;
+}
+/*
+Document title and Copyright styles
+*/
+.clear {
+    clear:both;
+    height:0px;
+    overflow:hidden;
+}
+.aboutLanguage {
+    float:right;
+    padding:0px 21px;
+    font-size:.8em;
+    z-index:200;
+    margin-top:-7px;
+}
+.legalCopy {
+    margin-left:.5em;
+}
+.bar a, .bar a:link, .bar a:visited, .bar a:active {
+    color:#FFFFFF;
+    text-decoration:none;
+}
+.bar a:hover, .bar a:focus {
+    color:#bb7a2a;
+}
+.tab {
+    background-color:#0066FF;
+    background-image:url(resources/titlebar.gif);
+    background-position:left top;
+    background-repeat:no-repeat;
+    color:#ffffff;
+    padding:8px;
+    width:5em;
+    font-weight:bold;
+}
+/*
+Navigation bar styles
+*/
+.bar {
+    background-image:url(resources/background.gif);
+    background-repeat:repeat-x;
+    color:#FFFFFF;
+    padding:.8em .5em .4em .8em;
+    height:auto;/*height:1.8em;*/
+    font-size:1em;
+    margin:0;
+}
+.topNav {
+    background-image:url(resources/background.gif);
+    background-repeat:repeat-x;
+    color:#FFFFFF;
+    float:left;
+    padding:0;
+    width:100%;
+    clear:right;
+    height:2.8em;
+    padding-top:10px;
+    overflow:hidden;
+}
+.bottomNav {
+    margin-top:10px;
+    background-image:url(resources/background.gif);
+    background-repeat:repeat-x;
+    color:#FFFFFF;
+    float:left;
+    padding:0;
+    width:100%;
+    clear:right;
+    height:2.8em;
+    padding-top:10px;
+    overflow:hidden;
+}
+.subNav {
+    background-color:#dee3e9;
+    border-bottom:1px solid #9eadc0;
+    float:left;
+    width:100%;
+    overflow:hidden;
+}
+.subNav div {
+    clear:left;
+    float:left;
+    padding:0 0 5px 6px;
+}
+ul.navList, ul.subNavList {
+    float:left;
+    margin:0 25px 0 0;
+    padding:0;
+}
+ul.navList li{
+    list-style:none;
+    float:left;
+    padding:3px 6px;
+}
+ul.subNavList li{
+    list-style:none;
+    float:left;
+/*    font-size:90%; */
+}
+.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited {
+    color:#FFFFFF;
+    text-decoration:none;
+}
+.topNav a:hover, .bottomNav a:hover {
+    text-decoration:none;
+    color:#bb7a2a;
+}
+.navBarCell1Rev {
+    background-image:url(resources/tab.gif);
+    background-color:#a88834;
+    color:#FFFFFF;
+    margin: auto 5px;
+    border:1px solid #c9aa44;
+}
+/*
+Page header and footer styles
+*/
+.header, .footer {
+    clear:both;
+    margin:0 20px;
+    padding:5px 0 0 0;
+}
+.indexHeader {
+    margin:10px;
+    position:relative;
+}
+.indexHeader h1 {
+    font-size:1.3em;
+}
+.title {
+    color:#2c4557;
+    margin:10px 0;
+}
+.subTitle {
+    margin:5px 0 0 0;
+}
+.header ul {
+    margin:0 0 25px 0;
+    padding:0;
+}
+.footer ul {
+    margin:20px 0 5px 0;
+}
+.header ul li, .footer ul li {
+    list-style:none;
+    font-size:1.2em;
+}
+/*
+Heading styles
+*/
+div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 {
+    background-color:#dee3e9;
+    border-top:1px solid #9eadc0;
+    border-bottom:1px solid #9eadc0;
+    margin:0 0 6px -8px;
+    padding:2px 5px;
+}
+ul.blockList ul.blockList ul.blockList li.blockList h3 {
+    background-color:#dee3e9;
+    border-top:1px solid #9eadc0;
+    border-bottom:1px solid #9eadc0;
+    margin:0 0 6px -8px;
+    padding:2px 5px;
+}
+ul.blockList ul.blockList li.blockList h3 {
+    padding:0;
+    margin:15px 0;
+}
+ul.blockList li.blockList h2 {
+    padding:0px 0 20px 0;
+}
+/*
+Page layout container styles
+*/
+.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer {
+    clear:both;
+    padding:10px 20px;
+    position:relative;
+}
+.indexContainer {
+    margin:10px;
+    position:relative;
+    font-size:1.0em;
+}
+.indexContainer h2 {
+    font-size:1.1em;
+    padding:0 0 3px 0;
+}
+.indexContainer ul {
+    margin:0;
+    padding:0;
+}
+.indexContainer ul li {
+    list-style:none;
+}
+.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt {
+    font-size:1.1em;
+    font-weight:bold;
+    margin:10px 0 0 0;
+    color:#4E4E4E;
+}
+.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd {
+    margin:10px 0 10px 20px;
+}
+.serializedFormContainer dl.nameValue dt {
+    margin-left:1px;
+    font-size:1.1em;
+    display:inline;
+    font-weight:bold;
+}
+.serializedFormContainer dl.nameValue dd {
+    margin:0 0 0 1px;
+    font-size:1.1em;
+    display:inline;
+}
+/*
+List styles
+*/
+ul.horizontal li {
+    display:inline;
+    font-size:0.9em;
+}
+ul.inheritance {
+    margin:0;
+    padding:0;
+}
+ul.inheritance li {
+    display:inline;
+    list-style:none;
+}
+ul.inheritance li ul.inheritance {
+    margin-left:15px;
+    padding-left:15px;
+    padding-top:1px;
+}
+ul.blockList, ul.blockListLast {
+    margin:10px 0 10px 0;
+    padding:0;
+}
+ul.blockList li.blockList, ul.blockListLast li.blockList {
+    list-style:none;
+    margin-bottom:25px;
+}
+ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList {
+    padding:0px 20px 5px 10px;
+    border:1px solid #9eadc0;
+    background-color:#f9f9f9;
+}
+ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList {
+    padding:0 0 5px 8px;
+    background-color:#ffffff;
+    border:1px solid #9eadc0;
+    border-top:none;
+}
+ul.blockList ul.blockList ul.blockList ul.blockList li.blockList {
+    margin-left:0;
+    padding-left:0;
+    padding-bottom:15px;
+    border:none;
+    border-bottom:1px solid #9eadc0;
+}
+ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast {
+    list-style:none;
+    border-bottom:none;
+    padding-bottom:0;
+}
+table tr td dl, table tr td dl dt, table tr td dl dd {
+    margin-top:0;
+    margin-bottom:1px;
+}
+/*
+Table styles
+*/
+.contentContainer table, .classUseContainer table, .constantValuesContainer table {
+    border-bottom:1px solid #9eadc0;
+    width:100%;
+}
+.contentContainer ul li table, .classUseContainer ul li table, .constantValuesContainer ul li table {
+    width:100%;
+}
+.contentContainer .description table, .contentContainer .details table {
+    border-bottom:none;
+}
+.contentContainer ul li table th.colOne, .contentContainer ul li table th.colFirst, .contentContainer ul li table th.colLast, .classUseContainer ul li table th, .constantValuesContainer ul li table th, .contentContainer ul li table td.colOne, .contentContainer ul li table td.colFirst, .contentContainer ul li table td.colLast, .classUseContainer ul li table td, .constantValuesContainer ul li table td{
+    vertical-align:top;
+    padding-right:20px;
+}
+.contentContainer ul li table th.colLast, .classUseContainer ul li table th.colLast,.constantValuesContainer ul li table th.colLast,
+.contentContainer ul li table td.colLast, .classUseContainer ul li table td.colLast,.constantValuesContainer ul li table td.colLast,
+.contentContainer ul li table th.colOne, .classUseContainer ul li table th.colOne,
+.contentContainer ul li table td.colOne, .classUseContainer ul li table td.colOne {
+    padding-right:3px;
+}
+.overviewSummary caption, .packageSummary caption, .contentContainer ul.blockList li.blockList caption, .summary caption, .classUseContainer caption, .constantValuesContainer caption {
+    position:relative;
+    text-align:left;
+    background-repeat:no-repeat;
+    color:#FFFFFF;
+    font-weight:bold;
+    clear:none;
+    overflow:hidden;
+    padding:0px;
+    margin:0px;
+}
+caption a:link, caption a:hover, caption a:active, caption a:visited {
+    color:#FFFFFF;
+}
+.overviewSummary caption span, .packageSummary caption span, .contentContainer ul.blockList li.blockList caption span, .summary caption span, .classUseContainer caption span, .constantValuesContainer caption span {
+    white-space:nowrap;
+    padding-top:8px;
+    padding-left:8px;
+    display:block;
+    float:left;
+    background-image:url(resources/titlebar.gif);
+    height:18px;
+}
+.overviewSummary .tabEnd, .packageSummary .tabEnd, .contentContainer ul.blockList li.blockList .tabEnd, .summary .tabEnd, .classUseContainer .tabEnd, .constantValuesContainer .tabEnd {
+    width:10px;
+    background-image:url(resources/titlebar_end.gif);
+    background-repeat:no-repeat;
+    background-position:top right;
+    position:relative;
+    float:left;
+}
+ul.blockList ul.blockList li.blockList table {
+    margin:0 0 12px 0px;
+    width:100%;
+}
+.tableSubHeadingColor {
+    background-color: #EEEEFF;
+}
+.altColor {
+    background-color:#eeeeef;
+}
+.rowColor {
+    background-color:#ffffff;
+}
+.overviewSummary td, .packageSummary td, .contentContainer ul.blockList li.blockList td, .summary td, .classUseContainer td, .constantValuesContainer td {
+    text-align:left;
+    padding:3px 3px 3px 7px;
+}
+th.colFirst, th.colLast, th.colOne, .constantValuesContainer th {
+    background:#dee3e9;
+    border-top:1px solid #9eadc0;
+    border-bottom:1px solid #9eadc0;
+    text-align:left;
+    padding:3px 3px 3px 7px;
+}
+td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover {
+    font-weight:bold;
+}
+td.colFirst, th.colFirst {
+    border-left:1px solid #9eadc0;
+    white-space:nowrap;
+}
+td.colLast, th.colLast {
+    border-right:1px solid #9eadc0;
+}
+td.colOne, th.colOne {
+    border-right:1px solid #9eadc0;
+    border-left:1px solid #9eadc0;
+}
+table.overviewSummary  {
+    padding:0px;
+    margin-left:0px;
+}
+table.overviewSummary td.colFirst, table.overviewSummary th.colFirst,
+table.overviewSummary td.colOne, table.overviewSummary th.colOne {
+    width:25%;
+    vertical-align:middle;
+}
+table.packageSummary td.colFirst, table.overviewSummary th.colFirst {
+    width:25%;
+    vertical-align:middle;
+}
+/*
+Content styles
+*/
+.description pre {
+    margin-top:0;
+}
+.deprecatedContent {
+    margin:0;
+    padding:10px 0;
+}
+.docSummary {
+    padding:0;
+}
+/*
+Formatting effect styles
+*/
+.sourceLineNo {
+    color:green;
+    padding:0 30px 0 0;
+}
+h1.hidden {
+    visibility:hidden;
+    overflow:hidden;
+    font-size:.9em;
+}
+.block {
+    display:block;
+    margin:3px 0 0 0;
+}
+.strong {
+    font-weight:bold;
+}
diff --git a/doc/tips/tip17.html b/doc/tips/tip17.html
index 7659334..f71c5ee 100644
--- a/doc/tips/tip17.html
+++ b/doc/tips/tip17.html
@@ -10,4 +10,5 @@ The action bar can provide quick keyboard access to editor features which do not
 <li><b>C+ENTER</b> <code>vfs.browser.dock-position=left</code>
 <li><b>C+ENTER</b> <code>vfs.browser.shortcut=F3</code>
 <li><b>C+ENTER</b> <code>view.fontsize=14</code>
+</ul>
 </body></html>
diff --git a/doc/users-guide/activity-log.xml b/doc/users-guide/activity-log.xml
index 7629bd9..28144e2 100644
--- a/doc/users-guide/activity-log.xml
+++ b/doc/users-guide/activity-log.xml
@@ -2,7 +2,7 @@
 
 <appendix id="activity-log">
     <!-- jEdit buffer-local properties: -->
-    <!-- :indentSize=4:noTabs=true: -->
+    <!-- :indentSize=2:noTabs=true: -->
     <!-- :xml.root=users-guide.xml: -->
     <title>The Activity Log</title>
 
diff --git a/doc/users-guide/basics.xml b/doc/users-guide/basics.xml
index 17d1a60..f36e951 100644
--- a/doc/users-guide/basics.xml
+++ b/doc/users-guide/basics.xml
@@ -2,7 +2,7 @@
 <chapter id="basics">
     <title>jEdit Basics</title>
     <!-- jEdit buffer-local properties: -->
-    <!-- :indentSize=1:noTabs=true: -->
+    <!-- :indentSize=2:noTabs=true:wrap=hard:maxLineLen=90: -->
     <!-- :xml.root=users-guide.xml: -->
 
     <section id="overview">
@@ -18,10 +18,10 @@
         completely separates the two concepts. A buffer might be visible in
         several views, or none at all.</para>
 
-        <para>A <firstterm>TextArea</firstterm> is an editor for a buffer.
-        An <firstterm>EditPane</firstterm> contains a TextArea plus optional buffer switcher.
+        <para>A <firstterm>TextArea</firstterm> is an editor for a buffer. An
+        <firstterm>EditPane</firstterm> contains a TextArea plus optional buffer switcher.
         A View contains one EditPane by default, and additional panes are created whenever
-        the View is split.  </para>
+        the View is split. </para>
 
         <para>The drop-down buffer switcher list at the top of each EditPane shows
         a BufferSet, or a set of open buffers (see <xref linkend="buffersets" />).
@@ -64,11 +64,10 @@
         dialog box.</para>
 
         <para> The gutter is divided into two sections. Right-clicking on the left side
-        gives you a context menu, while right-clicking on the right side (where line numbers might be)
-        toggles a marker at that position.
-        Text can be selected by left-clicking and dragging on right side of the gutter,
-        over the range of lines you wish to select.
-        </para>
+        gives you a context menu, while right-clicking on the right side (where line
+        numbers might be) toggles a marker at that position. Text can be selected by
+        left-clicking and dragging on right side of the gutter, over the range of lines
+        you wish to select. </para>
 
     </section>
 
@@ -99,6 +98,10 @@
         Vertically</guimenuitem> (shortcut: <keycap>C+3</keycap>) splits the
         View into two TextAreas, placed next to each other.</para>
 
+        <para><guimenu>Macros</guimenu>><guimenu>Interface</guimenu>>
+        <guimenu>Splitpane Grow</guimenu> grows the size of the currently focused
+        TextArea. </para>
+        
         <para><guimenu>View</guimenu>><guimenuitem>Unsplit
         Current</guimenuitem> (shortcut: <keycap>C+0</keycap>) removes the split
         containing the current TextArea only.</para>
@@ -118,18 +121,15 @@
         Area</guimenuitem> (shortcut: <keycap>A+PAGE_DOWN</keycap>) shifts
         keyboard focus to the next TextArea.</para>
 
-        <para><guimenu>Macros</guimenu>><guimenu>Interface</guimenu>>
-        <guimenu>Splitpane Grow</guimenu> grows the size of the currently focused
-        TextArea. </para>
 
     </section>
 
     <section id="buffers">
         <title>Switching Buffers</title>
 
-        <para>Each EditPane has an optional drop-down BufferSwitcher at the top.
-        The BufferSwitcher shows the current buffer and can also be used to
-        switch the current buffer, using menu item commands and their keyboard shortcuts.</para>
+        <para>Each EditPane has an optional drop-down BufferSwitcher at the top. The
+        BufferSwitcher shows the current buffer and can also be used to switch the current
+        buffer, using menu item commands and their keyboard shortcuts.</para>
 
         <para><guimenu>View</guimenu>><guimenuitem>Go to Previous
         Buffer</guimenuitem> (keyboard shortcut: <keycap>C+PAGE_UP</keycap>)
@@ -194,29 +194,31 @@
         <para> The buffer sets feature helps keep the buffer lists local and manageable when using
         jEdit in a multiple-View and multiple-EditPane environment. </para>
 
-        <para> As mentioned in the previous section, each EditPane can show a Buffer Switcher, which
-        displays the contents of a BufferSet. In jEdit 4.2, all EditPane buffer switchers
-        showed the same BufferSet: a global list of all buffers that were opened from any EditPane in any View.
-        When using many Views and EditPanes, this resulted in large lists of buffers, and made
-        the next/previous buffer actions useless with many Views, EditPanes and Buffers.
-        </para>
+        <para> As mentioned in the previous section, each EditPane can show a Buffer
+        Switcher, which displays the contents of a BufferSet. In jEdit 4.2, all EditPane
+        buffer switchers showed the same BufferSet: a global list of all buffers that were
+        opened from any EditPane in any View. When using many Views and EditPanes, this
+        resulted in large lists of buffers, and made the next/previous buffer actions
+        useless with many Views, EditPanes and Buffers. </para>
 
-        <para> In jEdit 4.3, it is possible to have more narrow scopes for the BufferSets
+        <para> Since jEdit 4.3, it is possible to have more narrow scopes for the BufferSets
         of an EditPane. This makes the 'next-buffer' and 'previous-buffer' actions switch
         between buffers that are local to the view or pane. </para>
 
         <para>
         The three BufferSet scopes are: </para>
 
-        <orderedlist>
-            <listitem><para> <emphasis role="bold">Global</emphasis>: Includes all buffers open from any EditPane. </para></listitem>
-            <listitem><para> <emphasis role="bold">View</emphasis>: EditPanes in the same
-            View share the same BufferSet. Opening a buffer in one View will not affect the
-            other views. </para></listitem>
-            <listitem><para><emphasis role="bold">EditPane</emphasis>: Each EditPane can have its
-            own independent BufferSet.
-            </para></listitem>
-        </orderedlist>
+        <orderedlist> 
+        
+        <listitem><para> <emphasis role="bold">Global</emphasis>: Includes all buffers
+        open from any EditPane. </para></listitem>
+        
+        <listitem><para> <emphasis role="bold">View</emphasis>: EditPanes in the same View
+        share the same BufferSet. Opening a buffer in one View will not affect the other
+        views. </para></listitem>
+
+        <listitem><para><emphasis role="bold">EditPane</emphasis>: Each EditPane can have
+        its own independent BufferSet. </para></listitem> </orderedlist>
 
         <para> Bufferset scope can be set from <guimenu>Utilities</guimenu>
         ><guimenuitem>Options</guimenuitem> >
@@ -224,14 +226,22 @@
         <guilabel>BufferSet scope:</guilabel>.
         </para>
 
-        <para> <guimenu>File</guimenu> > <guimenuitem>Close</guimenuitem> removes the current buffer from the EditPane's BufferSet only. If it was the last BufferSet to contain that buffer, the buffer is also closed. </para>
+        <para> <guimenu>File</guimenu> > <guimenuitem>Close</guimenuitem> removes the
+        current buffer from the EditPane's BufferSet only. If it was the last BufferSet to
+        contain that buffer, the buffer is also closed. </para>
 
-        <para> The <guimenu> File </guimenu> > <guimenuitem>Close (global)</guimenuitem> action closes the buffer in all EditPanes, as the jEdit 4.2 <guimenu> File </guimenu> > <guimenuitem>Close</guimenuitem> action did before. </para>
+        <para> The <guimenu> File </guimenu> > <guimenuitem>Close
+        (global)</guimenuitem> action closes the buffer in all EditPanes, as the jEdit 4.2
+        <guimenu> File </guimenu> > <guimenuitem>Close</guimenuitem> action did before.
+        </para>
 
-        <para> When <guimenuitem>Exclusive Buffersets</guimenuitem> are enabled, any time a buffer is visited in one EditPane, it should be automatically closed in other EditPanes which use a disjoint (non-intersecting) BufferSet. </para>
+        <para> When <guimenuitem>Exclusive Buffersets</guimenuitem> are enabled, any time
+        a buffer is visited in one EditPane, it should be automatically closed in other
+        EditPanes which use a disjoint (non-intersecting) BufferSet. </para>
 
         <para> <guimenuitem>Close Others</guimenuitem> will clear the BufferSet of the
-        current EditPane by performing a <guimenuitem>Close</guimenuitem> on all items except those buffers which are displayed in another active EditPane. </para>
+        current EditPane by performing a <guimenuitem>Close</guimenuitem> on all items
+        except those buffers which are displayed in another active EditPane. </para>
 
         <bridgehead> Switching Bufferset Scopes </bridgehead>
 
@@ -250,7 +260,9 @@
     <section id="docking">
         <title>Window Docking Layouts</title>
 
-        <para> A docking layout is similar to an Eclipse "Perspective" in that it describes a set of dockable windows that are visible to the user at any given time, hiding the rest. </para>
+        <para> A docking layout is similar to an Eclipse "Perspective" in that it
+        describes a set of dockable windows that are visible to the user at any given
+        time, hiding the rest. </para>
 
         <para>Various jEdit and plugin windows can be docked into the View for
         convenience. Dockable windows have a popup button in their top-left
@@ -265,29 +277,37 @@
         floating instance of the current window.</para>
 
         <para>The commands in the
-        <guimenu>View</guimenu>><guisubmenu>Docking</guisubmenu> menu move keyboard focus between docking areas.</para>
-
-
-        <para>
-        After you have customized the layout of your dockables and wish to save it for export/import, use the actions <guimenu>View</guimenu> - <guimenu>Docking</guimenu> - <guimenuitem>Save/Load Docking Layout</guimenuitem>. </para>
-        <para> It is possible to configure a Dockable layout for just one or a handful of edit modes. This makes it possible to save or load your dockable layout with the same keyboard shortcut (or automatically) based on the edit mode of your current buffer.
-        </para>
-
-        <para>
-        It is also possible to save/load a layout for a particular edit mode. The loading and saving can be done automatically, as configured in the global options docking pane when the mode of the buffer changes, or manually in response to invoking <guimenu>View</guimenu> - <guimenu>Docking</guimenu> - <guimenuitem>Save/Load Docking Layout for current mode.</guimenuitem>
-        </para>
+        <guimenu>View</guimenu>><guisubmenu>Docking</guisubmenu> menu move keyboard
+        focus between docking areas.</para>
+
+
+        <para> After you have customized the layout of your dockables and wish to save it
+        for export/import, use the actions <guimenu>View</guimenu> -
+        <guimenu>Docking</guimenu> - <guimenuitem>Save/Load Docking Layout</guimenuitem>.
+        </para> 
+        
+        <para> It is possible to configure a Dockable layout for just one or a handful of
+        edit modes. This makes it possible to save or load your dockable layout with the
+        same keyboard shortcut (or automatically) based on the edit mode of your current
+        buffer. </para>
+
+        <para> It is also possible to save/load a layout for a particular edit mode. The
+        loading and saving can be done automatically, as configured in the global options
+        docking pane when the mode of the buffer changes, or manually in response to
+        invoking <guimenu>View</guimenu> - <guimenu>Docking</guimenu> -
+        <guimenuitem>Save/Load Docking Layout for current mode.</guimenuitem> </para>
 
         <para>Dockable windows can be further configured in the
         <guilabel>Docking</guilabel> pane of the
-        <guimenu>Utilities</guimenu>><guimenuitem>Global
-        Options</guimenuitem> dialog box. See <xref linkend="docking-pane"/> for details.
-        </para>
+        <guimenu>Utilities</guimenu>><guimenuitem>Global Options</guimenuitem> dialog
+        box. See <xref linkend="docking-pane"/> for details. </para>
 
 
         <sidebar>
             <title>For keyboard/power users</title>
 
-            <para>Each dockable has three commands associated with it; one is part of the menu bar and opens the dockable. The other two commands are:</para>
+            <para>Each dockable has three commands associated with it; one is part of the
+            menu bar and opens the dockable. The other two commands are:</para>
 
             <itemizedlist>
                 <listitem>
@@ -323,6 +343,7 @@
 
         <itemizedlist>
             <listitem>
+            
                 <para>Caret position information:</para>
                 <itemizedlist>
                     <listitem>
@@ -352,10 +373,6 @@
                     </listitem>
 
                 </itemizedlist>
-                <para>
-                    All of the above information is configurable in the Global Options
-                    for the status bar.
-                </para>
                 <para>Double-clicking on the caret location indicator displays
                 the <guimenu>Edit</guimenu>><guimenuitem>Go to
                 Line</guimenuitem> dialog box; see <xref
@@ -433,7 +450,10 @@
 
                 </itemizedlist>
             </listitem>
-
+            <listitem><para>
+              A <guimenuitem>Task Monitor</guimenuitem> widget, which spins with 
+              activity when a background task is running, and also lists how many
+              tasks are running. Clicking on this will open the Task Monitor dockable (<xref linkend="task-monitor"/>). </para></listitem>
             <listitem>
                 <para>A Java heap memory usage indicator, that shows used and
                 total heap memory, in megabytes. Double-clicking this indicator
@@ -443,7 +463,7 @@
             </listitem>
         </itemizedlist>
 
-        <para>The visibility of each of the above items can be controlled in the
+        <para>The order and visibility of each of the above items can be controlled in the
         <guibutton>Status Bar</guibutton> pane of the
         <guimenu>Utilities</guimenu>><guimenuitem>Options</guimenuitem>
         dialog box; see <xref
diff --git a/doc/users-guide/bsh-commands.xml b/doc/users-guide/bsh-commands.xml
index f5a8781..fd2320d 100644
--- a/doc/users-guide/bsh-commands.xml
+++ b/doc/users-guide/bsh-commands.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <chapter id="bsh-commands">
 <!-- jEdit buffer local properties:
-      :indentSize=1:noTabs=yes:maxLineLen=72:tabSize=2:
+      :indentSize=2:noTabs=yes:maxLineLen=90:tabSize=2:
       :xml.root=users-guide.xml:
       jEdit 3.2 Macro Guide, (C) 2001 John Gellene
       Thu Jun 21 23:49:14 EDT 2001 @200 /Internet Time/ -->
diff --git a/doc/users-guide/conventions.xml b/doc/users-guide/conventions.xml
index 3cd41dd..8dca2d3 100644
--- a/doc/users-guide/conventions.xml
+++ b/doc/users-guide/conventions.xml
@@ -2,7 +2,7 @@
 <chapter id="conventions">
     <title>Conventions</title>
     <!-- jEdit buffer-local properties: -->
-    <!-- :tabSize=1:indentSize=1:noTabs=true: -->
+    <!-- :tabSize=2:indentSize=2:noTabs=true: -->
     <!-- :xml.root=users-guide.xml: -->
 
     <para>Several conventions are used throughout jEdit's user interface and
diff --git a/doc/users-guide/customizing.xml b/doc/users-guide/customizing.xml
index a1b5162..a289b87 100644
--- a/doc/users-guide/customizing.xml
+++ b/doc/users-guide/customizing.xml
@@ -2,7 +2,7 @@
 <chapter id="customizing">
     <title>Customizing jEdit</title>
     <!-- jEdit buffer-local properties: -->
-    <!-- :tabSize=1:indentSize=1:noTabs=true:wrap=soft:maxLineLen=0: -->
+    <!-- :tabSize=2:indentSize=2:noTabs=true:wrap=soft:maxLineLen=90: -->
     <!-- :xml.root=users-guide.xml: -->
 
     <section id="buffer-opts">
@@ -458,18 +458,18 @@
             such as the directory where plugins are to be installed. In addition, you can set the time in minutes that the pluginlist can be cached from jedit.org, helping to reduce the server load. See <xref
             linkend="using-plugins" />.</para>
             
-            <para> If the option "disable obsolete plugins" is enabled, then plugins
+            <para> If the option <guimenuitem>Disable Obsolete Plugins</guimenuitem> is checked, then plugins
             that were released on Plugin Manager will be checked against the plugins you have
             installed, for those with a maximum jEdit version that is lower than the one you are 
-            running. Plugins are marked with a maximum version when they are found to be broken or somehow
+            running. Plugins are marked with a maximum jEdit version when they are found to be broken or somehow
             incompatible with a given jEdit release. 
             Until an update is made available for such a plugin
-            on Plugin Manager, these plugins are automatically unloaded and marked unsupported. </para>
+            on Plugin Manager, these plugins are automatically unloaded and marked unsupported. This should improve the stability of jEdit.  </para>
             
             <para> If you re-enable a plugin that was disabled this way, it will remain loaded until the
-            next time the plugin list checked - whenever the user
-            selects the Update or Install tab from Plugin Manager. If you un-check this option,
-            then obsolete plugins will not be automatically disabled in this way. </para>
+            next time the plugin list is checked - whenever the user
+            selects the <guibutton>Update</guibutton> or <guibutton>Install</guibutton> tab from Plugin Manager. If you un-check this option,
+            then plugins will not be automatically disabled in this way. </para>
             
             
         </section>
@@ -492,12 +492,13 @@
             connections, for example when downloading plugins.</para>
         </section>
 
-        <section id="autosave-backups-pane">
+        <section id="saving-backup-pane">
             <title>The Saving and Backup Pane</title>
 
             <para>The <guibutton>Saving and Backup</guibutton> option pane contains
             settings for the autosave and backup features. See <xref
             linkend="autosave" /> and <xref linkend="backups" />.</para>
+
         </section>
 
         <section id="shortcuts-pane">
@@ -551,7 +552,7 @@
             <para>The <guibutton>Status Bar</guibutton>, its API, and its corresponding option
             pane contains settings to customize
             which widgets are in the status bar, their order, and what separators exist
-            between them. Or, you can disable it completely, for regular and/or plain views.
+            between them. Also, you can disable it completely, for regular and/or plain views.
             See <xref linkend="status-bar" />.</para>
 
             <para> From the <literal>Options</literal> tab, you can
@@ -611,10 +612,24 @@
             <title>The View Pane</title>
 
             <para>The <guibutton>View</guibutton> option pane lets you change
-            various settings related to the editor window's appearance,
-            including the arrangement of dockable windows, and if the search bar
-            and buffer switcher should be visible. See <xref
+            various settings related to the editor main window appearance,
+            including the arrangement of dockable windows, whether the search bar
+            and buffer switcher are visible, and whether menu, toolbar, and
+            statusbar are visible in full-screen mode. See <xref
             linkend="views" />.</para>
+            
+            <para> You can choose the default bufferset scope here, as well as whether/how you want buffersets to be sorted in buffer switchers. See <xref linkend="buffersets"/> for more details. </para>
+            
+            <para> If <guimenuitem>Abbreviate paths with environment variables when
+            possible</guimenuitem> is checked, you will notice that jEdit displays
+            abbreviated versions of file paths when it can, using
+            <literal>$VARIABLE/name.ext</literal> or
+            <literal>%VARIABLE%\name.ext</literal> syntax, depending on your platform.
+            Abbreviating is used in the File System Browser, as well as in the window
+            title, and in plugins, to save horizontal space. Reverse-expansions also work
+            as you would expect them to, with both syntaxes recognized on both platforms.
+            </para>
+
         </section>
 
         <section id="vfs-browser-pane">
@@ -632,7 +647,7 @@
     <section id="settings-directory">
         <title>The jEdit Settings Directory</title>
 
-        <para>jEdit stores settings, macros, and plugins as files inside the
+        <para>jEdit stores settings, keymaps, macros, and plugins as files inside the
         <firstterm>settings directory</firstterm>. In most cases, editing these
         files by hand is not necessary, since graphical tools and editor
         commands can do the job. However, being familiar with the structure of
@@ -689,7 +704,7 @@
                 which contains the full activity log. See <xref
                 linkend="activity-log" />.</para>
             </listitem>
-
+            
             <listitem>
                 <para><filename>history</filename> - a plain text file which
                 stores history lists, used by history text fields and the
@@ -710,7 +725,13 @@
                 are automatically updated when plugins are installed or
                 updated.</para>
             </listitem>
-
+            <listitem>
+              <para><filename>keymaps</filename> - this directory
+              contains collections of named keyboard shortcuts
+              which can be defined from the Shortcuts Option Pane (see <xref linkend="shortcuts-pane"/>).  </para>
+            </listitem>
+              
+            
             <listitem>
                 <para><filename>killring.xml</filename> - stores recently
                 deleted text. See <xref linkend="text-transfer" />.</para>
@@ -781,6 +802,10 @@
                 contains numbered backups of all automatically-written settings
                 files.</para>
             </listitem>
+            <listitem><para><filename>startup</filename> - This directory
+              contains startup scripts in beanshell or other plugin-supported scripting
+              languages. They are run at the time jEdit starts, after the <filename>startup</filename> scripts in the jEdit install directory have been run. See <xref linkend="startup-scripts" /></para>
+            </listitem>
         </itemizedlist>
 
         <section id="propertiesfile">
@@ -799,19 +824,21 @@
 
         <section id="sitepropertiesfiles">
             <title>Site Properties</title>
+            
+            
             <para>
-                You may also put properties files in the "properties" directory in
-                the jEdit home directory (NOT the .jedit settings directory). You
+                You may also put properties files in the <filename>properties</filename> directory under 
+                the jEdit home directory (NOT the jedit settings directory). You
                 can locate the jEdit home directory by going to the Utilities menu
-                directory, then the "jEdit Home Directory" menu item, and the first
+                directory, then the <guimenuitem>jEdit Home Directory</guimenuitem> menu item, and the first
                 item in the pullout menu will be the location of the jEdit home
-                directory. This is intended for site-wide settings and it is
-                useful for things like a set of custom key bindings that you might
-                want to share between different computers. This lets you keep your
-                custom properties separate from the jEdit properties, so they are
-                easier to find, edit, and move between machines. Note that your
+                directory. This is intended for site-wide settings. This lets you keep 
+                custom user properties separate from the jEdit site-wide properties, so they are easier to find, edit, and move between machines. Note that your
                 custom properties files must have ".props" as the file name extension.
             </para>
+            <para> 
+              Prior to jEdit 5.0, this was also where site-wide keyboard shortcuts were placed, but now you can define custom sets of shortcuts as keymap files. These files can be cloned and edited from the Shortcuts Option Pane, or edited by hand. To place them in a system-wide location, copy them into the <filename>keymaps</filename> folder under the jedit home directory. 
+            </para>
             <para>
                 Site properties files are read in alphabetically by file name. This means
                 that if you have a property with the same name in more than one file,
@@ -821,6 +848,7 @@
             <para>
                 You can edit these files inside jEdit - changes made to these files will not be re-read until the next time jEdit is started.
             </para>
+            
         </section>
     </section>
 </chapter>
diff --git a/doc/users-guide/dialog-macro.xml b/doc/users-guide/dialog-macro.xml
index 00fac1f..3ac25e2 100644
--- a/doc/users-guide/dialog-macro.xml
+++ b/doc/users-guide/dialog-macro.xml
@@ -3,11 +3,11 @@
     <title>A Dialog-Based Macro</title>
     <!-- jEdit 4.x Macro Guide, (C) 2001, 2002 John Gellene         -->
     <!-- jEdit buffer-local properties:                             -->
-    <!-- :indentSize=1:noTabs=yes:maxLineLen=80:tabSize=2:          -->
+    <!-- :indentSize=2:noTabs=yes:maxLineLen=90:tabSize=2:          -->
     <!-- :xml.root=users-guide.xml:                                 -->
     <!-- This file contains an extended discussion of a             -->
     <!-- dialog-based macro example "Add_Prefix_and_Suffix.bsh"     -->
-    <!-- $Id: dialog-macro.xml 20055 2011-10-06 18:08:48Z ezust $   -->
+    <!-- $Id: dialog-macro.xml 23334 2013-11-15 00:19:31Z ezust $   -->
 
     <para>Now we will look at a more complicated macro which will demonstrate
     some useful techniques and BeanShell features.</para>
diff --git a/doc/users-guide/files.xml b/doc/users-guide/files.xml
index 954d1bf..f98c606 100644
--- a/doc/users-guide/files.xml
+++ b/doc/users-guide/files.xml
@@ -3,7 +3,7 @@
     <title>Working With Files</title>
 
     <!-- jEdit buffer-local properties: -->
-    <!-- :tabSize=1:indentSize=1:noTabs=true:wrap=soft:maxLineLen=80: -->
+    <!-- :tabSize=2:indentSize=2:noTabs=true:wrap=soft:maxLineLen=90: -->
     <!-- :xml.root=users-guide.xml: -->
 
     <section id="creating">
@@ -134,7 +134,7 @@
             <guibutton>Autosave and Backup</guibutton> pane of the
             <guimenu>Utilities</guimenu>><guimenuitem>Options</guimenuitem>
             dialog box; see <xref
-            linkend="autosave-backups-pane" />.</para>
+            linkend="saving-backup-pane" />.</para>
         </section>
 
         <section id="backups">
@@ -149,7 +149,7 @@
             <guibutton>Autosave and Backup</guibutton> pane of the
             <guimenu>Utilities</guimenu>><guimenuitem>Options</guimenuitem>
             dialog box; see <xref
-            linkend="autosave-backups-pane" />.`</para>
+            linkend="saving-backup-pane" />.</para>
 
             <para>The default behavior is to back up the original contents to
             the buffer's file name suffixed with a tilde (<quote>~</quote>). For
@@ -617,12 +617,13 @@
         asking for confirmation first.</para>
     </section>
 
-    <section id="threaded-io">
-        <title>I/O tasks</title>
+    <section id="task-monitor">
+        <title>Task Monitor, and background I/O tasks</title>
 
         <para>To improve responsiveness and perceived performance, jEdit
-        executes all buffer input/output tasks asynchronously.
-        When a task such as this is in progress, the status bar displays the number of running tasks. </para>
+        executes all buffer input/output tasks asynchronously. Plugins should
+        do the same. 
+        When a task such as this is in progress, the status bar should display the number of running tasks and an icon that spins. If you do not see this, you can add the widget from the <xref linkend="status-bar-pane"/>.  </para>
 
         <para>The
         <guimenu>Utilities</guimenu>><guisubmenu>Troubleshooting</guisubmenu>>
diff --git a/doc/users-guide/globs.xml b/doc/users-guide/globs.xml
index eb3d33e..0fc7c4e 100644
--- a/doc/users-guide/globs.xml
+++ b/doc/users-guide/globs.xml
@@ -4,7 +4,7 @@
 
     <!-- jEdit buffer-local properties: -->
 
-    <!-- :indentSize=1:noTabs=true: -->
+    <!-- :indentSize=2:noTabs=true: -->
 
     <!-- :xml.root=users-guide.xml: -->
 
diff --git a/doc/users-guide/history.xml b/doc/users-guide/history.xml
index 32f9155..a85a37d 100644
--- a/doc/users-guide/history.xml
+++ b/doc/users-guide/history.xml
@@ -2,7 +2,7 @@
 <appendix id="history">
     <title>History Text Fields</title>
     <!-- jEdit buffer-local properties: -->
-    <!-- :indentSize=1:noTabs=true: -->
+    <!-- :indentSize=2:noTabs=true: -->
     <!-- :xml.root=users-guide.xml: -->
 
     <para>The text fields in many jEdit components, such as the file system
diff --git a/doc/users-guide/installing-modes.xml b/doc/users-guide/installing-modes.xml
index 4b66e82..5f0d1b1 100644
--- a/doc/users-guide/installing-modes.xml
+++ b/doc/users-guide/installing-modes.xml
@@ -2,7 +2,7 @@
 <chapter id="installing-modes">
     <title>Installing Edit Modes</title>
     <!-- jEdit buffer-local properties: -->
-    <!-- :indentSize=1:noTabs=true: -->
+    <!-- :indentSize=2:noTabs=true: -->
     <!-- :xml.root=users-guide.xml: -->
     <para>jEdit looks for edit modes in two locations; the
     <filename>modes</filename> subdirectory of the jEdit settings directory, and
@@ -69,4 +69,14 @@
         an edit mode in the system catalog, the version in the user-specific
         catalog will override the system default.</para>
     </tip>
+
+    <para> When a buffer is opened, jEdit must choose an edit mode for that buffer.
+    It checks conditions in this order to decide which edit mode to use: </para>
+
+    <orderedlist>
+    <listitem><para> the filename is an exact match for the <literal>FILE_NAME_GLOB</literal>. </para></listitem>
+    <listitem><para> the filename matches the <literal>FILE_NAME_GLOB</literal> and the first line of the file matches the <literal>FIRST_LINE_GLOB</literal></para></listitem>
+    <listitem><para> the filename matches the <literal>FILE_NAME_GLOB</literal> </para></listitem>
+    <listitem><para> the first line of the file matches the <literal>FIRST_LINE_GLOB</literal></para></listitem>
+    </orderedlist>
 </chapter>
\ No newline at end of file
diff --git a/doc/users-guide/launcher-guide.xml b/doc/users-guide/launcher-guide.xml
index 19e092c..5bc8b7c 100644
--- a/doc/users-guide/launcher-guide.xml
+++ b/doc/users-guide/launcher-guide.xml
@@ -3,7 +3,7 @@
 <appendix id="launcher-guide">
     <title>jEditLauncher for Windows</title>
     <!-- jEdit buffer-local properties:                           -->
-    <!-- :tabSize=2:indentSize=1:noTabs=true:maxLineLen=80:       -->
+    <!-- :tabSize=2:indentSize=2:noTabs=true:maxLineLen=90:       -->
     <!-- jEditLauncher 4.0 (R2) Quick Guide                       -->
     <!-- Copyright (C) 2001, 2002 John Gellene                    -->
 
diff --git a/doc/users-guide/macro-basics.xml b/doc/users-guide/macro-basics.xml
index 28292e2..e77d70f 100644
--- a/doc/users-guide/macro-basics.xml
+++ b/doc/users-guide/macro-basics.xml
@@ -2,7 +2,7 @@
 <chapter id="macro-basics">
     <title>Macro Basics</title>
     <!-- jEdit buffer-local properties:                              -->
-    <!-- :indentSize=1:noTabs=yes:maxLineLen=80:tabSize=2:           -->
+    <!-- :indentSize=2:noTabs=yes:maxLineLen=90:tabSize=2:           -->
     <!-- :xml.root=users-guide.xml:                                  -->
     <!-- This file cover the introductory section of the macro guide -->
 
diff --git a/doc/users-guide/macro-index.xml b/doc/users-guide/macro-index.xml
index 4598215..14bd7ba 100644
--- a/doc/users-guide/macro-index.xml
+++ b/doc/users-guide/macro-index.xml
@@ -4,7 +4,7 @@
     <!-- jEdit 4.0 Macro Guide, (C) 2001 John Gellene      -->
     <!-- jEdit 4.4 Macro Guide, (C) 2010 jedit-devs        -->
     <!-- jEdit buffer-local properties:                    -->
-    <!-- :indentSize=2:noTabs=yes:maxLineLen=80:tabSize=2: -->
+    <!-- :indentSize=2:noTabs=yes:maxLineLen=90:tabSize=2: -->
     <!-- :xml.root=users-guide.xml:                        -->
     <!-- covers index to installed macro set               -->
 
diff --git a/doc/users-guide/macro-tips.xml b/doc/users-guide/macro-tips.xml
index 14b9ae7..b91746a 100644
--- a/doc/users-guide/macro-tips.xml
+++ b/doc/users-guide/macro-tips.xml
@@ -2,7 +2,7 @@
 <chapter id="macro-tips">
     <title>Macro Tips and Techniques</title>
     <!-- jEdit buffer-local properties:                             -->
-    <!-- :indentSize=1:noTabs=yes:maxLineLen=0:wrap=soft:tabSize=2: -->
+    <!-- :indentSize=2:noTabs=yes:maxLineLen=90:wrap=soft:tabSize=2: -->
     <!-- :xml.root=users-guide.xml:                                 -->
 
     <section id="macro-tips-input">
diff --git a/doc/users-guide/plugin-implement.xml b/doc/users-guide/plugin-implement.xml
index 6c46051..c6a5936 100644
--- a/doc/users-guide/plugin-implement.xml
+++ b/doc/users-guide/plugin-implement.xml
@@ -2,10 +2,10 @@
 <chapter id="plugin-implement">
     <!-- jEdit buffer-local properties: -->
     <!-- :xml.root=users-guide.xml: -->
-    <!-- :maxLineLen=80:wrap=soft: -->
+    <!-- :maxLineLen=90:wrap=soft: -->
     <title>Implementing a Simple Plugin</title>
-    <!-- jEdit 4 Plugin Guide, (C) 2001, 2002 John Gellene      -->
-    <!-- jEdit 4.5 Plugin Guide, (C) 2005, 2011 Alan Ezust      -->
+    <!-- jEdit Plugin Guide, (C) 2001-2013 John Gellene, Alan Ezust      -->
+
 
     <para>There are many applications for the leading operating systems that
     provide a <quote>scratch-pad</quote> or <quote>sticky note</quote> facility
@@ -315,7 +315,7 @@ options.quicknotepad.filepath=
     </section>
 
     <section id="plugin-implement-properties">
-        <title>The Property File</title>
+        <title>The Property Files</title>
 
         <para>jEdit maintains a list of <quote>properties</quote>, which are
         name/value pairs used to store human-readable strings, user settings,
@@ -453,8 +453,17 @@ options.quicknotepad.filepath=</programlisting>
             of property files.</para>
         </tip>
 
-    </section>
 
+      <section id="localizationfiles"> 
+      <title> Localization Files </title>
+      
+      <para> In addition to property files ending in <literal>.props</literal>,
+      you will find property files with the names like       <literal>lang_de.properties</literal>. Each of these files provides
+      localized strings for a particular locale. In the example above, it is for the German locale. These files are loaded by jEdit automatically when that locale is in use. They need to have a different filename extension from the other property files so they can be treated differently from 
+      the regular properties. </para>
+      </section>
+      
+    </section>
     <section id="plugin-implement-editbus">
         <title>The EditBus</title>
 
@@ -542,9 +551,9 @@ else if(msg instanceof ViewUpdate) {
     </section>
 
     <section id="plugin-implement-actions">
-        <title>The Actions Catalog</title>
+        <title>The Actions.xml Catalog</title>
 
-        <para>Actions define procedures that can be bound to a menu item, a
+        <para>In jEdit as well as in Plugins, actions define procedures that can be bound to a menu item, a
         toolbar button or a keyboard shortcut. Most plugin Actions <footnote>
                 <para>Some plugins, such as Sidekick, Console, and
                 ProjectViewer, create pure Java EditAction-derived Actions,
@@ -591,6 +600,11 @@ else if(msg instanceof ViewUpdate) {
 </ACTIONS></programlisting>
         </informalexample>
 
+        <tip> <title> Actions in jEdit core </title>
+        <para> You can see how each action in jEdit core is implemented by
+        inspecting the <literal>actions.xml</literal> file that is there. </para>
+        </tip>        
+        
         <para>This file defines three actions. They each use a built-in variable
         <literal>wm</literal>, which refers to the current view's <ulink
         url="../api/org/gjt/sp/jedit/gui/DockableWindowManager.html">
@@ -636,7 +650,7 @@ else if(msg instanceof ViewUpdate) {
         and on small buttons) and a title (for display in the floating window's
         title bar).</para>
 
-        <para>The jEdit plugin API uses BeanShell to create the top-level
+        <para>The jEdit API uses BeanShell to create the top-level
         visible container of a plugin's interface. The BeanShell code is
         contained in a file named <filename>dockables.xml</filename>. It usually
         is quite short, providing only a single BeanShell expression used to
@@ -684,6 +698,12 @@ else if(msg instanceof ViewUpdate) {
         also contains the public interface you should use for getting, showing,
         hiding, and other interactions with the plugin's top-level
         windows.</para>
+        
+        
+        <tip> <title> jEdit's dockables </title> <para> jEdit has its own
+        <literal>dockables.xml</literal> file that you can inspect to see how
+        jEdit creates its own dockables. </para> </tip>
+        
     </section>
 
     <section id="plugin-implement-services">
@@ -696,11 +716,11 @@ else if(msg instanceof ViewUpdate) {
         defined in the XML plugin. In a way, the dependency is
         bidirectional.</para>
 
-        <para>Similarly, the AntFarm plugin defines but does not instantiate a
-        <literal>Shell</literal> object. It is the Console plugin which creates
-        a specific shell for each available service. SideKick and Console use
-        the ServiceManager to search for services offered by other
-        plugins.</para>
+        <para>Similarly, the SshConsole plugin defines but does not instantiate
+        a <literal>Shell</literal> object. It is the Console plugin which
+        creates a specific shell for each available service. SideKick and
+        Console use the <literal>ServiceManager</literal> to search for services
+        offered by other plugins.</para>
 
         <para>Here is an example of a service from the XML plugin, which extends
         Sidekick:</para>
@@ -733,7 +753,10 @@ else if(msg instanceof ViewUpdate) {
         <para>For more information about services, refer to the <ulink
         url="../api/org/gjt/sp/jedit/ServiceManager.html">ServiceManager</ulink>
         class API documentation. There, you can find out what the tags and
-        attributes mean, as well as how to register and use services.</para>
+        attributes mean, as well as how to register and use services.
+        You can also inspect the <literal>services.xml</literal> file of jEdit
+        core to see what services are offered by jEdit itself. </para>
+        
     </section>
 
     <section id="plugin-implement-quicknotepad">
diff --git a/doc/users-guide/plugin-intro.xml b/doc/users-guide/plugin-intro.xml
index f3a4d7f..e3708df 100644
--- a/doc/users-guide/plugin-intro.xml
+++ b/doc/users-guide/plugin-intro.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <chapter id="plugin-intro">
     <title>Introducing the Plugin API</title>
-    <!-- :indentSize=1:tabSize=2:noTabs=true:wrap=soft:maxLineLen=0:     -->
+    <!-- :indentSize=2:tabSize=2:noTabs=true:wrap=soft:maxLineLen=90:     -->
     <!-- :xml.root=users-guide.xml: -->
     <!-- jEdit buffer-local properties:                         -->
 
@@ -122,7 +122,9 @@
         on a transitional basis. While the majority of plugins are unaffected by
         most changes and will continue working, it is a good idea to monitor the
         jEdit change log, and join the <literal>jedit-devel</literal> mailing list, to keep updated on changes and bug reports, so that you will know when your
-        plugin needs to be updated.
+        plugin needs to be updated. If you allow the source code to be managed
+        by the jEdit project, then other plugin developers can help fix things
+        when they break more easily.
         </para>
     </sidebar>
 </chapter>
diff --git a/doc/users-guide/plugin-tips.xml b/doc/users-guide/plugin-tips.xml
index 3d67343..eeccbf6 100644
--- a/doc/users-guide/plugin-tips.xml
+++ b/doc/users-guide/plugin-tips.xml
@@ -2,9 +2,33 @@
 <chapter id="plugin-tips">
     <title>Plugin Tips and Techniques</title>
     <!-- jEdit buffer-local properties: -->
-    <!-- :tabSize=1:indentSize=1:noTabs=true: -->
+    <!-- :tabSize=2:indentSize=2:noTabs=true: -->
     <!-- :xml.root=users-guide.xml: -->
 
+    <section id="utility-classes">
+    <title> Utility Classes </title>
+    
+    <para> If you need to check what the current running platform is, 
+      see <classname>org.gjt.sp.jedit.OperatingSystem</classname>. </para>
+    
+    <para> If you need to compare file names and don't want to
+    worry about whether you are on a case-sensitive file system or not, 
+    use <function>MiscUtilities.pathsEqual()</function>. See that
+    class for other useful path manipulation routines. </para>
+
+    <para> There are other helpful classes in <package>org.gjt.sp.util</package>,
+      such as <classname>HtmlUtilities</classname>, <classname>StandardUtilities</classname>,
+      <classname>IOUtilities</classname>, and <classname>Log</classname>. 
+      In particular, the <classname>Log</classname> class is recommended 
+      for reporting errors and also logging debug information. 
+    </para>
+
+    <para> If your plugin needs to "find a word" (using word boundaries) somewhere 
+    in the  buffer, you might want to reuse the <classname>org.gjt.sp.jedit.TextUtilities</classname>
+    class. </para>
+    
+    </section>
+
     <section id="plugin-tips-libraries">
         <title>Bundling Additional Class Libraries</title>
 
diff --git a/doc/users-guide/regexps.xml b/doc/users-guide/regexps.xml
index 748e3e8..6f3530e 100644
--- a/doc/users-guide/regexps.xml
+++ b/doc/users-guide/regexps.xml
@@ -2,7 +2,7 @@
 <appendix id="regexps">
     <title>Regular Expressions</title>
     <!-- jEdit buffer-local properties: -->
-    <!-- :indentSize=1:noTabs=yes: -->
+    <!-- :indentSize=2:noTabs=yes: -->
     <!-- :xml.root=users-guide.xml: -->
 
     <para>jEdit uses regular expressions from <ulink
@@ -239,7 +239,7 @@
 
                 <para>There are some known issues with the
                 <literal>java.util.regex</literal> library, as it stands in
-                Sun's Java 1.6. In particular, it is possible to create
+                Java. In particular, it is possible to create
                 regular expressions that hang the JVM, or cause stack overflow
                 errors, which was not as easy to accomplish using the legacy
                 <literal>gnu.regexp</literal> library. If you find that
diff --git a/doc/users-guide/shortcuts.xml b/doc/users-guide/shortcuts.xml
index 49d204b..1a49123 100644
--- a/doc/users-guide/shortcuts.xml
+++ b/doc/users-guide/shortcuts.xml
@@ -3,7 +3,7 @@
     <title>Keyboard Shortcuts</title>
     <!-- This is for the default jEdit keymap. Do we really need this? -->
     <!-- jEdit buffer-local properties: -->
-    <!-- :tabSize=1:indentSize=1:noTabs=true: -->
+    <!-- :tabSize=2:indentSize=2:noTabs=true: -->
     <!-- :xml.root=users-guide.xml: -->
 
     <para>This appendix documents the "jEdit" keymap of keyboard shortcuts.
diff --git a/doc/users-guide/source-edit.xml b/doc/users-guide/source-edit.xml
index 690ca7e..8985cf5 100644
--- a/doc/users-guide/source-edit.xml
+++ b/doc/users-guide/source-edit.xml
@@ -2,7 +2,7 @@
 <chapter id="source-edit">
     <title>Editing Source Code</title>
     <!-- jEdit buffer-local properties: -->
-    <!-- :tabSize=1:indentSize=1:noTabs=true:wrap=soft:maxLineLen=80: -->
+    <!-- :tabSize=2:indentSize=2:noTabs=true:wrap=soft:maxLineLen=90: -->
     <!-- :xml.root=users-guide.xml: -->
 
     <section id="modes">
diff --git a/doc/users-guide/starting.xml b/doc/users-guide/starting.xml
index 4589786..2c5fe35 100644
--- a/doc/users-guide/starting.xml
+++ b/doc/users-guide/starting.xml
@@ -1,9 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <chapter id="starting">
     <title>Starting jEdit</title>
-
     <!-- jEdit buffer-local properties: -->
-    <!-- :tabSize=1:indentSize=1:noTabs=true: -->
+    <!-- :tabSize=2:indentSize=2:maxLineLen=90:wrap=hard:noTabs=true: -->
     <!-- :xml.root=users-guide.xml: -->
 
     <para>Exactly how jEdit is started depends on the operating system. For
@@ -372,4 +371,79 @@
             </informaltable>
         </section>
     </section>
+    <section id="jvm-options"> 
+    <title> Java Virtual Machine Options </title>
+
+      <para> To enable AntiAliasing in the TextArea, see <xref
+      linkend="text-area-pane" />. </para>
+    
+      <para> It is possible to pass command line options to the Java
+      Virtual Machine (JVM). These options can change certain things about how
+      Java runs, such as the maximum heap size, or whether antialiasing is used
+      in certain places. </para>
+
+      <para> For operating systems such as Linux where jEdit is started via a
+      shell script, you can easily edit the <literal>jedit</literal> script and
+      place JVM arguments in the correct place. If you are using the
+      <userinput>-jar</userinput> command line option with the
+      <literal>java</literal> command to run jEdit (which is how the default
+      shell scripts do it), remember that the <userinput>-jar</userinput>
+      parameter must be the last <literal>java</literal> option, followed
+      immediately by the path to <filename>jedit.jar</filename> and then any
+      jEdit command line options.</para>
+      
+      <para> On a Windows install that uses <literal>jEdit.exe</literal>, the
+      JVM options are located in a separate file, called
+      <literal>jEdit.l4j.ini</literal>. Create or edit this file in the same
+      directory as <literal>jEdit.exe</literal> and place one JVM option per
+      line. </para>
+      
+      <para> There is no complete list of options to <literal>java</literal>,
+      since it can vary from one platform to another. Some of can be found by
+      typing the commands <literal>java -?</literal> or <literal>man
+      java</literal>. Common JVM options that are used with jEdit and work on
+      all platforms are: </para>
+      
+      <informaltable>
+        <tgroup cols="2">
+            <colspec colnum="1" colwidth="1.5in" />
+            <colspec colwidth="1*"/>
+
+            <thead>
+              <row>
+                <entry>Option</entry>
+                <entry>Effect</entry>
+              </row>
+            </thead>
+
+            <tbody>
+              <row>
+                  <entry><userinput>-Dawt.useSystemAAFontSettings=on</userinput></entry>
+                  <entry>Antialias the text in AWT components. </entry>
+              </row>
+              <row>
+                  <entry><userinput>-Dswing.aatext=true</userinput></entry>
+                  <entry>Antialias the text in Swing components. </entry>
+              </row>
+              <row>
+                  <entry><userinput>-Djedit.home=/path/to/jedit</userinput>
+                  </entry> 
+                  <entry> Sets/overrides the java System property
+                  <literal>jedit.home</literal> to be the path to the jEdit
+                  install. This tells jEdit where to find its site properties, 
+                  default keymaps, macros, edit modes, and documentation. You can override
+                  this setting to create a custom install that is shared by multiple
+                  users. See <xref linkend="sitepropertiesfiles"/> for more information.
+                  </entry>
+                  </row>
+              <row>
+                  <entry><userinput>-mx768m</userinput></entry>
+                  <entry> Sets maximum heap size to 768 megabytes. 
+                  Adjust this value depending on your own personal needs /
+                  plugins. </entry> 
+              </row>
+            </tbody> 
+          </tgroup>
+       </informaltable>      
+    </section>    
 </chapter>
diff --git a/doc/users-guide/text-edit.xml b/doc/users-guide/text-edit.xml
index bf1c78b..6273be5 100644
--- a/doc/users-guide/text-edit.xml
+++ b/doc/users-guide/text-edit.xml
@@ -2,7 +2,7 @@
 <chapter id="editing">
     <title>Editing Text</title>
     <!-- jEdit buffer-local properties:
-         :tabSize=1:indentSize=1:noTabs=true:wrap=soft:maxLineLen=80:
+         :tabSize=2:indentSize=2:noTabs=true:wrap=soft:maxLineLen=90:
          :xml.root=users-guide.xml: -->
 
     <section id="caret">
@@ -282,6 +282,35 @@
             </note>
         </section>
     </section>
+    
+    <section id="keyboard-focus">
+      <title> Keyboard Focus </title>
+      
+      <para> When the cursor disappears, that means the text area no longer has focus, and when you type, your keystrokes are probably going somewhere else, such as a dockable. To ensure that the keyboard is focused
+      in the textarea, you can always use the mouse and click in it,
+      but a more keyboard-friendly way is preferred when you are just about to start typing anyway. For this reason, a number of jEdit's actions
+      have a side-effect of focusing on the text area as well. <guimenuitem> View - Toggle Full Screen</guimenuitem> is one example. Some others are listed below: 
+      </para>
+      
+      <para> From the <guimenuitem>View - Scrolling</guimenuitem> submenu: 
+        <itemizedlist>
+        <listitem><para> <guimenuitem>Scroll and Center Caret</guimenuitem> </para></listitem>
+        <listitem><para> <guimenuitem>Scroll to Line</guimenuitem></para>
+        </listitem>
+        </itemizedlist>
+      </para>
+      
+      <para> From the <guimenuitem>View - Docking</guimenuitem> submenu:
+        <itemizedlist>
+          <listitem><para> <guimenuitem>Toggle Docked Areas</guimenuitem> </para></listitem>
+          <listitem><para> <guimenuitem>Close current docking area</guimenuitem> </para></listitem>
+        </itemizedlist>
+      </para>
+      
+      
+      <para> In general, jEdit is a keyboard-friendly editor that is also
+      mouse-friendly, so you should never be forced to use a mouse to do anything. </para>
+    </section>
 
     <section id="entering-text">
         <title>Inserting and Deleting Text</title>
@@ -421,7 +450,9 @@
 
         <para><guimenu>Edit</guimenu>><guimenuitem>Go to Line</guimenuitem>
         (shortcut: <keycap>C+l</keycap>) prompts for a line number and moves the
-        caret there.</para>
+        caret there. A relative offset can be used here, if it is prefixed by
+        a + or a - sign. So for example <literal>-5</literal> moves the caret up by
+        5 lines. </para>
 
         <para><guimenu>Edit</guimenu>><guisubmenu>More
         Selection</guisubmenu>><guimenuitem>Select Line Range</guimenuitem>
@@ -525,16 +556,12 @@
                         linkend="buffer-opts" />.</para>
                     </listitem>
 
-                    <listitem>
-                        <para>From the keyboard, if a keyboard shortcut has been
-                        assigned to the <guimenuitem>Toggle Word
-                        Wrap</guimenuitem> command in the
-                        <guibutton>Shortcuts</guibutton> pane of the
-                        <guimenu>Utilities</guimenu>>
-                        <guimenuitem>Options</guimenuitem>
-                        dialog box. By default, this
-                        command does not have a keyboard shortcut.</para>
-                    </listitem>
+                    <listitem> <para>From the keyboard, if a keyboard shortcut
+                    has been assigned to the <guimenuitem>Built-in
+                    Command</guimenuitem> for <guimenuitem>Toggle Word
+                    Wrap</guimenuitem> in the <guibutton>Shortcuts</guibutton>
+                    pane of <guimenu>Global Options</guimenu>. By default, this
+                    command does not have a keyboard shortcut, or appear in any menu. </para> </listitem>
                 </itemizedlist>
             </listitem>
 
@@ -1146,6 +1173,13 @@
             <para>Running searches can be stopped in the
             <guimenu>Utilities</guimenu>><guisubmenu>Troubleshooting</guisubmenu>><guimenuitem>I/O
             Progress Monitor</guimenuitem> dialog box.</para>
+
+            <para>Once the results are shown in the Hypersearch dockable, you can
+            left-click on a result to jump to the position, or right-click to see some
+            "hidden actions". From the top tree-node, for example, you can
+            <guimenuitem>Redo Hypersearch</guimenuitem>, and <guimenuitem>Copy to
+            Clipboard</guimenuitem>. </para>
+            
         </section>
 
         <section>
diff --git a/doc/users-guide/updating-modes.xml b/doc/users-guide/updating-modes.xml
index b0b6061..4fbff72 100644
--- a/doc/users-guide/updating-modes.xml
+++ b/doc/users-guide/updating-modes.xml
@@ -2,7 +2,7 @@
 <chapter id="updating-modes">
     <title>Updating Edit Modes</title>
     <!-- jEdit buffer-local properties: -->
-    <!-- :indentSize=1:noTabs=true: -->
+    <!-- :indentSize=2:noTabs=true: -->
     <!-- :xml.root=users-guide.xml: -->
 
     <section id="currentmodeformat">
diff --git a/doc/users-guide/users-guide.xml b/doc/users-guide/users-guide.xml
index 9b9f565..571aac0 100644
--- a/doc/users-guide/users-guide.xml
+++ b/doc/users-guide/users-guide.xml
@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- jEdit buffer-local properties: -->
-<!-- maxLineLen=0:wrap=soft:indentSize=1:noTabs=true: -->
+<!-- maxLineLen=90:wrap=soft:indentSize=2:noTabs=true: -->
 <!-- jEdit user's guide -->
 <book id="users-guide"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xi="http://www.w3.org/2001/XInclude"  xsi:noNamespaceSchemaLocation='http://www.docbook.org/xsd/4.4/docbook.xsd'>
     <bookinfo>
-        <title>jEdit 5.1 User's Guide</title>
+        <title>jEdit 5.2 User's Guide</title>
 
         <legalnotice>
             <title>Legal Notice</title>
@@ -40,7 +40,7 @@
             
             <revision>
               <revnumber>4.3 - 5.2</revnumber>
-              <date>2005-2013</date>
+              <date>2005-2014</date>
               <author><firstname>Alan</firstname><surname>Ezust</surname></author>
               <revremark> Maintainer. </revremark>
             </revision>
@@ -129,7 +129,11 @@
             <para>Like jEdit itself, plugins are written primarily in Java.
             While this guide assumes some working knowledge of the language, you
             are not required to be a Java wizard. If you can write a useful
-            application of any size in Java, you can write a plugin.</para>
+            application of any size in Java, you can write a plugin. </para>
+            
+            <para>Where applicable, this section will also explain how jEdit's
+            source code is similar. Therefore, this is also a good introduction to 
+            to jEdit development. </para>   
 
         </partintro>
 
diff --git a/doc/users-guide/using-macros.xml b/doc/users-guide/using-macros.xml
index 70ced6c..184e751 100644
--- a/doc/users-guide/using-macros.xml
+++ b/doc/users-guide/using-macros.xml
@@ -2,7 +2,7 @@
 <chapter id="using-macros">
     <title>Using Macros</title>
     <!-- jEdit buffer-local properties:                               -->
-    <!-- :tabSize=1:indentSize=1:noTabs=true:wrap=soft:maxLineLen=80: -->
+    <!-- :tabSize=2:indentSize=2:noTabs=true:wrap=soft:maxLineLen=90: -->
     <!-- :xml.root=users-guide.xml: -->
 
     <para>Macros in jEdit are short scripts written in a scripting language
diff --git a/doc/users-guide/using-plugins.xml b/doc/users-guide/using-plugins.xml
index fa5e968..7535b90 100644
--- a/doc/users-guide/using-plugins.xml
+++ b/doc/users-guide/using-plugins.xml
@@ -2,7 +2,7 @@
 <chapter id="using-plugins">
     <title>Installing and Using Plugins</title>
     <!-- jEdit buffer-local properties: -->
-    <!-- :tabSize=1:indentSize=1:noTabs=true:wrap=hard:maxLineLen=80: -->
+    <!-- :tabSize=2:indentSize=2:noTabs=true:wrap=hard:maxLineLen=90: -->
     <!-- :xml.root=users-guide.xml: -->
     <para>A <firstterm>plugin</firstterm> is an application which is loaded and
     runs as part of another, host application. Plugins respond to user commands
diff --git a/doc/users-guide/writing-modes.xml b/doc/users-guide/writing-modes.xml
index 8d8495a..71db5d9 100644
--- a/doc/users-guide/writing-modes.xml
+++ b/doc/users-guide/writing-modes.xml
@@ -2,7 +2,7 @@
 <chapter id="writing-modes">
     <title>Mode Definition Syntax</title>
     <!-- jEdit buffer-local properties: -->
-    <!-- :indentSize=1:noTabs=true: -->
+    <!-- :indentSize=2:noTabs=true: -->
     <!-- :xml.root=users-guide.xml: -->
     <para>Edit modes are defined using XML, the <firstterm>eXtensible Markup
     Language</firstterm>; mode files have the extension
diff --git a/doc/welcome.html b/doc/welcome.html
index 1ba9eb3..1ffe460 100644
--- a/doc/welcome.html
+++ b/doc/welcome.html
@@ -4,7 +4,7 @@
 
 <center>
 <img src="jedit.png" width="128" height="128">
-<h2>Welcome to jEdit 5.1</h2>
+<h2>Welcome to jEdit 5.2</h2>
 </center>
 <p> Useful menu commands: </p>
 <ul>
diff --git a/doc/whatsnew/news.xml b/doc/whatsnew/news.xml
index bbf8392..a0d1fd5 100644
--- a/doc/whatsnew/news.xml
+++ b/doc/whatsnew/news.xml
@@ -4,45 +4,26 @@
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xsi:noNamespaceSchemaLocation='http://www.docbook.org/xsd/4.4/docbook.xsd'>
 
-    <title> What's new in jEdit 5.1 </title>
+    <title> What's new in jEdit 5.2 </title>
     <articleinfo>
-        <author>
-            <othername>The jEdit all-volunteer development team</othername>
-        </author>
-        <date> 2013 </date>
+        <date> 2014 </date>
     </articleinfo>
 
 
-    <para> Detailed changes can always be found in the <ulink
-    url="../CHANGES.txt">Detailed Change Log</ulink>,
-    but here are some of the major features of this version. </para>
+    <para> This is a time-based release, scheduled to come out about 1 year after
+    jEdit 5.1, and is a collection of enhancements, bug fixes and patches
+    submitted by the community. Detailed changes can be found in the <ulink
+    url="../CHANGES.txt">Detailed Change Log</ulink>.
+    </para>
 
-    <itemizedlist>
+    <para> There are no major new features in this release. You can think of it mostly as
+    a bugfix release, although there are quite a lot of UI enhancements also. </para>
 
-      <listitem><para>VFS WorkThreads have been rewritten into Tasks, making it 
-      possible to completely remove the old "I/O Progress Monitor" and the 
-      wasteful space it took up in the Task Monitor. Old deprecated
-      classes related to WorkThread and WorkThreadPool have been removed.
-      </para></listitem>
+    <para> With continued support from the community, we will keep releasing a newer
+    version each year that can accurately bring together the fruits of everyone's labor.
+    Thank you to each and every one of the contributors who helped make 5.2 the best
+    version of jEdit ever.
+    </para>
 
-      <listitem><para> New Plugin Manager option to check for and disable
-      obsolete plugins. 
-      Enabled by default, this will ensure that old unsupported plugins do not
-      interfere with the running operation of jEdit. </para> 
-    </listitem>
-    <listitem><para> Added another language to our list of translated languages:
-    English, French, German, Japanese, Czech, Russian, and now Chinese!
-    We are always looking for volunteers to help translate jEdit into Hindi,
-    Korean, or Spanish, or any other language, really! It is fairly easy
-    to add a new translation to jEdit or the plugins. 
-    </para></listitem>
-    
-    <listitem><para> There is now a new encoding Native2ASCII which collapses
-    unicode escapes in ISO-8859-1 files on read and expands characters that
-    cannot be encoded with ASCII as unicode escapes on write. This encoding is
-    the one Java properties files should be in. 
-    </para></listitem>
-    
-</itemizedlist> 
-<!-- :maxLineLen=80:wrap=hard: --> 
+<!-- :maxLineLen=90:wrap=hard: -->
 </article>
diff --git a/installer/Install.java b/installer/Install.java
index 82755ca..a1ed846 100644
--- a/installer/Install.java
+++ b/installer/Install.java
@@ -60,12 +60,12 @@ public class Install
 		boolean isGUI = args.length == 0;
 		
 		String javaVersion = System.getProperty("java.version");
-		if(javaVersion.compareTo("1.6") < 0)
+		if(javaVersion.compareTo("1.7") < 0)
 		{
 			errorAndExit(isGUI,
 					  "You are running Java version "
 					+ javaVersion + " from "+System.getProperty("java.vendor")+".\n"
-					+"This installer requires Java 1.6 or later.");
+					+"This installer requires Java 1.7 or later.");
 		}
 
 		if(isRunningFromExclam())
diff --git a/installer/InstallThread.java b/installer/InstallThread.java
index 4a0da1d..33261f5 100644
--- a/installer/InstallThread.java
+++ b/installer/InstallThread.java
@@ -117,6 +117,20 @@ public class InstallThread extends Thread
 				if (fileName.equals("././@LongLink"))
 				{
 					fileName = new BufferedReader(new InputStreamReader(tarInput)).readLine();
+					if(fileName == null)
+					{
+						// missing filename ??
+						throw new IOException("Invalid or corrupt contents: file in tar with long filename but no filename found");
+					}
+					// bug #3837 - can't install because long file name ends with \0
+					while(!fileName.isEmpty() && fileName.charAt(fileName.length()-1) == 0){
+						fileName = fileName.substring(0, fileName.length()-1);
+					}
+					if(fileName.isEmpty())
+					{
+						// filename consists in '\0's ??
+						throw new IOException("Invalid or corrupt contents: file in tar with long filename but empty filename found");
+					}
 					continue;
 				}
 			}
diff --git a/installer/done-MacOS.html b/installer/done-MacOS.html
index b423541..2cda08a 100644
--- a/installer/done-MacOS.html
+++ b/installer/done-MacOS.html
@@ -5,7 +5,7 @@ jEdit has been installed successfully.<p>
 To start jEdit, either double-click on the <tt>jedit.jar</tt> file in the
 install directory, or run the <tt>jedit</tt> command in a terminal window:
 
-<table><tr><td bgcolor="#e0e0e0"><tt><b>$</b> jedit <i>filename</i> ...</td></tt></tr></table>
+<table><tr><td bgcolor="#e0e0e0"><tt><b>$</b> jedit <i>filename</i> ...</tt></td></tr></table>
 
 To find out about supported command-line options, run:
 
diff --git a/installer/done-Unix.html b/installer/done-Unix.html
index 8aaa2ba..8095c76 100644
--- a/installer/done-Unix.html
+++ b/installer/done-Unix.html
@@ -4,7 +4,7 @@ jEdit has been installed successfully.<p>
 
 To start jEdit, run the <tt>jedit</tt> command in a terminal window:
 
-<table><tr><td bgcolor="#e0e0e0"><tt><b>$</b> jedit <i>filename</i> ...</td></tt></tr></table>
+<table><tr><td bgcolor="#e0e0e0"><tt><b>$</b> jedit <i>filename</i> ...</tt></td></tr></table>
 
 To find out about supported command-line options, run:
 
diff --git a/installer/done-VMS.html b/installer/done-VMS.html
index 0c0888f..2c69933 100644
--- a/installer/done-VMS.html
+++ b/installer/done-VMS.html
@@ -4,10 +4,10 @@ jEdit has been installed successfully.<p>
 
 To start jEdit, run the following command in a terminal window:
 
-<table><tr><td bgcolor="#e0e0e0"><tt><b>$</b> java -jar <i>disk</i>:[<i>dir</i>]jedit.jar <i>filename</i> ...</td></tt></tr></table>
+<table><tr><td bgcolor="#e0e0e0"><tt><b>$</b> java -jar <i>disk</i>:[<i>dir</i>]jedit.jar <i>filename</i> ...</tt></td></tr></table>
 
 To find out about supported command-line options, run:
 
-<table><tr><td bgcolor="#e0e0e0"><tt><b>$</b> java -jar <i>disk</i>:[<i>dir</i>]jedit.jar -usage</td></tt></tr></table>
+<table><tr><td bgcolor="#e0e0e0"><tt><b>$</b> java -jar <i>disk</i>:[<i>dir</i>]jedit.jar -usage</tt></td></tr></table>
 
 </body></html>
diff --git a/ivy.xml b/ivy.xml
index 847b7ba..12fc2a9 100644
--- a/ivy.xml
+++ b/ivy.xml
@@ -48,7 +48,6 @@
 		<conf name="ant-contrib" description="Dependencies for ant-contrib" visibility="private"/>
 		<conf name="docbook" description="Dependencies for translating DocBook files" visibility="private"/>
 		<conf name="fop" description="Dependencies for FOP" visibility="private"/>
-		<conf name="jarbundler" description="Dependencies for JarBundler" visibility="private"/>
 		<conf name="launch4j" description="Dependencies for Launch4j" visibility="private"/>
 		<conf name="scripting" description="Dependencies for Scripting" visibility="private"/>
 		<conf name="default-plugins" description="Shipped default plugins" visibility="private"/>
@@ -67,23 +66,29 @@
 			<artifact name="docbook-xsl" e:classifier="resources" type="zip"/>
 		</dependency>
 		<dependency org="net.sf.docbook" name="docbook-xsl-saxon" rev="1.0.0" conf="docbook"/>
-		<dependency org="xerces" name="xercesImpl" rev="2.10.0" conf="docbook,jarbundler"/>
+		<dependency org="xerces" name="xercesImpl" rev="2.10.0" conf="docbook"/>
 
 		<dependency org="org.apache.xmlgraphics" name="fop" rev="1.0" conf="fop"/>
 
-		<dependency org="net.sf.launch4j" name="launch4j" rev="3.0.2" conf="launch4j">
-			<artifact name="launch4j" e:classifier="win32" type="zip"/>
-			<artifact name="launch4j" e:classifier="macosx" type="tgz"/>
-			<artifact name="launch4j" e:classifier="linux" type="tgz"/>
+		<dependency org="net.sf.launch4j" name="launch4j" rev="3.5.0" conf="launch4j">
+			<artifact name="launch4j" e:classifier="core"/>
+			<artifact name="launch4j" e:classifier="workdir-win32"/>
+			<artifact name="launch4j" e:classifier="workdir-mac"/>
+			<artifact name="launch4j" e:classifier="workdir-linux"/>
+			<!--
+				we do not need the UI and thus abeille, which uses
+				<repository> sections in their POM which Ivy cannot handle
+			-->
+			<exclude org="net.java.abeille" module="abeille"/>
 		</dependency>
 
-		<dependency org="org.jedit.plugins" name="MacOSX" rev="1.2" conf="default-plugins"/>
+		<dependency org="org.jedit.plugins" name="MacOSX" rev="1.3" conf="default-plugins"/>
 		<dependency org="org.jedit.plugins" name="QuickNotepad" rev="5.0" conf="default-plugins"/>
 
 		<dependency org="bsf" name="bsf" rev="2.4.0" conf="scripting"/>
 		<dependency org="org.beanshell" name="bsh" rev="2.0b4" conf="scripting"/>
 		<dependency org="org.bouncycastle" name="bcpg-jdk16" rev="1.46" conf="scripting"/>
 
-		<dependency org="com.google.code.findbugs" name="jsr305" rev="2.0.0"/>
+		<dependency org="com.google.code.findbugs" name="jsr305" rev="3.0.0"/>
 	</dependencies>
 </ivy-module>
diff --git a/ivysettings.xml b/ivysettings.xml
index 1c7156b..7269d0e 100644
--- a/ivysettings.xml
+++ b/ivysettings.xml
@@ -29,17 +29,11 @@
 	<include url="${ivy.default.settings.dir}/ivysettings-default-chain.xml"/>
 
 	<resolvers>
-		<!-- Don't validate because of https://issues.apache.org/jira/browse/IVY-1322,
-		     remove validate after that bug was fixed in Ivy (Bug #3437212) -->
-		<url name="launch4j" validate="false">
-			<artifact pattern="http://downloads.sourceforge.net/project/launch4j/launch4j-3/[revision]/[artifact]-[revision]-[classifier].[ext]" />
-		</url>
 		<url name="jedit-plugins">
 			<artifact pattern="jar:http://downloads.sourceforge.net/project/jedit-plugins/[artifact]/[revision]/[artifact]-[revision]-bin.zip!/[artifact].jar" />
 		</url>
 	</resolvers>
 	<modules>
-		<module organisation="net.sf.launch4j" resolver="launch4j" />
 		<module organisation="org.jedit.plugins" resolver="jedit-plugins" />
 	</modules>
 </ivysettings>
diff --git a/jEdit.iml b/jEdit.iml
index 29348ee..45c09fe 100644
--- a/jEdit.iml
+++ b/jEdit.iml
@@ -16,6 +16,7 @@
     <orderEntry type="inheritedJdk" />
     <orderEntry type="sourceFolder" forTests="false" />
     <orderEntry type="library" scope="TEST" name="Test Dependencies" level="project" />
+    <orderEntry type="library" name="Test Dependencies" level="project" />
   </component>
 </module>
 
diff --git a/keymaps/jEdit_keys.props b/keymaps/jEdit_keys.props
index 32508c4..7b736f2 100644
--- a/keymaps/jEdit_keys.props
+++ b/keymaps/jEdit_keys.props
@@ -198,6 +198,7 @@ select-prev-line.shortcut=S+UP
 next-line.shortcut=DOWN
 select-next-line.shortcut=S+DOWN
 insert-newline-indent.shortcut=ENTER
+insert-newline.shortcut=S+ENTER
 insert-tab-indent.shortcut=TAB
 #}}}
 
diff --git a/macros/Editing/Go_to_Column.bsh b/macros/Editing/Go_to_Column.bsh
index 522cadd..20e927e 100644
--- a/macros/Editing/Go_to_Column.bsh
+++ b/macros/Editing/Go_to_Column.bsh
@@ -5,12 +5,8 @@
  *
  * Copyright (C) 2003 Ollie Rutherfurd <oliver at rutherfurd.net>
  *
- * $Id: Go_to_Column.bsh 21353 2012-03-14 09:46:51Z jojaba_67 $
+ * $Id: Go_to_Column.bsh 23112 2013-08-13 07:18:29Z ezust $
  */
- 
-//Localization
-final static String ColumnBeforeLabel   = jEdit.getProperty("macro.rs.GoToColumn.ColumnBefore.label",  "Column (between 1 and");
-final static String ColumnAfterLabel   = jEdit.getProperty("macro.rs.GoToColumn.ColumnAfter.label",  "):");
 
 //Process
 goToColumn()
@@ -19,7 +15,7 @@ goToColumn()
 	len = textArea.getLineLength(line) + 1;
 	while(true)
 	{
-		col = Macros.input(view, ColumnBeforeLabel + " " + len + " " + ColumnAfterLabel);
+		col = Macros.input(view, jEdit.getProperty("macro.rs.GoToColumn.label", new Integer[]{len}));
 		if(col == null)
 			return;
 		else
diff --git a/macros/Editing/Go_to_Offset.bsh b/macros/Editing/Go_to_Offset.bsh
new file mode 100644
index 0000000..6984a57
--- /dev/null
+++ b/macros/Editing/Go_to_Offset.bsh
@@ -0,0 +1,53 @@
+/*
+ * Go_to_Offset.bsh - a BeanShell macro for the jEdit text
+ * editor - Prompts the user for a offset position on the
+ * current buffer, then moves the caret there.
+ *
+ * Copyright (C) 2013 Thomas Meyer
+ *
+ */
+ 
+
+
+
+//Process
+goToOffset()
+{
+	len = textArea.getBufferLength();
+	while(true)
+	{
+		offset = Macros.input(view, jEdit.getProperty("macro.rs.GoToOffset.label", new Integer[] {len}));
+		if(offset == null)
+			return;
+		else
+		{
+			try
+			{
+				offset = Integer.parseInt(offset);
+				if(offset >= 0 && offset <= len)
+				{
+					textArea.setCaretPosition(offset);
+					textArea.requestFocus();
+					return;
+				}
+			} catch(NumberFormatException e) {
+			}
+		}
+	}
+}
+
+goToOffset();
+
+/*
+	Macro index data (in DocBook format)
+
+<listitem>
+    <para><filename>Go_to_Offset.bsh</filename></para>
+    <abstract><para>
+		Prompts the user for a offset position on the 
+		current buffer, then moves the caret there.
+    </para></abstract>
+</listitem>
+
+*/
+
diff --git a/macros/Emacs/Emacs_Kill_Line.bsh b/macros/Emacs/Emacs_Kill_Line.bsh
index 60ef008..7e1479a 100644
--- a/macros/Emacs/Emacs_Kill_Line.bsh
+++ b/macros/Emacs/Emacs_Kill_Line.bsh
@@ -2,74 +2,8 @@
  * Emulate GNU Emacs's (kill-line) function (typically bound to Ctrl-K)
  */
 
-source (MiscUtilities.constructPath(dirname(scriptPath), "EmacsUtil.bsh"));
+import org.jedit.keymap.EmacsUtil;
 
-void emacsKillLine()
-{
-    boolean lastActionWasThis = repeatingSameMacro ("Emacs/Emacs_Kill_Line");
-
-    caret = textArea.getCaretPosition();
-    caretLine = textArea.getCaretLine();
-    lineStart = textArea.getLineStartOffset (caretLine);
-    lineEnd = textArea.getLineEndOffset (caretLine);
-
-    // If we're at the end of line (ignoring any trailing white space),
-    // then kill the newline, too.
-    
-    caret2 = caret + 1;
-    while (caret2 < lineEnd)
-    {
-        ch = charAt (caret2);
-        
-        if (! Character.isWhitespace (ch))
-            break;
-
-        caret2++;
-    }
-
-    String deletedText = null;
-    Selection selection = null;
-
-    if (caret2 == lineEnd)
-    {
-        // We're at the end of the line. Join this line and the next line--but
-        // do it with a true delete, not with textArea.joinLines(), to
-        // emulate emacs better.
-
-        if (caretLine != textArea.getLastPhysicalLine())
-            selection = new Selection.Range (caret, caret2);
-    }
-
-    else
-    {
-        // Simple delete to end of line.
-
-        selection = new Selection.Range (caret, lineEnd - 1);
-        //textArea.deleteToEndOfLine();
-    }
-
-    if (selection != null)
-    {
-        textArea.setSelection (selection);
-        deletedText = textArea.getSelectedText();
-        textArea.replaceSelection ("");
-        textArea.removeFromSelection (selection);
-
-        if (lastActionWasThis)
-        {
-            clipboard = getClipboard();
-            if (clipboard == null)
-                clipboard = "";
-
-            setClipboard (clipboard + deletedText);
-        }
-
-        else
-        {
-            setClipboard (deletedText);
-        }
-    }
-}
-
-emacsKillLine();
+emacsUtil = new EmacsUtil();
+emacsUtil.emacsKillLine();
 
diff --git a/macros/Misc/Generate Encodings List.bsh b/macros/Misc/Generate Encodings List.bsh
index e2aaf3a..d727176 100644
--- a/macros/Misc/Generate Encodings List.bsh	
+++ b/macros/Misc/Generate Encodings List.bsh	
@@ -6,7 +6,7 @@ nameSet = EncodingServer.getAvailableNames();
 sbuffer = new StringBuffer();
 
 htmlBuffer = jEdit.openFile(editPane, "encodingsList.html");
-editPane.setBuffer(htmlBuffer);
+
 itr = nameSet.iterator();
 int i=0;
 sbuffer.append("<html><head><title> Supported jEdit Encodings </title></head>\n");
@@ -27,6 +27,6 @@ sbuffer.append(" Generated from macro <tt>" + scriptPath + "</tt> </p>");
 sbuffer.append("</body></html>\n");
 
 htmlBuffer.insert(0, sbuffer.toString());
-// set elastic tabstops for this one. 
+// set elastic tabstops for this one. (causes bug# 3614248) 
+htmlBuffer.setBooleanProperty("elasticTabstops", true);
 
-htmlBuffer.setBooleanProperty("elasticTabstops", true);
\ No newline at end of file
diff --git a/macros/Misc/Generate Modes List.bsh b/macros/Misc/Generate Modes List.bsh
index 189101c..f7b733f 100644
--- a/macros/Misc/Generate Modes List.bsh	
+++ b/macros/Misc/Generate Modes List.bsh	
@@ -5,7 +5,6 @@ import org.gjt.sp.jedit.io.EncodingServer;
 modeList = jEdit.getModes();
 sbuffer = new StringBuffer();
 htmlBuffer = jEdit.openFile(editPane, "editModeList.html");
-editPane.setBuffer(htmlBuffer);
 
 sbuffer.append("<html><head><title> Supported jEdit Edit Modes </title></head>\n");
 sbuffer.append("<!--    :elasticTabstops=true: -->\n");
@@ -22,6 +21,7 @@ sbuffer.append(" Generated from macro <tt>" + scriptPath + "</tt> </p>");
 sbuffer.append("\n</body></html>\n");
 
 htmlBuffer.insert(0, sbuffer.toString());
-// set elastic tabstops for this one. 
 
-htmlBuffer.setBooleanProperty("elasticTabstops", true);
\ No newline at end of file
+// set elastic tabstops (causes bug# 3614248)
+htmlBuffer.setBooleanProperty("elasticTabstops", true);
+
diff --git a/macros/Text/Reverse_Selection.bsh b/macros/Text/Reverse_Selection.bsh
new file mode 100644
index 0000000..a5293ad
--- /dev/null
+++ b/macros/Text/Reverse_Selection.bsh
@@ -0,0 +1,33 @@
+/*
+ * Reverse_Selection.bsh - a BeanShell macro for jEdit
+ * which reverses the content of the selection 
+ *
+ * Copyright (C) 2013 Thomas Meyer
+ *
+ */
+
+reverseSelection()
+{
+	selectionCount = textArea.getSelectionCount();
+	if(selectionCount > 0)
+	{
+		selection = textArea.getSelection(0);
+		text = textArea.getSelectedText(selection);
+		revText = new org.gjt.sp.util.ReverseCharSequence(text);
+		textArea.setSelectedText(selection, revText.toString());
+	}
+}
+
+reverseSelection();
+
+/*
+	Macro index data (in DocBook format)
+
+<listitem>
+	<para><filename>Reverse_Selection.bsh</filename>
+	<abstract><para>
+		Reversere the content of the first selection
+	</para></abstract>
+</listitem>
+
+*/
diff --git a/modes/catalog b/modes/catalog
index 1a870b6..924d552 100644
--- a/modes/catalog
+++ b/modes/catalog
@@ -251,7 +251,7 @@
 				FILE_NAME_GLOB="*.iss" />
 
 <MODE NAME="ini"		FILE="ini.xml"
-				FILE_NAME_GLOB="*.{ini,reg}" />
+				FILE_NAME_GLOB="*.{ini,reg,milk}" />
 
 <MODE NAME="interlis"		FILE="interlis.xml"
 				FILE_NAME_GLOB="*.ili" />
@@ -411,6 +411,10 @@
 <MODE NAME="PostgreSQL" FILE="pg-sql.xml"
 							FILE_NAME_GLOB="*.{pg_sql,pg-sql}" />
 
+<MODE NAME="PowerCenter Parameter File"
+    FILE="powercenter_parameter_file.xml" FILE_NAME_GLOB="*.par" />
+							
+							
 <MODE NAME="pl-sql"		FILE="osql.xml"
                            FILE_NAME_GLOB="*.{pls,sql}" />
 
diff --git a/modes/html.xml b/modes/html.xml
index 68c0f49..a418de5 100644
--- a/modes/html.xml
+++ b/modes/html.xml
@@ -16,12 +16,16 @@
 		</SPAN>
 
 		<!-- JavaScript -->
-		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="SCRIPT_TAG"
-					HASH_CHAR="<"><(?=SCRIPT\b)</SEQ_REGEXP>
+		<SPAN_REGEXP TYPE="MARKUP" DELEGATE="JAVASCRIPT" HASH_CHAR="<">
+			<BEGIN><(?=SCRIPT\b)</BEGIN>
+			<END REGEXP="TRUE">(?i)(?=</SCRIPT\b)</END>
+		</SPAN_REGEXP>
 
 		<!-- stylesheet -->
-		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="STYLE_TAG"
-					HASH_CHAR="<"><(?=STYLE\b)</SEQ_REGEXP>
+		<SPAN_REGEXP TYPE="MARKUP" DELEGATE="CSS" HASH_CHAR="<">
+			<BEGIN><(?=STYLE\b)</BEGIN>
+			<END REGEXP="TRUE">(?i)(?=</STYLE\b)</END>
+		</SPAN_REGEXP>
 
 		<!-- DTD instructions -->
 		<SPAN TYPE="KEYWORD2" DELEGATE="xml::DTD-TAGS">
@@ -35,16 +39,10 @@
 			<END>></END>
 		</SPAN>
 
-		<!-- SGML entities -->
-		<SPAN TYPE="LITERAL2" NO_WORD_BREAK="TRUE">
-			<BEGIN>&</BEGIN>
-			<END>;</END>
-		</SPAN>
+		<!-- SGML character entities -->
+		<IMPORT DELEGATE="CHARACTER_ENTITIES" />
 	</RULES>
 
-	<!-- ESCAPE is not exactly right but it is needed to correctly
-	     handle JavaScript in on* parameters.
-             NOTE: ESCAPE moved from RULE to SPANs! -->
 	<RULES SET="TAGS" DEFAULT="MARKUP">
 		<!-- Inline CSS -->
  		<SPAN_REGEXP AT_WORD_START="TRUE" TYPE="MARKUP" DELEGATE="css::PROPERTIES" HASH_CHAR="style">
@@ -59,11 +57,11 @@
 		</SPAN_REGEXP>
 
 		<!-- NOTE: no ESCAPE for quotes, at least for attributes; e.g onclick="alert(\"foo\");" is invalid! -->
-		<SPAN TYPE="LITERAL1" DELEGATE="STRING">
+		<SPAN TYPE="LITERAL1" DELEGATE="ATTRIBUTE">
 			<BEGIN>"</BEGIN>
 			<END>"</END>
 		</SPAN>
-		<SPAN TYPE="LITERAL1" DELEGATE="STRING">
+		<SPAN TYPE="LITERAL1" DELEGATE="ATTRIBUTE">
 			<BEGIN>'</BEGIN>
 			<END>'</END>
 		</SPAN>
@@ -200,7 +198,7 @@
 	</RULES>
 
 	<!-- SCRIPT tag: Highlight tag and switch to language ruleset. -->
-	<RULES SET="SCRIPT_TAG" DEFAULT="MARKUP">
+	<RULES SET="JAVASCRIPT" DEFAULT="MARKUP">
 		<!--If the content of the TYPE attribute is recognized, switch to
 			language specific ruleset. -->
 		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="COFFEESCRIPT_TAG"
@@ -218,134 +216,61 @@
 		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="XQUERY_SCRIPT_TAG"
 					HASH_CHAR="type">type(?=\s*=\s*['"]?\w+/xquery)</SEQ_REGEXP>
 		<!-- Switch to JavaScript ruleset after the tag. -->
-		<SEQ TYPE="MARKUP" DELEGATE="JAVASCRIPT">></SEQ>
+		<SEQ TYPE="MARKUP" DELEGATE="javascript::MAIN">></SEQ>
 		<!-- Import rules for highlighting. -->
 		<IMPORT DELEGATE="TAGS"/>
 	</RULES>
 
-	<!-- JavaScript (NOTE: RULES attributes must match the imported rules.)-->
-	<RULES SET="JAVASCRIPT" 
-		IGNORE_CASE="FALSE"
-		HIGHLIGHT_DIGITS="TRUE"
-		DIGIT_RE="(0x[\p{XDigit}]+[lL]?|[\p{Digit}]+(e[\p{Digit}]*)?[lLdDfF]?)">
-		<!-- "Override" comments to avoid consuming the </SCRIPT> tag. -->
-		<SPAN_REGEXP TYPE="COMMENT1" HASH_CHAR="/*">
-			<BEGIN>/\*</BEGIN>
-			<END REGEXP="TRUE">(?i)(?=</SCRIPT\b)</END>
-		</SPAN_REGEXP>
-		<SEQ_REGEXP TYPE="COMMENT2" HASH_CHAR="//">(?i)//.*(?=</SCRIPT\b)</SEQ_REGEXP>
-		<!-- If closing </SCRIPT> tag is found, switch to ENDTAG ruleset. -->
-		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="ENDTAG"
-					HASH_CHAR="<">(?i)<(?=/SCRIPT\b)</SEQ_REGEXP>
-		<!-- Import rules for JavaScript mode. -->
-		<IMPORT DELEGATE="javascript::MAIN"/>
-	</RULES>
-
 	<!-- CoffeeScript -->
 	<RULES SET="COFFEESCRIPT_TAG" DEFAULT="MARKUP">
-		<SEQ TYPE="MARKUP" DELEGATE="COFFEESCRIPT">></SEQ>
+		<SEQ TYPE="MARKUP" DELEGATE="coffeescript::MAIN">></SEQ>
 		<IMPORT DELEGATE="TAGS"/>
 	</RULES>
-	<RULES SET="COFFEESCRIPT"
-		IGNORE_CASE="FALSE"
-		HIGHLIGHT_DIGITS="TRUE"
-		NO_WORD_SEP="$_"
-		DIGIT_RE="(0b[01]+)|(0o[0-7]+)|(0x\p{XDigit}+)|(\d*\.?\d+(e[+-]?\d+)?)">
-		<SPAN_REGEXP TYPE="COMMENT2" HASH_CHAR="###">
-			<BEGIN>###(?!#)</BEGIN>
-			<END REGEXP="TRUE">(?i)(?=</SCRIPT\b)</END>
-		</SPAN_REGEXP>
-		<SEQ_REGEXP TYPE="COMMENT1" HASH_CHAR="#">(?i)#.*(?=</SCRIPT\b)</SEQ_REGEXP>
-		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="ENDTAG"
-					HASH_CHAR="<">(?i)<(?=/SCRIPT\b)</SEQ_REGEXP>
-		<IMPORT DELEGATE="coffeescript::MAIN"/>
-	</RULES>
 
 	<!-- Python - provided by Gestalt -->
 	<RULES SET="PYTHON_SCRIPT_TAG" DEFAULT="MARKUP">
-		<SEQ TYPE="MARKUP" DELEGATE="PYTHON">></SEQ>
+		<SEQ TYPE="MARKUP" DELEGATE="python::MAIN">></SEQ>
 		<IMPORT DELEGATE="TAGS"/>
 	</RULES>
-	<RULES SET="PYTHON" IGNORE_CASE="FALSE" HIGHLIGHT_DIGITS="TRUE">
-		<SEQ_REGEXP TYPE="COMMENT1" HASH_CHAR="#">(?i)#.*(?=</SCRIPT\b)</SEQ_REGEXP>
-		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="ENDTAG"
-					HASH_CHAR="<">(?i)<(?=/SCRIPT\b)</SEQ_REGEXP>
-		<IMPORT DELEGATE="python::MAIN"/>
-	</RULES>
 
 	<!-- Ruby - provided by Gestalt -->
 	<RULES SET="RUBY_SCRIPT_TAG" DEFAULT="MARKUP">
-		<SEQ TYPE="MARKUP" DELEGATE="RUBY">></SEQ>
+		<SEQ TYPE="MARKUP" DELEGATE="ruby::MAIN">></SEQ>
 		<IMPORT DELEGATE="TAGS"/>
 	</RULES>
-	<RULES SET="RUBY" IGNORE_CASE="FALSE" HIGHLIGHT_DIGITS="TRUE"
-		DIGIT_RE="(0b[01]([01_]*[01])?)|(0x[\p{XDigit}]([\p{XDigit}_]*[\p{XDigit}])?)|(0([0-7_]*[0-7])?)|(0d[0-9]([0-9_]*[0-9])?)|([1-9]([0-9_]*[0-9])?)|([0-9]([0-9_]*[0-9])?[Ee]([0-9]([0-9_]*[0-9])?)?)">
-		<SEQ_REGEXP TYPE="COMMENT1" HASH_CHAR="#">(?i)#.*(?=</SCRIPT\b)</SEQ_REGEXP>
-		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="ENDTAG"
-					HASH_CHAR="<">(?i)<(?=/SCRIPT\b)</SEQ_REGEXP>
-		<IMPORT DELEGATE="ruby::MAIN"/>
-	</RULES>
 
 	<!-- VBScript - provided by Internet Explorer -->
 	<RULES SET="VBSCRIPT_TAG" DEFAULT="MARKUP">
-		<SEQ TYPE="MARKUP" DELEGATE="VBSCRIPT">></SEQ>
+		<SEQ TYPE="MARKUP" DELEGATE="vbscript::MAIN">></SEQ>
 		<IMPORT DELEGATE="TAGS"/>
 	</RULES>
-	<RULES SET="VBSCRIPT" HIGHLIGHT_DIGITS="TRUE">
-		<SEQ_REGEXP TYPE="COMMENT1" HASH_CHAR="'">'.*(?=</SCRIPT\b)</SEQ_REGEXP>
-		<SEQ_REGEXP TYPE="COMMENT1" HASH_CHAR="rem">rem(\b.*)?(?=</SCRIPT\b)</SEQ_REGEXP>
-		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="ENDTAG"
-					HASH_CHAR="<"><(?=/SCRIPT\b)</SEQ_REGEXP>
-		<IMPORT DELEGATE="vbscript::MAIN"/>
-	</RULES>
 
 	<!-- XML - for XAML, provided by Gestalt -->
 	<RULES SET="XML_SCRIPT_TAG" DEFAULT="MARKUP">
-		<SEQ TYPE="MARKUP" DELEGATE="XML">></SEQ>
+		<SEQ TYPE="MARKUP" DELEGATE="xml::MAIN">></SEQ>
 		<IMPORT DELEGATE="TAGS"/>
 	</RULES>
-	<RULES SET="XML">
-		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="ENDTAG"
-					HASH_CHAR="<"><(?=/SCRIPT\b)</SEQ_REGEXP>
-		<IMPORT DELEGATE="xml::MAIN"/>
-	</RULES>
 
 	<!-- XQUERY - provided by XQIB -->
 	<RULES SET="XQUERY_SCRIPT_TAG" DEFAULT="MARKUP">
-		<SEQ TYPE="MARKUP" DELEGATE="XQUERY">></SEQ>
+		<SEQ TYPE="MARKUP" DELEGATE="xq::MAIN">></SEQ>
 		<IMPORT DELEGATE="TAGS"/>
 	</RULES>
-	<RULES SET="XQUERY">
-		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="ENDTAG"
-					HASH_CHAR="<"><(?=/SCRIPT\b)</SEQ_REGEXP>
-		<IMPORT DELEGATE="xq::MAIN"/>
-	</RULES>
 
 	<!-- STYLE tag: Highlight tag and delegate to CSS mode. -->
-	<RULES SET="STYLE_TAG" DEFAULT="MARKUP">
-		<SEQ TYPE="MARKUP" DELEGATE="CSS">></SEQ>
+	<RULES SET="CSS" DEFAULT="MARKUP">
+		<SEQ TYPE="MARKUP" DELEGATE="css::MAIN">></SEQ>
 		<IMPORT DELEGATE="TAGS"/>
 	</RULES>
 
-	<RULES SET="CSS"
-	    HIGHLIGHT_DIGITS="TRUE"
-		DIGIT_RE="-?\d+(\.\d+)?(pt|pc|in|mm|cm|em|ex|px|ms|s|%|)"
-		NO_WORD_SEP="-_%">
-		<SEQ_REGEXP TYPE="MARKUP" DELEGATE="ENDTAG"
-					HASH_CHAR="<"><(?=/STYLE\b)</SEQ_REGEXP>
-		<IMPORT DELEGATE="css::MAIN"/>
+	<RULES SET="ATTRIBUTE" DEFAULT="LITERAL1">
+		<IMPORT DELEGATE="CHARACTER_ENTITIES" />
 	</RULES>
 
-	<!-- Closing tag: Highlight tag and return to MAIN ruleset. -->
-	<RULES SET="ENDTAG" DEFAULT="MARKUP">
-		<SEQ TYPE="MARKUP" DELEGATE="MAIN">></SEQ>
-		<IMPORT DELEGATE="TAGS"/>
+	<!-- SGML character entities - to be used with IMPORT tag -->
+	<RULES SET="CHARACTER_ENTITIES">
+		<SEQ_REGEXP TYPE="LITERAL2"
+					HASH_CHAR="&">&(#\d+|#x\p{XDigit}+|\p{Alnum}+);</SEQ_REGEXP>
+		<SEQ TYPE="INVALID">&</SEQ>
 	</RULES>
-	
- 	<RULES SET="STRING" DEFAULT="LITERAL1">
- 		<SPAN TYPE="LITERAL2" NO_WORD_BREAK="TRUE">
- 			<BEGIN>&</BEGIN>
- 			<END>;</END>
- 		</SPAN>
- 	</RULES>	
 </MODE>
diff --git a/modes/powercenter_parameter_file.xml b/modes/powercenter_parameter_file.xml
new file mode 100644
index 0000000..14385cd
--- /dev/null
+++ b/modes/powercenter_parameter_file.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<!-- PowerCenter Parameter File format, jEdit mode by Thiemo Kellner 2014 -->
+<!DOCTYPE MODE SYSTEM "xmode.dtd">
+
+<MODE>
+   <RULES IGNORE_CASE="TRUE" HIGHLIGHT_DIGITS="TRUE">
+
+      <!-- single $ after double otherwise double will be treated as single -->
+      <MARK_FOLLOWING TYPE="KEYWORD2">$$</MARK_FOLLOWING>
+      <MARK_FOLLOWING TYPE="KEYWORD1">$</MARK_FOLLOWING>
+
+      <!-- weird stuff -->
+      <SPAN TYPE="KEYWORD3" DELEGATE="EXEC" ESCAPE="\">
+         <BEGIN>[</BEGIN>
+         <END>]</END>
+      </SPAN>
+
+      <!-- Literals -->
+      <SPAN TYPE="LITERAL1" DELEGATE="LITERAL" ESCAPE="\" NO_LINE_BREAK="TRUE">
+         <BEGIN>"</BEGIN>
+         <END>"</END>
+      </SPAN>
+      <SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE">
+         <BEGIN>'</BEGIN>
+         <END>'</END>
+      </SPAN>
+
+      <!-- Operators -->
+      <SEQ TYPE="OPERATOR">=</SEQ>
+      <!-- some of these should be marked OPERATOR -->
+      <SEQ TYPE="NULL">=</SEQ>
+
+      <!-- Comments -->
+      <EOL_SPAN_REGEXP TYPE="COMMENT2" AT_LINE_START="TRUE">^[^=]*$</EOL_SPAN_REGEXP>
+   </RULES>
+
+</MODE>
diff --git a/net/sourceforge/jarbundler/AppBundleProperties.java b/net/sourceforge/jarbundler/AppBundleProperties.java
index 9df1216..2e418a4 100644
--- a/net/sourceforge/jarbundler/AppBundleProperties.java
+++ b/net/sourceforge/jarbundler/AppBundleProperties.java
@@ -3,19 +3,18 @@
  *
  * Copyright (c) 2003, Seth J. Morabito <sethm at loomcom.com> All rights reserved.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
  *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See  the GNU General Public License for
- * more details.
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
  *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
 
@@ -26,6 +25,7 @@ import java.util.ArrayList;
 import java.util.Hashtable;
 import java.util.List;
 import java.util.LinkedList;
+// import java.util.Scanner;
 
 // Java language imports
 import java.lang.String;
@@ -54,9 +54,19 @@ public class AppBundleProperties {
 	// Help Book name, optional
 	private String mCFHelpBookName = null;
 
+	// StartOnMainThread, optional
+	private Boolean	mStartOnMainThread = null;
+
+	// StartAsAgent, optional (per Michael Bader <nufan_k at me.com>)
+	private Boolean	 mLSUIElement = null;
+
 	// Explicit default: false
 	private boolean mCFBundleAllowMixedLocalizations = false;
 
+	// Copyright, optional
+
+	private String mNSHumanReadableCopyright = null;
+
 	// Explicit default: JavaApplicationStub
 	private String mCFBundleExecutable = "JavaApplicationStub";
 
@@ -71,6 +81,7 @@ public class AppBundleProperties {
 
 	// Explicit default: 1.3+
 	private String mJVMVersion = "1.3+";
+	private double mJavaVersion = 1.3;
 
 	// Explicit default: 6.0
 	private final String mCFBundleInfoDictionaryVersion = "6.0";
@@ -78,6 +89,7 @@ public class AppBundleProperties {
 	// Optional keys, with no defaults.
 
 	private String mCFBundleIconFile = null;
+    private String mSplashFile = null;
 	private String mCFBundleIdentifier = null;
 	private String mVMOptions = null; // Java VM options
 	private String mWorkingDirectory = null; // Java Working Dir
@@ -87,6 +99,12 @@ public class AppBundleProperties {
 	private List mClassPath = new ArrayList();
 	private List mExtraClassPath = new ArrayList();
 
+    // New in JarBundler 2.2.0; Tobias Bley ----------------
+    private List mJVMArchs = new ArrayList();
+    private List mLSArchitecturePriority = new ArrayList();
+    private String mSUFeedURL = null;
+    // -----------------------------------------------------
+
 	// Java properties
 	private Hashtable mJavaProperties = new Hashtable();
 
@@ -95,7 +113,7 @@ public class AppBundleProperties {
 
 	// Services
 	private List mServices = new LinkedList();
-	
+
 	// ================================================================================
 
 	/**
@@ -110,7 +128,20 @@ public class AppBundleProperties {
 		return mJavaProperties;
 	}
 
-	public void addToClassPath(String s) {
+    // New in JarBundler 2.2.0; Tobias Bley ----------------
+
+    public void addToJVMArchs(String s) {
+        mJVMArchs.add(s);
+    }
+
+    public List getJVMArchs() {
+        return mJVMArchs;
+    }
+
+    //------------------------------------------------------
+
+    public void addToClassPath(String s)
+    {
 		mClassPath.add("$JAVAROOT/" + s);
 	}
 
@@ -140,18 +171,18 @@ public class AppBundleProperties {
 	public Service createService() {
 		return new Service();
 	}
-	
+
 	public List getServices() {
 		return mServices;
 	}
-	
+
 	/**
 	 * Add a service to the services list.
 	 */
 	public void addService(Service service) {
 		mServices.add(service);
 	}
-	
+
 	// ================================================================================
 
 	public void setApplicationName(String s) {
@@ -234,6 +265,14 @@ public class AppBundleProperties {
 		return mCFBundleIconFile;
 	}
 
+    public void setSplashFile(String s) {
+        mSplashFile = s;
+    }
+
+    public String getSplashFile() {
+        return mSplashFile;
+    }
+
 	public void setCFBundleAllowMixedLocalizations(boolean b) {
 		mCFBundleAllowMixedLocalizations = b;
 	}
@@ -242,6 +281,14 @@ public class AppBundleProperties {
 		return mCFBundleAllowMixedLocalizations;
 	}
 
+	public void setNSHumanReadableCopyright(String s) {
+		mNSHumanReadableCopyright = s;
+	}
+
+	public String getNSHumanReadableCopyright() {
+		return mNSHumanReadableCopyright;
+	}
+
 	public void setCFBundleExecutable(String s) {
 		mCFBundleExecutable = s;
 	}
@@ -290,7 +337,30 @@ public class AppBundleProperties {
 		return mCFHelpBookName;
 	}
 
-	public void setMainClass(String s) {
+
+	public void setStartOnMainThread(Boolean b) {
+		mStartOnMainThread = b;
+	}
+
+	public Boolean getStartOnMainThread() {
+		return mStartOnMainThread;
+	}
+
+
+
+	public Boolean getLSUIElement() {
+		return mLSUIElement;
+	}
+
+
+
+	public void setLSUIElement( Boolean b ) {
+		this.mLSUIElement = b;
+	}
+
+
+
+	public void setMainClass( String s ) {
 		mMainClass = s;
 	}
 
@@ -300,12 +370,18 @@ public class AppBundleProperties {
 
 	public void setJVMVersion(String s) {
 		mJVMVersion = s;
+		mJavaVersion = Double.parseDouble(s.substring(0, 3));
 	}
 
 	public String getJVMVersion() {
 		return mJVMVersion;
 	}
 
+	public double getJavaVersion()
+	{
+		return mJavaVersion;
+	}
+
 	public void setVMOptions(String s) {
 		mVMOptions = s;
 	}
@@ -334,4 +410,53 @@ public class AppBundleProperties {
 		return mClassPath;
 	}
 
+    // New in JarBundler 2.2.0; Tobias Bley ----------------------------------------------------
+
+    /**
+     * @param archs space separated archs, e.g. i386 x64_64 ppc
+     */
+    public void setJVMArchs(String archs) {
+        // Use for 1.4 backwards compatability
+        String[] tokens = archs.split("\\s+");
+        for (int i=0; i<tokens.length; i++)
+            mJVMArchs.add(tokens[i]);
+
+        // 'java.util.Scanner' is available in JDK 1.5
+        // Scanner s = new Scanner(archs);
+        // s = s.useDelimiter("\\s+");
+        // while (s.hasNext())
+        //     mJVMArchs.add(s.next());
+    }
+
+    public List getLSArchitecturePriority() {
+        return mLSArchitecturePriority;
+
+    }
+
+    /**
+     * @param lsArchitecturePriority space separated LSArchitecturePriority, e.g. i386 x64_64 ppc
+     */
+    public void setLSArchitecturePriority(String lsArchitecturePriority) {
+
+        // Use for 1.4 backwards compatability
+        String[] tokens = lsArchitecturePriority.split("\\s+");
+        for (int i=0; i<tokens.length; i++)
+            mLSArchitecturePriority.add(tokens[i]);
+
+        // 'java.util.Scanner' is available in JDK 1.5
+        // Scanner s = new Scanner(lsArchitecturePriority);
+        // s = s.useDelimiter("\\s+");
+        // while (s.hasNext())
+        //     mLSArchitecturePriority.add(s.next());
+    }
+
+    public String getSUFeedURL() {
+        return mSUFeedURL;
+    }
+
+    public void setSUFeedURL(String suFeedURL) {
+        this.mSUFeedURL = suFeedURL;
+    }
+
+    //------------------------------------------------------------------------------------------
 }
diff --git a/net/sourceforge/jarbundler/DocumentType.java b/net/sourceforge/jarbundler/DocumentType.java
index 68931f4..dd6d9e1 100644
--- a/net/sourceforge/jarbundler/DocumentType.java
+++ b/net/sourceforge/jarbundler/DocumentType.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2003, Seth J. Morabito <sethm at loomcom.com> All rights reserved.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
 package net.sourceforge.jarbundler;
 
 import java.lang.String;
@@ -19,7 +35,14 @@ import java.util.ArrayList;
  * 
  * Name - The name of the document type.
  * 
- * 
+ * UTI - A list of Uniform Type Identifier (UTI) strings for the document. UTIs
+ * are strings that uniquely identify abstract types. They can be used to
+ * describe a file format or data type but can also be used to describe type
+ * information for other sorts of entities, such as directories, volumes, or
+ * packages. For more information on UTIs, see the header file UTType.h,
+ * available as part of LaunchServices.framework in Mac OS X v10.3 and later.
+ *
+ *  
  * Extensions - A list of the filename extensions for this document type. Don't
  * include the period in the extension.
  * 
@@ -89,6 +112,17 @@ public class DocumentType {
 
 	public String[] mimeTypes = null;
 
+    /**
+	 * UTI. A list of Uniform Type Identifier (UTI) strings for the document.
+	 * UTIs are strings that uniquely identify abstract types. They can be used
+	 * to describe a file format or data type but can also be used to describe
+	 * type information for other sorts of entities, such as directories,
+	 * volumes, or packages. For more information on UTIs, see the header file
+	 * UTType.h, available as part of LaunchServices.framework in Mac OS X v10.3
+	 * and later.
+	 */
+    public String[] UTIs = null;
+	
 	/**
 	 * Icon File. The name of the file that contains the document types icon.
 	 */
@@ -158,6 +192,15 @@ public class DocumentType {
 		return (mimeTypes == null) ? EMPTYLIST : Arrays.asList(this.mimeTypes);
 	}
 
+	// Uniform Type Identifiers
+	public void setUTIs(String UTIs) {
+		this.UTIs = UTIs.split("[\\s,]");
+	}
+
+	public List getUTIs() {
+		return this.UTIs == null ? EMPTYLIST : Arrays.asList(this.UTIs);
+	}
+	
 	// Document icon file
 	public void setIconFile(File iconFile) {
 		this.iconFile = iconFile;
diff --git a/net/sourceforge/jarbundler/HelpBook.java b/net/sourceforge/jarbundler/HelpBook.java
index 6a35018..892bfba 100644
--- a/net/sourceforge/jarbundler/HelpBook.java
+++ b/net/sourceforge/jarbundler/HelpBook.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2003, Seth J. Morabito <sethm at loomcom.com> All rights reserved.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
 package net.sourceforge.jarbundler;
 
 import java.util.ArrayList;
diff --git a/net/sourceforge/jarbundler/JarBundler.java b/net/sourceforge/jarbundler/JarBundler.java
index 56081a7..4b6a73c 100644
--- a/net/sourceforge/jarbundler/JarBundler.java
+++ b/net/sourceforge/jarbundler/JarBundler.java
@@ -1,21 +1,20 @@
 /*
  * A Mac OS X Jar Bundler Ant Task.
  *
+ *
  * Copyright (c) 2003, Seth J. Morabito <sethm at loomcom.com> All rights reserved.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
  *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See  the GNU General Public License for
- * more details.
+ *       http://www.apache.org/licenses/LICENSE-2.0
  *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA  02111-1307, USA.
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
  */
 
 package net.sourceforge.jarbundler;
@@ -72,7 +71,7 @@ import java.lang.System;
  * An ant task which creates a Mac OS X Application Bundle for a Java
  * application.
  * </p>
- * 
+ *
  * <dl>
  * <dt>dir</dt>
  * <dd>The directory into which to put the new application bundle.</dd>
@@ -83,10 +82,10 @@ import java.lang.System;
  * <dt>mainclass</dt>
  * <dd>The main Java class to call when running the application.</dd>
  * </dl>
- * 
+ *
  * <p>
  * One of the following three MUST be used:
- * 
+ *
  * <ol>
  * <li>jars Space or comma-separated list of JAR files to include.; OR</li>
  * <li>One or more nested <jarfileset>s. These are normal ANT FileSets;
@@ -94,77 +93,77 @@ import java.lang.System;
  * <li>One or more nested <jarfilelist>s. These are standard ANT
  * FileLists. </li>
  * </ol>
- * 
+ *
  * <p>
  * Optional attributes:
- * 
+ *
  * <p>
  * The following attributes are not required, but you can use them to override
  * default behavior.
- * 
+ *
  * <dl>
  * <dt>verbose
  * <dd>If true, show more verbose output while running the task
- * 
+ *
  * <dt>version
  * <dd>Version information about your application (e.g., "1.0")
- * 
+ *
  * <dt>infostring
  * <dd>String to show in the "Get Info" dialog
  * </dl>
- * 
+ *
  * These attributes control the fine-tuning of the "Mac OS X" look and feel.
- * 
+ *
  * <dl>
  * <dt>arguments
  * <dd>Command line arguments. (no default)
- * 
+ *
  * <dt>smalltabs
  * <dd>Use small tabs. (default "false") Deprecated under JVM 1.4.1
- * 
+ *
  * <dt>antialiasedgraphics
  * <dd>Use anti-aliased graphics (default "false")
- * 
+ *
  * <dt>antialiasedtext
  * <dd>Use anti-aliased text (default "false")
- * 
+ *
  * <dt>bundleid
  * <dd>Unique identifier for this bundle, in the form of a Java package. No
  * default.
- * 
+ *
  * <dt>buildnumber
  * <dd>Unique identifier for this build
- * 
+ *
  * <dt>developmentregion
  * <dd>Development Region. Default "English".
- * 
+ *
  * <dt>execs
  * <dd>Files to be copied into "Resources/MacOS" and made executable
- * 
+ *
  * <dt>liveresize
  * <dd>Use "Live resizing" (default "false") Deprecated under JVM 1.4.1
- * 
- * 
+ *
+ *
  * <dt>growbox
  * <dd>Show growbox (default "true")
- * 
+ *
  * <dt>growboxintrudes
  * <dd>Intruding growbox (default "false") Deprecated under JVM 1.4.1
- * 
+ *
  * <dt>screenmenu
  * <dd>Put swing menu into Mac OS X menu bar.
- * 
+ *
  * <dt>type
  * <dd>Bundle type (default "APPL")
- * 
+ *
  * <dt>signature
  * <dd>Bundle Signature (default "????")
- * 
+ *
  * <dt>stubfile
  * <dd>The Java Application Stub file to copy for your application (default
  * MacOS system stub file)
  * </dl>
- * 
+ *
  * <p>
  * Rarely used optional attributes.
  * <dl>
@@ -172,7 +171,7 @@ import java.lang.System;
  * <dd>Full path to the chmod command. This almost certainly does NOT need to
  * be set.
  * </dl>
- * 
+ *
  * <p>
  * The task also supports nested <execfileset> and/or <execfilelist>
  * elements, and <resourcefileset> and/or <resourcefilelist>
@@ -184,16 +183,16 @@ import java.lang.System;
  * the same relation to the <code>Contents/Resources</code> directory as the
  * files in the FileSet or FileList have to the 'dir' attribute. Thus in the
  * case:
- * 
+ *
  * <pre>
  *   <resourcefileset dir="builddir/architectures"
  *                       includes="ppc/*.jnilib"/>
  * </pre>
- * 
+ *
  * <p>
  * the <code>*.jnilib</code> files will be installed in
  * <code>Contents/Resources/ppc</code>.
- * 
+ *
  * <p>
  * The task supports a nested <javaproperty> element, which allows you to
  * specify further properties which are set for the JVM when the application is
@@ -206,19 +205,19 @@ import java.lang.System;
  * <code>$APP_PACKAGE</code> is set to the root directory of the bundle (ie,
  * the path to the <code>foo.app</code> directory), and <code>$JAVAROOT</code>
  * to the directory <code>Contents/Resources/Java</code>.
- * 
+ *
  * <p>
  * Minimum example:
- * 
+ *
  * <pre>
- *  
+ *
  *    <jarbundler dir="release" name="Bar Project" mainclass="org.bar.Main"
  *        jars="bin/Bar.jar" />
  * </pre>
- * 
+ *
  * <p>
  * Using Filesets
- * 
+ *
  * <pre>
  *    <jarbundler dir="release" name="Bar Project" mainclass="org.bar.Main">
  *      <jarfileset dir="bin">
@@ -230,17 +229,17 @@ import java.lang.System;
  *      </execfileset>
  *    </jarbundler>
  * </pre>
- * 
+ *
  * <p>
  * Much Longer example:
  * </p>
- * 
+ *
  * <pre>
  *    <jarbundler dir="release"
  *                name="Foo Project"
  *                mainclass="org.bar.Main"
  *                version="1.0 b 1"
- *                infostring="Foo Project (c) 2002" 
+ *                infostring="Foo Project (c) 2002"
  *                type="APPL"
  *                jars="bin/foo.jar bin/bar.jar"
  *                execs="exec/foobar"
@@ -250,7 +249,7 @@ import java.lang.System;
  *                jvmversion="1.4.1+"
  *                vmoptions="-Xmx256m"/>
  * </pre>
- * 
+ *
  * http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/
  */
 public class JarBundler extends MatchingTask {
@@ -283,7 +282,7 @@ public class JarBundler extends MatchingTask {
 	private final List mExecAttrs = new ArrayList();
 
 	private final List mExtraClassPathAttrs = new ArrayList();
-	
+
 	private final List mHelpBooks = new ArrayList();
 
 	private boolean mVerbose = false;
@@ -337,7 +336,7 @@ public class JarBundler extends MatchingTask {
 
 	/**
 	 * Arguments to the
-	 * 
+	 *
 	 * @param s
 	 *            The arguments to pass to the application being launched.
 	 */
@@ -347,7 +346,7 @@ public class JarBundler extends MatchingTask {
 
 	/**
 	 * Override the stub file path to build on non-MacOS platforms
-	 * 
+	 *
 	 * @param file
 	 *            the path to the stub file
 	 */
@@ -406,12 +405,22 @@ public class JarBundler extends MatchingTask {
 	}
 
 	/**
+     * Setter for the "splashfile" attribute (optional). If it is somewhere
+     * in a jar file, which contains a Splash-Screen manifest entry,
+     * use "$JAVAROOT/myjar.jar"
+     */
+
+    public void setSplashFile(String s) {
+        bundleProperties.setSplashFile(s);
+    }
+
+    /**
 	 * Setter for the "bundleid" attribute (optional) This key specifies a
 	 * unique identifier string for the bundle. This identifier should be in the
 	 * form of a Java-style package name, for example com.mycompany.myapp. The
 	 * bundle identifier can be used to locate the bundle at runtime. The
 	 * preferences system uses this string to identify applications uniquely.
-	 * 
+	 *
 	 * No default.
 	 */
 	public void setBundleid(String s) {
@@ -419,16 +428,32 @@ public class JarBundler extends MatchingTask {
 	}
 
 	/**
-	 * Setter for the "developmentregion" attribute(optional) Default "English".
+	 * Setter for the "developmentregion" attribute (optional) Default "English".
 	 */
 	public void setDevelopmentregion(String s) {
 		bundleProperties.setCFBundleDevelopmentRegion(s);
 	}
 
+	/**  Tobias Fischer, v2.3.0
+	 * Setter for the "allowmixedlocalizations" attribute (optional) Default "false".
+	 */
+	public void setAllowMixedLocalizations(boolean b) {
+		bundleProperties.setCFBundleAllowMixedLocalizations(b);
+	}
+
+	/** Tobias Fisher, v2.3.1
+	 * Setter for the "NSHumanReadableCopyright" attribute (optional)
+	 */
+
+	public void setCopyright(String s) {
+		bundleProperties.setNSHumanReadableCopyright(s);
+	}
+
 	/**
-	 * Setter for the "aboutmenuname" attribute (optional)
+	 * Setter for the deprecated "aboutmenuname" attribute (optional)
 	 */
 	public void setAboutmenuname(String s) {
+		System.err.println("WARNING: 'aboutmenuname' is deprecated! Use JarBundler attribute 'shortname' instead!");
 		bundleProperties.setCFBundleName(s);
 	}
 
@@ -510,6 +535,40 @@ public class JarBundler extends MatchingTask {
 		bundleProperties.setJVMVersion(s);
 	}
 
+    // New in JarBundler 2.2.0; Tobias Bley ----------------
+
+	/**
+     * Setter for the "JVMArchs" attribute (optional)
+     */
+    public void setJvmArchs(String s) {
+        bundleProperties.setJVMArchs(s);
+    }
+
+    /**  Michael Bader <nufan_k at me.com> --------------------
+     * Setter for the "LSArchitecturePriority" attribute (optional)
+     */
+    public void setLSArchitecturePriority(String s) {
+        bundleProperties.setLSArchitecturePriority(s);
+    }
+
+    //-------------------------------------------------------
+
+    /**
+	 * Setter for the "startonmainthread" attribute (optional)
+	 */
+	public void setStartonmainthread(boolean b) {
+		bundleProperties.setStartOnMainThread(new Boolean(b));
+	}
+
+
+	/**
+	 * Setter for the "startasagent" attribute (optional)
+	 */
+	public void setIsAgent( boolean b ) {
+		bundleProperties.setLSUIElement( new Boolean( b ) );
+	}
+
+
 	/**
 	 * Setter for the "infostring" attribute (optional) This key identifies a
 	 * human-readable plain text string displaying the copyright information for
@@ -533,13 +592,14 @@ public class JarBundler extends MatchingTask {
 	 * are minor revision numbers. You may omit minor revision numbers as
 	 * appropriate. The value of this key is displayed in the default About box
 	 * for Cocoa applications.
-	 * 
+	 *
 	 * The value for this key differs from the value for "CFBundleVersion",
 	 * which identifies a specific build number. The CFBundleShortVersionString
 	 * value represents a more formal version that does not change with every
 	 * build.
 	 */
 	public void setShortInfoString(String s) {
+		System.err.println("WARNING: 'shortinfostring' is deprecated! Use JarBundler attribute 'infostring' instead!");
 		setVersion(s);
 	}
 
@@ -565,12 +625,12 @@ public class JarBundler extends MatchingTask {
 	 * second and third numbers are minor revision numbers and must be a single
 	 * numeric digit. The fourth set of digits is the specific build number for
 	 * the release.
-	 * 
+	 *
 	 * You may omit minor revision and build number information as appropriate.
 	 * You may also omit major and minor revision information and specify only a
 	 * build number. For example, valid version numbers include: 1.0.1,
 	 * 1.2.1b10, 1.2d200, d125, 101, and 1.0.
-	 * 
+	 *
 	 * The value of this key typically changes between builds and is displayed
 	 * in the Cocoa About panel in parenthesis. To specify the version
 	 * information of a released bundle, use the CFBundleShortVersionString key.
@@ -597,6 +657,7 @@ public class JarBundler extends MatchingTask {
 		bundleProperties.setCFBundleHelpBookName(s);
 	}
 
+
 	/**
 	 * Setter for the "jars" attribute (required if no "jarfileset" is present)
 	 */
@@ -636,6 +697,7 @@ public class JarBundler extends MatchingTask {
 	 * Setter for the "extraclasspath" attribute (optional)
 	 */
 	public void setExtraclasspath(String s) {
+		if (s == null || s.trim().equals("")) return;
 		PatternSet patset = new PatternSet();
 		patset.setIncludes(s);
 
@@ -739,26 +801,26 @@ public class JarBundler extends MatchingTask {
 	}
 
 	public void addConfiguredService(Service service) {
-	
+
 		//if (service.getPortName() == null)
 		//	throw new BuildException("\"<service>\" must have a \"portName\" attribute");
-		
+
 		if (service.getMessage() == null)
 			throw new BuildException("\"<service>\" must have a \"message\" attribute");
-		
+
 		String menuItem = service.getMenuItem();
 		if (menuItem == null)
 			throw new BuildException("\"<service>\" must have a \"menuItem\" attribute");
 		if (!menuItems.add(menuItem))
 			throw new BuildException("\"<service>\" \"menuItem\" value must be unique");
-		
+
 		if (service.getSendTypes().isEmpty() && service.getReturnTypes().isEmpty())
 			throw new BuildException("\"<service>\" must have either a \"sendTypes\" attribute, a \"returnTypes\" attribute or both");
-		
+
 		String keyEquivalent = service.getKeyEquivalent();
 		if ((keyEquivalent != null) && (1 != keyEquivalent.length()))
 			throw new BuildException("\"<service>\" \"keyEquivalent\" must be one character if present");
-		
+
 		String timeoutString = service.getTimeout();
 		if (timeoutString != null) {
 			long timeout = -1;
@@ -770,12 +832,12 @@ public class JarBundler extends MatchingTask {
 			if (timeout < 0)
 				throw new BuildException("\"<service>\" \"timeout\" must not be negative");
 		}
-		
+
 		bundleProperties.addService(service);
 	}
-	
+
 	public void addConfiguredHelpBook(HelpBook helpBook) {
-	
+
 		// Validity check on 'foldername'
 		if (helpBook.getFolderName() == null) {
 			if (bundleProperties.getCFBundleHelpBookFolder() == null)
@@ -941,7 +1003,7 @@ public class JarBundler extends MatchingTask {
 					+ mResourcesDir);
 
 		// Make the Resources/Java directory
-		mJavaDir = new File(mResourcesDir, "Java");
+		mJavaDir = new File(bundleProperties.getJavaVersion() < 1.7 ? mResourcesDir : mContentsDir, "Java");
 
 		if (!mJavaDir.mkdir())
 			throw new BuildException("Unable to create directory " + mJavaDir);
@@ -950,7 +1012,7 @@ public class JarBundler extends MatchingTask {
 		// is supplied, the default icon will be used.
 
 		if (mAppIcon != null) {
-		
+
 
 			try {
 				File dest = new File(mResourcesDir, mAppIcon.getName());
@@ -1064,12 +1126,12 @@ public class JarBundler extends MatchingTask {
 	 * 1.3 the Java property to tell the VM to display Swing menu bars as screen
 	 * menus is "com.apple.macos.useScreenMenuBar". Under 1.4, it becomes
 	 * "apple.laf.useScreenMenuBar". Such is the price of progress, I suppose.
-	 * 
+	 *
 	 * Obviously, this logic may need refactoring in the future.
 	 */
 
 	private boolean useOldPropertyNames() {
-		return (bundleProperties.getJVMVersion().startsWith("1.3"));
+		return (bundleProperties.getJavaVersion() <= 1.3);
 	}
 
 	private void processJarAttrs() throws BuildException {
@@ -1080,9 +1142,9 @@ public class JarBundler extends MatchingTask {
 				File src = (File) jarIter.next();
 				File dest = new File(mJavaDir, src.getName());
 
-				if (mVerbose) 
+				if (mVerbose)
 					log("Copying JAR file to \"" + bundlePath(dest) + "\"");
-				
+
 
 				mFileUtils.copyFile(src, dest);
 				bundleProperties.addToClassPath(dest.getName());
@@ -1141,9 +1203,9 @@ public class JarBundler extends MatchingTask {
 					File src = new File(srcDir, fileName);
 					File dest = new File(mJavaDir, fileName);
 
-					if (mVerbose) 
+					if (mVerbose)
 						log("Copying JAR file to \"" + bundlePath(dest) + "\"");
-					
+
 
 					mFileUtils.copyFile(src, dest);
 					bundleProperties.addToClassPath(fileName);
@@ -1159,7 +1221,8 @@ public class JarBundler extends MatchingTask {
 		for (Iterator jarIter = mExtraClassPathAttrs.iterator(); jarIter
 				.hasNext();) {
 			File src = (File) jarIter.next();
-			bundleProperties.addToExtraClassPath(src.getPath());
+			String path = src.getPath().replace(File.separatorChar, '/');
+			bundleProperties.addToExtraClassPath(path);
 		}
 	}
 
@@ -1178,7 +1241,8 @@ public class JarBundler extends MatchingTask {
 
 			for (int i = 0; i < files.length; i++) {
 				File f = new File(srcDir, files[i]);
-				bundleProperties.addToExtraClassPath(f.getPath());
+				String path = f.getPath().replace(File.separatorChar, '/');
+				bundleProperties.addToExtraClassPath(path);
 			}
 		}
 	}
@@ -1194,7 +1258,8 @@ public class JarBundler extends MatchingTask {
 
 			for (int i = 0; i < files.length; i++) {
 				File f = new File(srcDir, files[i]);
-				bundleProperties.addToExtraClassPath(f.getPath());
+				String path = f.getPath().replace(File.separatorChar, '/');
+				bundleProperties.addToExtraClassPath(path);
 			}
 		}
 	}
@@ -1207,9 +1272,9 @@ public class JarBundler extends MatchingTask {
 				File src = (File) execIter.next();
 				File dest = new File(mMacOsDir, src.getName());
 
-				if (mVerbose) 
+				if (mVerbose)
 					log("Copying exec file to \"" + bundlePath(dest) + "\"");
-				
+
 
 				mFileUtils.copyFile(src, dest);
 				setExecutable(dest);
@@ -1259,12 +1324,12 @@ public class JarBundler extends MatchingTask {
 						String fileName = files[i];
 						File src = new File(srcDir, fileName);
 						File dest = new File(targetdir, fileName);
-						
-						if (mVerbose) 
+
+						if (mVerbose)
 							log("Copying "
 									+ (setExec ? "exec" : "resource")
 									+ " file to \"" + bundlePath(dest) +"\"");
-						
+
 						mFileUtils.copyFile(src, dest);
 						if (setExec)
 							setExecutable(dest);
@@ -1312,12 +1377,12 @@ public class JarBundler extends MatchingTask {
 						String fileName = files[i];
 						File src = new File(srcDir, fileName);
 						File dest = new File(targetDir, fileName);
-						
-						if (mVerbose) 
+
+						if (mVerbose)
 							log("Copying "
 									+ (setExec ? "exec" : "resource")
 									+ " file to \"" + bundlePath(dest) +"\"");
-						
+
 						mFileUtils.copyFile(src, dest);
 						if (setExec)
 							setExecutable(dest);
@@ -1336,35 +1401,35 @@ public class JarBundler extends MatchingTask {
 		for (Iterator itor = mHelpBooks.iterator(); itor.hasNext();) {
 
 			HelpBook helpBook = (HelpBook)itor.next();
-			
+
 			String folderName = helpBook.getFolderName();
 			String name = helpBook.getName();
 			String locale = helpBook.getLocale();
-			
+
 			List fileLists = helpBook.getFileLists();
 			List fileSets = helpBook.getFileSets();
 
 
 			File helpBookDir = null;
-			
+
 			if (locale == null) {
-			
+
 				// Set the Bundle entries for a nonlocalized Help Book
 				if (folderName != null)
 					bundleProperties.setCFBundleHelpBookFolder(folderName);
-				
+
 				if (name != null)
 					bundleProperties.setCFBundleHelpBookName(name);
-				
+
 				// The non-localized Help Book is top level "/Resources"
 				helpBookDir = new File(mResourcesDir, folderName);
 				helpBookDir.mkdir();
 
 				if(mVerbose)
-					log("Creating Help Book at \"" + 
+					log("Creating Help Book at \"" +
 					                    bundlePath(helpBookDir) + "\"");
 
-				
+
 			} else {
 
 				// The localized Help Book is "/Resources/locale.lproj"
@@ -1430,8 +1495,8 @@ public class JarBundler extends MatchingTask {
 		File infoPlist = new File(mContentsDir, "Info.plist");
 
 		listWriter.writeFile(infoPlist);
-		
-		if (mVerbose) 
+
+		if (mVerbose)
 			log("Creating \"" + bundlePath(infoPlist) + "\" file");
 
 
@@ -1439,12 +1504,12 @@ public class JarBundler extends MatchingTask {
 			try {
 				BufferedReader in = new BufferedReader(new FileReader(infoPlist));
 				String str;
-				while ((str = in.readLine()) != null) 
+				while ((str = in.readLine()) != null)
 					log(str);
 				in.close();
     		} catch (IOException e) {
     			throw new BuildException(e);
-    		}			
+    		}
 		}
 	}
 
@@ -1470,11 +1535,11 @@ public class JarBundler extends MatchingTask {
 	}
 
 	private String bundlePath(File bundleFile) {
-	
+
 		String rootPath = bundleDir.getAbsolutePath();
 		String thisPath = bundleFile.getAbsolutePath();
-	
+
 		return thisPath.substring(rootPath.length());
-	
+
 	}
 }
diff --git a/net/sourceforge/jarbundler/JavaProperty.java b/net/sourceforge/jarbundler/JavaProperty.java
index 7f8481d..d371488 100644
--- a/net/sourceforge/jarbundler/JavaProperty.java
+++ b/net/sourceforge/jarbundler/JavaProperty.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2003, Seth J. Morabito <sethm at loomcom.com> All rights reserved.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
 package net.sourceforge.jarbundler;
 
 public class JavaProperty {
diff --git a/net/sourceforge/jarbundler/PropertyListWriter.java b/net/sourceforge/jarbundler/PropertyListWriter.java
index 4019211..fe5da8e 100644
--- a/net/sourceforge/jarbundler/PropertyListWriter.java
+++ b/net/sourceforge/jarbundler/PropertyListWriter.java
@@ -1,26 +1,32 @@
 /*
  * Write the application bundle file: Info.plist
  *
- * Copyright (c) 2006, William A. Gilbert <gilbert at informagen.com> All rights reserved.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
+ * Copyright (c) 2003, Seth J. Morabito <sethm at loomcom.com> All rights reserved.
  *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See  the GNU General Public License for
- * more details.
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
  *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA  02111-1307, USA.
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
  */
 
 package net.sourceforge.jarbundler;
 
 // This package's imports
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
 import net.sourceforge.jarbundler.AppBundleProperties;
 
 // Java I/O
@@ -32,6 +38,8 @@ import java.io.OutputStreamWriter;
 import java.io.Writer;
 
 // Java Utility
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
@@ -42,6 +50,7 @@ import java.lang.ClassCastException;
 import java.lang.Double;
 import java.lang.String;
 import java.lang.System;
+import java.util.Map;
 
 // Apache Ant
 import org.apache.tools.ant.BuildException;
@@ -60,12 +69,6 @@ import org.w3c.dom.Element;
 import org.w3c.dom.Attr;
 
 
-// Xerces serializer
-import org.apache.xml.serialize.OutputFormat;
-import org.apache.xml.serialize.XMLSerializer;
-import org.apache.xml.serialize.LineSeparator;
-
-
 
 /**
  * Write out a Java application bundle property list file. For descriptions of
@@ -81,31 +84,19 @@ public class PropertyListWriter {
 	// Our application bundle properties
 	private AppBundleProperties bundleProperties;
 
-	private double version = 1.3;
-
 	// DOM version of Info.plist file
 	private Document document = null;
 
 
 	private FileUtils fileUtils = FileUtils.getFileUtils();
-	
+
 	/**
 	 * Create a new Property List writer.
 	 */
 	public PropertyListWriter(AppBundleProperties bundleProperties) {
 		this.bundleProperties = bundleProperties;
-		setJavaVersion(bundleProperties.getJVMVersion());
-	}
-
-	private void setJavaVersion(String version) {
-
-		if (version == null)
-			return;
-
-		this.version = Double.valueOf(version.substring(0, 3)).doubleValue();
 	}
 
-
 	public void writeFile(File fileName) throws BuildException {
 
 		Writer writer = null;
@@ -115,21 +106,18 @@ public class PropertyListWriter {
 			this.document = createDOM();
 			buildDOM();
 
-			// Serialize the DOM into the writer
-			writer = new BufferedWriter(new OutputStreamWriter(
-			                            new FileOutputStream(fileName), "UTF-8"));
-			// Prettify the XML Two space indenting, no line wrapping
-			OutputFormat outputFormat = new OutputFormat();
-			outputFormat.setMethod("xml");
-			outputFormat.setIndenting(true);
-			outputFormat.setIndent(2);
-			outputFormat.setLineWidth(0);             
-			
-			// Create a DOM serlializer and write the XML
-			XMLSerializer serializer = new XMLSerializer(writer, outputFormat);
-			serializer.asDOMSerializer();
-			serializer.serialize(this.document);
-
+			TransformerFactory transFactory = TransformerFactory.newInstance();
+			Transformer trans = transFactory.newTransformer();
+			trans.setOutputProperty(OutputKeys.INDENT, "yes");
+			trans.setOutputProperty("{http://xml.apache.org/xslt}indent-amount","2");
+			trans.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC, "-//Apple Computer//DTD PLIST 1.0//EN");
+			trans.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, "http://www.apple.com/DTDs/PropertyList-1.0.dtd");
+			writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(fileName), "UTF-8"));
+			trans.transform(new DOMSource(document), new StreamResult(writer));
+		} catch (TransformerConfigurationException tce) {
+			throw new BuildException(tce);
+		} catch (TransformerException te) {
+			throw new BuildException(te);
 		} catch (ParserConfigurationException pce) {
 			throw new BuildException(pce);
 		} catch (IOException ex) {
@@ -137,19 +125,17 @@ public class PropertyListWriter {
 		} finally {
 			fileUtils.close(writer);
 		}
-
-
 	}
 
 	private Document createDOM() throws ParserConfigurationException {
-	
+
 		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
 		DocumentBuilder documentBuilder = factory.newDocumentBuilder();
 		DOMImplementation domImpl = documentBuilder.getDOMImplementation();
 
-		// We needed to reference using the full class name here because we already have 
+		// We needed to reference using the full class name here because we already have
 		//  a class named "DocumentType"
-		
+
 		org.w3c.dom.DocumentType doctype = domImpl.createDocumentType(
 		       "plist",
 		       "-//Apple Computer//DTD PLIST 1.0//EN",
@@ -162,10 +148,10 @@ public class PropertyListWriter {
 	private void buildDOM()  {
 
 		Element plist = this.document.getDocumentElement();
-		plist.setAttribute("version","1.0");		
+		plist.setAttribute("version","1.0");
 
 		// Open the top level dictionary, <dict>
-		
+
 		Node dict = createNode("dict", plist);
 
 		// Application short name i.e. About menu name
@@ -173,17 +159,16 @@ public class PropertyListWriter {
 
 		// Finder 'Version' label, defaults to "1.0"
 		writeKeyStringPair("CFBundleShortVersionString", bundleProperties.getCFBundleShortVersionString(), dict);
-		
+
 		// Finder 'Get Info'
 		writeKeyStringPair("CFBundleGetInfoString", bundleProperties.getCFBundleGetInfoString(), dict);
-		
+
 		// Mac OS X required key, defaults to "false"
-		writeKeyStringPair("CFBundleAllowMixedLocalizations", 
-		     (bundleProperties.getCFBundleAllowMixedLocalizations() ? "true" : "false"),  
-		     dict);
+		writeKeyStringPair("CFBundleAllowMixedLocalizations",
+		     (bundleProperties.getCFBundleAllowMixedLocalizations() ? "true" : "false"), dict);
 
 		// Mac OS X required, defaults to "6.0"
-		writeKeyStringPair("CFBundleInfoDictionaryVersion", 
+		writeKeyStringPair("CFBundleInfoDictionaryVersion",
 		     bundleProperties.getCFBundleInfoDictionaryVersion(), dict);
 
 		// Bundle Executable name, required, defaults to "JavaApplicationStub"
@@ -199,85 +184,157 @@ public class PropertyListWriter {
 		writeKeyStringPair("CFBundleSignature", bundleProperties.getCFBundleSignature(), dict);
 
 		// Application build number, optional
-		if (bundleProperties.getCFBundleVersion() != null) 
+		if (bundleProperties.getCFBundleVersion() != null)
 			writeKeyStringPair("CFBundleVersion", bundleProperties.getCFBundleVersion(), dict);
-		
+
 		// Application Icon file, optional
-		if (bundleProperties.getCFBundleIconFile() != null) 
+		if (bundleProperties.getCFBundleIconFile() != null)
 			writeKeyStringPair("CFBundleIconFile", bundleProperties.getCFBundleIconFile(), dict);
 
 		// Bundle Identifier, optional
-		if (bundleProperties.getCFBundleIdentifier() != null) 
+		if (bundleProperties.getCFBundleIdentifier() != null)
 			writeKeyStringPair("CFBundleIdentifier", bundleProperties.getCFBundleIdentifier(), dict);
 
 		// Help Book Folder, optional
-		if (bundleProperties.getCFBundleHelpBookFolder() != null) 
+		if (bundleProperties.getCFBundleHelpBookFolder() != null)
 			writeKeyStringPair("CFBundleHelpBookFolder", bundleProperties.getCFBundleHelpBookFolder(), dict);
 
 		// Help Book Name, optional
-		if (bundleProperties.getCFBundleHelpBookName() != null) 
+		if (bundleProperties.getCFBundleHelpBookName() != null)
 			writeKeyStringPair("CFBundleHelpBookName", bundleProperties.getCFBundleHelpBookName(), dict);
 
+		// Copyright, optional
+		if(bundleProperties.getNSHumanReadableCopyright() != null)
+			writeKeyStringPair("NSHumanReadableCopyright", bundleProperties.getNSHumanReadableCopyright(), dict);
+
+		// IsAgent, optional
+		if ( bundleProperties.getLSUIElement() != null )
+			writeKeyBooleanPair( "LSUIElement", bundleProperties.getLSUIElement(), dict );
+
 		// Document Types, optional
 		List documentTypes = bundleProperties.getDocumentTypes();
 
-		if (documentTypes.size() > 0) 
+		if (documentTypes.size() > 0)
  			writeDocumentTypes(documentTypes, dict);
 
-		// Java entry in the plist dictionary
-		writeKey("Java", dict);
-		Node javaDict = createNode("dict", dict);
+		// Java entries in the plist dictionary
+		if (bundleProperties.getJavaVersion() < 1.7) {
+			// Apple Java Version
+
+			writeKey("Java", dict);
+			Node javaDict = createNode("dict", dict);
+
+			// Main class, required
+			writeKeyStringPair("MainClass", bundleProperties.getMainClass(), javaDict);
+
+			// Target JVM version, optional but recommended
+			if (bundleProperties.getJVMVersion() != null)
+				writeKeyStringPair("JVMVersion", bundleProperties.getJVMVersion(), javaDict);
+
+			// New in JarBundler 2.2.0; Tobias Bley ---------------------------------
+
+			// JVMArchs, optional
+			List jvmArchs = bundleProperties.getJVMArchs();
+
+			if (jvmArchs != null && !jvmArchs.isEmpty())
+				writeJVMArchs(jvmArchs, javaDict);
+
+			// lsArchitecturePriority, optional
+			List lsArchitecturePriority = bundleProperties.getLSArchitecturePriority();
+
+			if (lsArchitecturePriority != null && !lsArchitecturePriority.isEmpty())
+				writeLSArchitecturePriority(lsArchitecturePriority, javaDict);
+
+			//-----------------------------------------------------------------------
+
+
+			// Classpath is composed of two types, required
+			// 1: Jars bundled into the JAVA_ROOT of the application
+			// 2: External directories or files with an absolute path
+
+			List classPath = bundleProperties.getClassPath();
+			List extraClassPath = bundleProperties.getExtraClassPath();
+
+			if ((classPath.size() > 0) || (extraClassPath.size() > 0))
+				writeClasspath(classPath, extraClassPath, javaDict);
+
+
+			// JVM options, optional
+			if (bundleProperties.getVMOptions() != null)
+				writeKeyStringPair("VMOptions", bundleProperties.getVMOptions(), javaDict);
+
+			// Working directory, optional
+			if (bundleProperties.getWorkingDirectory() != null)
+				writeKeyStringPair("WorkingDirectory", bundleProperties.getWorkingDirectory(), javaDict);
+
+			// StartOnMainThread, optional
+			if (bundleProperties.getStartOnMainThread() != null) {
+				writeKey("StartOnMainThread", javaDict);
+				createNode(bundleProperties.getStartOnMainThread().toString(), javaDict);
+			}
 
-		// Main class, required
-		writeKeyStringPair("MainClass", bundleProperties.getMainClass(), javaDict);
+			// SplashFile, optional
+			if (bundleProperties.getSplashFile() != null)
+				writeKeyStringPair("SplashFile", bundleProperties.getSplashFile(), javaDict);
 
-		// Target JVM version, optional but recommended
-		if (bundleProperties.getJVMVersion() != null) 
-			writeKeyStringPair("JVMVersion", bundleProperties.getJVMVersion(), javaDict);
+			// Main class arguments, optional
+			if (bundleProperties.getArguments() != null)
+				writeKeyStringPair("Arguments", bundleProperties.getArguments(), javaDict);
 
+			// Java properties, optional
+			Hashtable javaProperties = bundleProperties.getJavaProperties();
 
-		// Classpath is composed of two types, required
-		// 1: Jars bundled into the JAVA_ROOT of the application
-		// 2: External directories or files with an absolute path
+			if (javaProperties.isEmpty() == false)
+				writeJavaProperties(javaProperties, javaDict);
+		} else {
+			// Oracle Java Version
 
-		List classPath = bundleProperties.getClassPath();
-		List extraClassPath = bundleProperties.getExtraClassPath();
+			// Main class, required
+			writeKeyStringPair("JVMMainClassName", bundleProperties.getMainClass(), dict);
 
-		if ((classPath.size() > 0) || (extraClassPath.size() > 0)) 
-			writeClasspath(classPath, extraClassPath, javaDict);
-		
+			// Main class arguments, optional
+			if (bundleProperties.getArguments() != null) {
+				writeKey("JVMArguments", dict);
+				writeArray(Arrays.asList(bundleProperties.getArguments().split("\\s+")), dict);
+			}
 
-		// JVM options, optional
-		if (bundleProperties.getVMOptions() != null) 
-			writeKeyStringPair("VMOptions", bundleProperties.getVMOptions(), javaDict);
+			// JVM options and Java properties, optional
+			if ((bundleProperties.getVMOptions() != null) || !bundleProperties.getJavaProperties().isEmpty()) {
+				writeKey("JVMOptions", dict);
 
-		// Working directory, optional
-		if (bundleProperties.getWorkingDirectory() != null) 
-			writeKeyStringPair("WorkingDirectory", bundleProperties.getWorkingDirectory(), javaDict);
+				List<String> jvmOptions = new ArrayList<String>();
 
-		// Main class arguments, optional
-		if (bundleProperties.getArguments() != null) 
-			writeKeyStringPair("Arguments", bundleProperties.getArguments(), javaDict);
+				if (bundleProperties.getVMOptions() != null)
+					jvmOptions.addAll(Arrays.asList(bundleProperties.getVMOptions().split("\\s+")));
 
-		// Java properties, optional
-		Hashtable javaProperties = bundleProperties.getJavaProperties();
+				Iterator javaPropertiesIterator = bundleProperties.getJavaProperties().entrySet().iterator();
+				while (javaPropertiesIterator.hasNext())
+				{
+					Map.Entry entry = (Map.Entry) javaPropertiesIterator.next();
+					if (((String) entry.getKey()).startsWith("com.apple.")) {
+						System.out.println("Deprecated as of 1.4: " + entry.getKey());
+						continue;
+					}
+					jvmOptions.add("-D" + entry.getKey() + '=' + entry.getValue());
+				}
 
-		if (javaProperties.isEmpty() == false) 
- 			writeJavaProperties(javaProperties, javaDict);
+				writeArray(jvmOptions, dict);
+			}
 
+		}
 
 		// Services, optional
 		List services = bundleProperties.getServices();
-		if (services.size() > 0) 
+		if (services.size() > 0)
  			writeServices(services,dict);
-		
+
 	}
 
 
 	private void writeDocumentTypes(List documentTypes, Node appendTo) {
 
 		writeKey("CFBundleDocumentTypes", appendTo);
-		
+
 		Node array = createNode("array", appendTo);
 
 		Iterator itor = documentTypes.iterator();
@@ -311,7 +368,7 @@ public class PropertyListWriter {
 				writeArray(osTypes, documentDict);
 			}
 
-			
+
 			List mimeTypes = documentType.getMimeTypes();
 
 			if (mimeTypes.isEmpty() == false) {
@@ -319,18 +376,25 @@ public class PropertyListWriter {
 				writeArray(mimeTypes, documentDict);
 			}
 
+			List UTIs = documentType.getUTIs();
+
+			if (UTIs.isEmpty() == false) {
+				writeKey("LSItemContentTypes", documentDict);
+				writeArray(UTIs, documentDict);
+			}
+
 			// Only write this key if true
-			if (documentType.isBundle()) 
+			if (documentType.isBundle())
 				writeKeyStringPair("LSTypeIsPackage", "true", documentDict);
 		}
 	}
-	
+
 	private void writeServices(List services, Node appendTo) {
-	
+
 		writeKey("NSServices",appendTo);
 		Node array = createNode("array",appendTo);
 		Iterator itor = services.iterator();
-		
+
 		while (itor.hasNext()) {
 			Service service = (Service)itor.next();
 			Node serviceDict = createNode("dict",array);
@@ -338,37 +402,37 @@ public class PropertyListWriter {
 			String portName = service.getPortName();
             if (portName == null)
             	portName = bundleProperties.getCFBundleName();
-			
+
 			writeKeyStringPair("NSPortName", portName, serviceDict);
 			writeKeyStringPair("NSMessage",service.getMessage(),serviceDict);
-			
+
 			List sendTypes = service.getSendTypes();
 			if (!sendTypes.isEmpty()) {
 				writeKey("NSSendTypes",serviceDict);
 				writeArray(sendTypes,serviceDict);
 			}
-			
+
 			List returnTypes = service.getReturnTypes();
 			if (!returnTypes.isEmpty()) {
 				writeKey("NSReturnTypes",serviceDict);
 				writeArray(returnTypes,serviceDict);
 			}
-			
+
 			writeKey("NSMenuItem",serviceDict);
 			Node menuItemDict = createNode("dict",serviceDict);
 			writeKeyStringPair("default",service.getMenuItem(),menuItemDict);
-			
+
 			String keyEquivalent = service.getKeyEquivalent();
 			if (null != keyEquivalent) {
 				writeKey("NSKeyEquivalent",serviceDict);
 				Node keyEquivalentDict = createNode("dict",serviceDict);
 				writeKeyStringPair("default",keyEquivalent,keyEquivalentDict);
 			}
-			
+
 			String userData = service.getUserData();
 			if (null != userData)
 				writeKeyStringPair("NSUserData", userData, serviceDict);
-			
+
 			String timeout = service.getTimeout();
 			if (null != timeout)
 				writeKeyStringPair("NSTimeout",timeout,serviceDict);
@@ -383,15 +447,15 @@ public class PropertyListWriter {
 
 
 	private void writeJavaProperties(Hashtable javaProperties, Node appendTo) {
-	
+
 		writeKey("Properties", appendTo);
-		
+
 		Node propertiesDict = createNode("dict", appendTo);
 
 		for (Iterator i = javaProperties.keySet().iterator(); i.hasNext();) {
 			String key = (String) i.next();
 
-			if (key.startsWith("com.apple.") && (version >= 1.4)) {
+			if (key.startsWith("com.apple.") && (bundleProperties.getJavaVersion() >= 1.4)) {
 				System.out.println("Deprecated as of 1.4: " + key);
 				continue;
 			}
@@ -400,7 +464,24 @@ public class PropertyListWriter {
 		}
 	}
 
-	private Node createNode(String tag, Node appendTo) {
+    // New in JarBundler 2.2.0; Tobias Bley ---------------------------------
+
+    private void writeJVMArchs(List jvmArchs, Node appendTo)
+    {
+        writeKey("JVMArchs", appendTo);
+        writeArray(jvmArchs, appendTo);
+    }
+
+    private void writeLSArchitecturePriority(List lsArchitecturePriority, Node appendTo)
+    {
+        writeKey("LSArchitecturePriority", appendTo);
+        writeArray(lsArchitecturePriority, appendTo);
+    }
+
+    //----------------------------------------------------------------------
+
+    private Node createNode(String tag, Node appendTo)
+    {
 		Node node = this.document.createElement(tag);
 		appendTo.appendChild(node);
 		return node;
@@ -408,15 +489,25 @@ public class PropertyListWriter {
 
 
 	private void writeKeyStringPair(String key, String string, Node appendTo) {
-	
+
 		if (string == null)
 			return;
-	
+
 		writeKey(key, appendTo);
 		writeString(string, appendTo);
 	}
 
 
+	private void writeKeyBooleanPair(String key, Boolean b, Node appendTo) {
+
+		if ( b == null )
+			return;
+
+		writeKey( key, appendTo );
+		writeBoolean( b, appendTo );
+	}
+
+
 	private void writeKey(String key, Node appendTo) {
 		Element keyNode = this.document.createElement("key");
 		appendTo.appendChild(keyNode);
@@ -431,12 +522,24 @@ public class PropertyListWriter {
 	}
 
 	private void writeArray(List stringList, Node appendTo) {
-	
-		Node arrayNode = createNode("array", appendTo);	
 
-		for (Iterator it = stringList.iterator(); it.hasNext();) 
+		Node arrayNode = createNode("array", appendTo);
+
+		for (Iterator it = stringList.iterator(); it.hasNext();)
 			writeString((String)it.next(), arrayNode);
-		
+
 	}
 
+	private void writeBoolean( Boolean b, Node appendTo ) {
+		Element booleanNode = null;
+
+		if ( b.booleanValue() ) {
+			booleanNode = this.document.createElement( "true" );
+		}
+		else {
+			booleanNode = this.document.createElement( "false" );
+
+		}
+		appendTo.appendChild( booleanNode );
+	}
 }
diff --git a/net/sourceforge/jarbundler/Service.java b/net/sourceforge/jarbundler/Service.java
index 531eb65..7c9b7f6 100644
--- a/net/sourceforge/jarbundler/Service.java
+++ b/net/sourceforge/jarbundler/Service.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2003, Seth J. Morabito <sethm at loomcom.com> All rights reserved.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
 package net.sourceforge.jarbundler;
 
 import java.util.ArrayList;
@@ -11,7 +27,7 @@ import java.util.List;
  * 
  * Port Name - The name of the port the application monitors for incoming service requests.
  * 
- 
+ *
  * Message - The name of the instance method to invoke for the service. 
  * In Objective-C, the instance method must be of the form messageName:userData:error:.
  * In Java, the instance method must be of the form messageName(NSPasteBoard,String).
@@ -65,30 +81,30 @@ public class Service {
 	
 
 	/** 
-
+	 *
 	 * The name of the instance method to invoke for the service. 
 	 * In Objective-C, the instance method must be of the form messageName:userData:error:.
-
+	 *
 	 * In Java, the instance method must be of the form messageName(NSPasteBoard,String).
 	 */
 	private String message = null;
 	
 
 	/** 
-
+	 *
 	 * The text to add to the Services menu. The value must be unique.
-
+	 *
 	 * You can use a slash character "/" to specify a submenu. For example, Mail/Send
-
+	 *
 	 * would appear in the Services Menu as a menu named Mail with an item named Send.
 	 */
 	private String menuItem = null;
 	
 	/**
 	 * A list of the data type names that can be read by the service.
-
+	 *
 	 * The NSPasteboard class description lists several common data types.
-
+	 *
 	 * You must specify either Send Types, Return Types or both.
 	 */
 	private String[] sendTypes = null;
@@ -96,9 +112,9 @@ public class Service {
 
 	/**
 	 * A list of the data type names that can be returned by the service.
-
+	 *
 	 * The NSPasteboard class description lists several common data types.
-
+	 *
 	 * You must specify either Return Types, Send Types or both.
 	 */
 	private String[] returnTypes = null;
@@ -106,33 +122,33 @@ public class Service {
 
 	/**
 	 * This attribute is optional. The keyboard equivalent used to invoke
-
+	 *
 	 * the service menu command. The value has to be a single character. Users invoke this
-
+	 *
 	 * keyboard equivalent by pressing the Command and Shift key modifiers along with the character.
-
+	 *
 	 */
 	private String keyEquivalent = null;
 	
 
 	/** 
-
+	 *
 	 * This attribute is optional. The value is free choosable and is passed
-
+	 *
 	 * to the method as second parameter.
-
+	 *
 	 */
 	private String userData = null;
 	
 
 	/** 
-
+	 *
 	 * This attribute is optional. It indicates the number of milliseconds
-
+	 *
 	 * Services should wait for a response from the application providing
-
+	 *
 	 * a service when a respond is required.
-
+	 *
 	 */
 	private String timeout = null;
 	
diff --git a/org/gjt/sp/jedit/Autosave.java b/org/gjt/sp/jedit/Autosave.java
index 8b500de..a020112 100644
--- a/org/gjt/sp/jedit/Autosave.java
+++ b/org/gjt/sp/jedit/Autosave.java
@@ -31,7 +31,7 @@ import org.gjt.sp.util.Log;
 
 /**
  * @author Slava Pestov
- * @version $Id: Autosave.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: Autosave.java 23221 2013-09-29 20:03:32Z shlomy $
  */
 class Autosave implements ActionListener
 {
@@ -91,9 +91,8 @@ class Autosave implements ActionListener
 		}
 		boolean autosaveUntitled = jEdit.getBooleanProperty("autosaveUntitled");
 		Buffer[] bufferArray = jEdit.getBuffers();
-		for(int i = 0; i < bufferArray.length; i++)
+		for (Buffer buffer : bufferArray)
 		{
-			Buffer buffer = bufferArray[i];
 			if (autosaveUntitled || !buffer.isUntitled())
 				buffer.autosave();
 		}
diff --git a/org/gjt/sp/jedit/Buffer.java b/org/gjt/sp/jedit/Buffer.java
index 6926bc8..6ca59cd 100644
--- a/org/gjt/sp/jedit/Buffer.java
+++ b/org/gjt/sp/jedit/Buffer.java
@@ -92,7 +92,7 @@ import org.gjt.sp.util.ThreadUtilities;
 
  *
  * @author Slava Pestov
- * @version $Id: Buffer.java 22965 2013-05-02 09:49:17Z kpouer $
+ * @version $Id: Buffer.java 23221 2013-09-29 20:03:32Z shlomy $
  */
 public class Buffer extends JEditBuffer
 {
@@ -1290,12 +1290,11 @@ public class Buffer extends JEditBuffer
 	public String getMarkerNameString()
 	{
 		StringBuilder buf = new StringBuilder();
-		for(int i = 0; i < markers.size(); i++)
+		for (Marker marker : markers)
 		{
-			Marker marker = markers.get(i);
-			if(marker.getShortcut() != '\0')
+			if (marker.getShortcut() != '\0')
 			{
-				if(buf.length() != 0)
+				if (buf.length() != 0)
 					buf.append(' ');
 				buf.append(marker.getShortcut());
 			}
@@ -1387,11 +1386,10 @@ public class Buffer extends JEditBuffer
 	 */
 	public Marker getMarkerInRange(int start, int end)
 	{
-		for(int i = 0; i < markers.size(); i++)
+		for (Marker marker : markers)
 		{
-			Marker marker = markers.get(i);
 			int pos = marker.getPosition();
-			if(pos >= start && pos < end)
+			if (pos >= start && pos < end)
 				return marker;
 		}
 
@@ -1407,10 +1405,9 @@ public class Buffer extends JEditBuffer
 	 */
 	public Marker getMarkerAtLine(int line)
 	{
-		for(int i = 0; i < markers.size(); i++)
+		for (Marker marker : markers)
 		{
-			Marker marker = markers.get(i);
-			if(getLineOfOffset(marker.getPosition()) == line)
+			if (getLineOfOffset(marker.getPosition()) == line)
 				return marker;
 		}
 
@@ -1450,8 +1447,8 @@ public class Buffer extends JEditBuffer
 	{
 		setFlag(MARKERS_CHANGED,true);
 
-		for(int i = 0; i < markers.size(); i++)
-			markers.get(i).removePosition();
+		for (Marker marker : markers)
+			marker.removePosition();
 
 		markers.removeAllElements();
 
@@ -2078,14 +2075,13 @@ public class Buffer extends JEditBuffer
 		}
 
 		// Create marker positions
-		for(int i = 0; i < markers.size(); i++)
+		for (Marker marker : markers)
 		{
-			Marker marker = markers.get(i);
 			marker.removePosition();
 			int pos = marker.getPosition();
-			if(pos > getLength())
+			if (pos > getLength())
 				marker.setPosition(getLength());
-			else if(pos < 0)
+			else if (pos < 0)
 				marker.setPosition(0);
 			marker.createPosition();
 		}
diff --git a/org/gjt/sp/jedit/Debug.java b/org/gjt/sp/jedit/Debug.java
index ebe4a04..9bf7d22 100644
--- a/org/gjt/sp/jedit/Debug.java
+++ b/org/gjt/sp/jedit/Debug.java
@@ -27,7 +27,7 @@ package org.gjt.sp.jedit;
  * development) and debugging routines.
  * @since jEdit 4.2pre1
  * @author Slava Pestov
- * @version $Id: Debug.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: Debug.java 23185 2013-09-18 20:01:10Z ezust $
  */
 public class Debug
 {
@@ -104,13 +104,10 @@ public class Debug
 	 */
 	public static boolean BEANSHELL_DEBUG = false;
 
-	/**
-	 * If true, an alternative dispatcher using key typed events will be
-	 * used to handle a modifier key press in conjunction with an alphabet
-	 * key. <b>On by default on MacOS.</b>
-	 */
-	public static boolean ALTERNATIVE_DISPATCHER = OperatingSystem.isMacOS();
-
+	/** @deprecated no longer used. */
+	@Deprecated
+	public static boolean ALTERNATIVE_DISPATCHER = false;
+	
 	/**
 	 * If true, A+ shortcuts are disabled. If you use this, you should also
 	 * remap the the modifiers so that A+ is actually something else.
diff --git a/org/gjt/sp/jedit/EditPane.java b/org/gjt/sp/jedit/EditPane.java
index 16b5de7..72c7f16 100644
--- a/org/gjt/sp/jedit/EditPane.java
+++ b/org/gjt/sp/jedit/EditPane.java
@@ -89,7 +89,7 @@ import org.gjt.sp.util.ThreadUtilities;
  * @see View#getEditPanes()
  *
  * @author Slava Pestov
- * @version $Id: EditPane.java 22181 2012-09-09 23:29:58Z ezust $
+ * @version $Id: EditPane.java 23701 2014-10-26 14:09:49Z ezust $
  */
 public class EditPane extends JPanel implements BufferSetListener
 {
@@ -220,7 +220,7 @@ public class EditPane extends JPanel implements BufferSetListener
 					// This must happen after loadCaretInfo.
 					// Otherwise caret is not restored properly.
 					int check = jEdit.getIntegerProperty("checkFileStatus");
-					if (jEdit.isStartupDone() && (check & GeneralOptionPane.checkFileStatus_focusBuffer) > 0);
+					if (jEdit.isStartupDone() && (check & GeneralOptionPane.checkFileStatus_focusBuffer) > 0)
 						jEdit.checkBufferStatus(view, true);
 				}
 			});
@@ -509,10 +509,9 @@ public class EditPane extends JPanel implements BufferSetListener
 
 		int caret = textArea.getCaretPosition();
 
-		for(int i = 0; i < markers.size(); i++)
+		for (Marker _marker : markers)
 		{
-			Marker _marker = markers.get(i);
-			if(_marker.getPosition() > caret)
+			if (_marker.getPosition() > caret)
 			{
 				marker = _marker;
 				break;
@@ -603,17 +602,15 @@ public class EditPane extends JPanel implements BufferSetListener
 
 		// always add markers on selected lines
 		Selection[] selection = textArea.getSelection();
-		for(int i = 0; i < selection.length; i++)
+		for (Selection s : selection)
 		{
-			Selection s = selection[i];
 			int startLine = s.getStartLine();
-			if(startLine != s.getEndLine() && startLine != caretLine)
+			if (startLine != s.getEndLine() && startLine != caretLine)
 			{
-				buffer.addMarker('\0',s.getStart());
+				buffer.addMarker('\0', s.getStart());
 			}
 
-			if(s.getEndLine() != caretLine)
-				buffer.addMarker('\0',s.getEnd());
+			if (s.getEndLine() != caretLine) buffer.addMarker('\0', s.getEnd());
 		}
 
 		// toggle marker on caret line
@@ -906,8 +903,9 @@ public class EditPane extends JPanel implements BufferSetListener
 			"view.gutter.structureHighlight"));
 		gutter.setStructureHighlightColor(
 			jEdit.getColorProperty("view.gutter.structureHighlightColor"));
-		gutter.setBackground(
-			jEdit.getColorProperty("view.gutter.bgColor"));
+		Color backgroundColor = jEdit.getColorProperty("view.gutter.bgColor");
+		gutter.setBackground(backgroundColor);
+		textArea.setBackground(backgroundColor);
 		gutter.setForeground(
 			jEdit.getColorProperty("view.gutter.fgColor"));
 		gutter.setHighlightedForeground(
diff --git a/org/gjt/sp/jedit/EditPlugin.java b/org/gjt/sp/jedit/EditPlugin.java
index c8b364b..2018823 100644
--- a/org/gjt/sp/jedit/EditPlugin.java
+++ b/org/gjt/sp/jedit/EditPlugin.java
@@ -217,7 +217,7 @@ plugin.QuickNotepadPlugin.version=4.5
 plugin.QuickNotepadPlugin.docs=index.html
 # see jEdit.getBuild() to understand jEdit's version convention:
 plugin.QuickNotepadPlugin.depend.0=jedit 04.05.99.00
-plugin.QuickNotepadPlugin.depend.1=jdk 1.6
+plugin.QuickNotepadPlugin.depend.1=jdk 1.7
 plugin.QuickNotepadPlugin.description=This plugin provides a dockable "scratch pad" for writing and displaying notes, to do lists or similar items as unformatted text.
 # plugin menu
 plugin.QuickNotepadPlugin.menu=quicknotepad \
diff --git a/org/gjt/sp/jedit/EditServer.java b/org/gjt/sp/jedit/EditServer.java
index a286c57..b6d216a 100644
--- a/org/gjt/sp/jedit/EditServer.java
+++ b/org/gjt/sp/jedit/EditServer.java
@@ -58,7 +58,7 @@ import org.gjt.sp.util.Log;
  * complicated stuff can be done too.
  *
  * @author Slava Pestov
- * @version $Id: EditServer.java 22487 2012-11-18 00:59:11Z ezust $
+ * @version $Id: EditServer.java 23220 2013-09-29 19:19:24Z shlomy $
  */
 public class EditServer extends Thread
 {
@@ -153,22 +153,6 @@ public class EditServer extends Thread
 					Log.log(Log.ERROR,this,e);
 				abort = true;
 			}
-			finally
-			{
-				/* if(client != null)
-				{
-					try
-					{
-						client.close();
-					}
-					catch(Exception e)
-					{
-						Log.log(Log.ERROR,this,e);
-					}
-
-					client = null;
-				} */
-			}
 		}
 	} //}}}
 
diff --git a/org/gjt/sp/jedit/GUIUtilities.java b/org/gjt/sp/jedit/GUIUtilities.java
index 3447ecd..33a04f4 100644
--- a/org/gjt/sp/jedit/GUIUtilities.java
+++ b/org/gjt/sp/jedit/GUIUtilities.java
@@ -88,7 +88,7 @@ import java.awt.event.*;
  * </ul>
  *
  * @author Slava Pestov
- * @version $Id: GUIUtilities.java 21920 2012-07-03 15:35:12Z kpouer $
+ * @version $Id: GUIUtilities.java 23449 2014-03-30 19:14:26Z kerik-sf $
  */
 public class GUIUtilities
 {
@@ -527,7 +527,7 @@ public class GUIUtilities
 		}
 
 		String toolTip = prettifyMenuLabel(label);
-		String shortcutLabel = getShortcutLabel(name);
+		String shortcutLabel = getShortcutLabel(name, true);
 		if(shortcutLabel != null)
 		{
 			toolTip = toolTip + " (" + shortcutLabel + ')';
@@ -582,8 +582,9 @@ public class GUIUtilities
 	/**
 	 * Returns a label string to show users what shortcut are
 	 * assigned to the action.
+	 * @param platform if true, show fancy platform-specific label for the modifiers. 
 	 */
-	public static String getShortcutLabel(String action)
+	public static String getShortcutLabel(String action, Boolean platform)
 	{
 		if(action == null)
 			return null;
@@ -593,8 +594,8 @@ public class GUIUtilities
 			String shortcut1 = keymap.getShortcut(action + ".shortcut");
 			String shortcut2 = keymap.getShortcut(action + ".shortcut2");
 
-			shortcut1 = getPlatformShortcutLabel(shortcut1);
-			shortcut2 = getPlatformShortcutLabel(shortcut2);
+			shortcut1 = platform ? getPlatformShortcutLabel(shortcut1) : shortcut1;
+			shortcut2 = platform ? getPlatformShortcutLabel(shortcut2) : shortcut2;
 
 			if(shortcut1 == null || shortcut1.length() == 0)
 			{
@@ -1864,19 +1865,6 @@ public class GUIUtilities
 		frame.addComponentListener(ss);
 	} //}}}
 
-	//{{{ initContinuousLayout() method
-	/**
-	 * This method do nothing.
-	 *
-	 * @param split the split. It must never be null
-	 * @since jEdit 4.3pre9
-	 * @deprecated since jEdit 5.0 using or not continuous layout is not anymore an option.
-	 */
-	@Deprecated
-	public static void initContinuousLayout(JSplitPane split)
-	{
-	} //}}}
-
 	//{{{ Package-private members
 
 	//{{{ initializeDeprecatedIcons() method
@@ -1982,7 +1970,22 @@ public class GUIUtilities
 	//{{{ showSplashScreen() method
 	static void showSplashScreen()
 	{
-		splash = new SplashScreen();
+		// Have to do it in the EDT, since it creates gui components
+		try
+		{
+			SwingUtilities.invokeAndWait(new Runnable()
+			{
+				public void run()
+				{
+					splash = new SplashScreen();
+				}
+			});
+		}
+		catch (Exception e)
+		{
+			Log.log(Log.ERROR, GUIUtilities.class,
+					"error displaying splash screen !",e);
+		}
 	} //}}}
 
 	//{{{ advanceSplashProgress() method
@@ -2148,7 +2151,7 @@ public class GUIUtilities
 	 * For non-Frame's use {@link GUIUtilities#saveGeometry(Window,String)}
 	 *
 	 * @author Björn Kautler
-	 * @version $Id: GUIUtilities.java 21920 2012-07-03 15:35:12Z kpouer $
+	 * @version $Id: GUIUtilities.java 23449 2014-03-30 19:14:26Z kerik-sf $
 	 * @since jEdit 4.3pre6
 	 * @see GUIUtilities#saveGeometry(Window,Container,String)
 	 */
diff --git a/org/gjt/sp/jedit/JARClassLoader.java b/org/gjt/sp/jedit/JARClassLoader.java
index 5d122d0..b0ead7b 100644
--- a/org/gjt/sp/jedit/JARClassLoader.java
+++ b/org/gjt/sp/jedit/JARClassLoader.java
@@ -43,7 +43,7 @@ import java.util.jar.Attributes.Name;
  * A class loader implementation that loads classes from JAR files. All
  * instances share the same set of classes.
  * @author Slava Pestov
- * @version $Id: JARClassLoader.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: JARClassLoader.java 23224 2013-09-30 20:51:42Z shlomy $
  */
 public class JARClassLoader extends ClassLoader
 {
@@ -325,19 +325,15 @@ public class JARClassLoader extends ClassLoader
 		String[] classes = jar.getClasses();
 		if(classes != null)
 		{
-			for(int i = 0; i < classes.length; i++)
-			{
-				classHash.put(classes[i],this);
-			}
+			for (String aClass : classes)
+				classHash.put(aClass, this);
 		}
 
 		String[] resources = jar.getResources();
 		if(resources != null)
 		{
-			for(int i = 0; i < resources.length; i++)
-			{
-				resourcesHash.put(resources[i],this);
-			}
+			for (String resource : resources)
+				resourcesHash.put(resource, this);
 		}
 	} //}}}
 
@@ -347,11 +343,11 @@ public class JARClassLoader extends ClassLoader
 		String[] classes = jar.getClasses();
 		if(classes != null)
 		{
-			for(int i = 0; i < classes.length; i++)
+			for (String aClass : classes)
 			{
-				Object loader = classHash.get(classes[i]);
-				if(loader == this)
-					classHash.remove(classes[i]);
+				Object loader = classHash.get(aClass);
+				if (loader == this)
+					classHash.remove(aClass);
 				else
 					/* two plugins provide same class! */;
 			}
@@ -361,11 +357,11 @@ public class JARClassLoader extends ClassLoader
 		if(resources == null)
 			return;
 
-		for(int i = 0; i < resources.length; i++)
+		for (String resource : resources)
 		{
-			Object loader = resourcesHash.get(resources[i]);
-			if(loader == this)
-				resourcesHash.remove(resources[i]);
+			Object loader = resourcesHash.get(resource);
+			if (loader == this)
+				resourcesHash.remove(resource);
 			else
 				/* two plugins provide same resource! */;
 		}
diff --git a/org/gjt/sp/jedit/JEditActionContext.java b/org/gjt/sp/jedit/JEditActionContext.java
index 938b48e..86df03a 100644
--- a/org/gjt/sp/jedit/JEditActionContext.java
+++ b/org/gjt/sp/jedit/JEditActionContext.java
@@ -64,16 +64,16 @@ public abstract class JEditActionContext<F extends JEditAbstractEditAction, E ex
 		actionSets.addElement(actionSet);
 		actionSet.context = this;
 		String[] actions = actionSet.getActionNames();
-		for(int i = 0; i < actions.length; i++)
+		for (String action : actions)
 		{
 			/* Is it already there? */
-			if (actionHash.containsKey(actions[i])) 
+			if (actionHash.containsKey(action))
 			{
 				/* Save it for plugin unloading time */
-				E oldAction = actionHash.get(actions[i]);
-				overriddenActions.put(actions[i], oldAction);
+				E oldAction = actionHash.get(action);
+				overriddenActions.put(action, oldAction);
 			}
-			actionHash.put(actions[i],actionSet);
+			actionHash.put(action, actionSet);
 		}
 	} //}}}
 
@@ -88,13 +88,13 @@ public abstract class JEditActionContext<F extends JEditAbstractEditAction, E ex
 		actionSets.removeElement(actionSet);
 		actionSet.context = null;
 		String[] actions = actionSet.getActionNames();
-		for(int i = 0; i < actions.length; i++)
+		for (String action : actions)
 		{
-			actionHash.remove(actions[i]);
-			if (overriddenActions.containsKey(actions[i])) 
+			actionHash.remove(action);
+			if (overriddenActions.containsKey(action))
 			{
-				E oldAction = overriddenActions.remove(actions[i]);
-				actionHash.put(actions[i], oldAction);
+				E oldAction = overriddenActions.remove(action);
+				actionHash.put(action, oldAction);
 			}
 		}
 	} //}}}
diff --git a/org/gjt/sp/jedit/JEditActionSet.java b/org/gjt/sp/jedit/JEditActionSet.java
index a6719b3..90b1f66 100644
--- a/org/gjt/sp/jedit/JEditActionSet.java
+++ b/org/gjt/sp/jedit/JEditActionSet.java
@@ -169,10 +169,8 @@ public abstract class JEditActionSet<E extends JEditAbstractEditAction> implemen
 		this.uri = uri;
 		if(cachedActionNames != null)
 		{
-			for(int i = 0; i < cachedActionNames.length; i++)
-			{
-				actions.put(cachedActionNames[i],placeholder);
-			}
+			for (String cachedActionName : cachedActionNames)
+				actions.put(cachedActionName, placeholder);
 		}
 		loaded = false;
 	} //}}}
@@ -220,10 +218,8 @@ public abstract class JEditActionSet<E extends JEditAbstractEditAction> implemen
 		{
 			context.actionNames = null;
 			String[] actions = getActionNames();
-			for(int i = 0; i < actions.length; i++)
-			{
-				context.actionHash.remove(actions[i]);
-			}
+			for (String action : actions)
+				context.actionHash.remove(action);
 		}
 		actions.clear();
 	} //}}}
@@ -380,9 +376,14 @@ public abstract class JEditActionSet<E extends JEditAbstractEditAction> implemen
 		{
 			Log.log(Log.DEBUG,this,"Loading actions from " + uri);
 			ActionListHandler ah = new ActionListHandler(uri.toString(),this);
-			InputStream in = uri.openStream();
-			if(in == null)
+			InputStream in;
+			try
+			{
+				in = uri.openStream();
+			}
+			catch(FileNotFoundException e)
 			{
+				in = null;
 				// this happened when calling generateCache() in the context of 'find orphan jars'
 				// in org.gjt.sp.jedit.pluginmgr.ManagePanel.FindOrphan.actionPerformed(ActionEvent)
 				// because for not loaded plugins, the plugin will not be added to the list of pluginJars
@@ -391,7 +392,7 @@ public abstract class JEditActionSet<E extends JEditAbstractEditAction> implemen
 				// Better log a small error message than a big stack trace
 				Log.log(Log.WARNING, this, "Unable to open: " + uri);
 			}
-			else if ( XMLUtilities.parseXML(in, ah))
+			if (in != null && XMLUtilities.parseXML(in, ah))
 			{
 				Log.log(Log.ERROR, this, "Unable to parse: " + uri);
 			}
diff --git a/org/gjt/sp/jedit/Macros.java b/org/gjt/sp/jedit/Macros.java
index 5dc12c7..68fa823 100644
--- a/org/gjt/sp/jedit/Macros.java
+++ b/org/gjt/sp/jedit/Macros.java
@@ -58,7 +58,7 @@ import java.util.regex.Pattern;
  * the methods in the {@link GUIUtilities} class instead.
  *
  * @author Slava Pestov
- * @version $Id: Macros.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: Macros.java 23221 2013-09-29 20:03:32Z shlomy $
  */
 public class Macros
 {
@@ -79,8 +79,8 @@ public class Macros
 			{
 				buffer.beginCompoundEdit();
 
-file_loop:			for(int i = 0; i < paths.length; i++)
-					runScript(view,paths[i],false);
+				for (String path : paths)
+					runScript(view, path, false);
 			}
 			finally
 			{
@@ -446,9 +446,8 @@ file_loop:			for(int i = 0; i < paths.length; i++)
 	 */
 	public static Handler getHandlerForPathName(String pathName)
 	{
-		for (int i = 0; i < macroHandlers.size(); i++)
+		for (Handler handler : macroHandlers)
 		{
-			Handler handler = macroHandlers.get(i);
 			if (handler.accept(pathName))
 				return handler;
 		}
@@ -464,9 +463,8 @@ file_loop:			for(int i = 0; i < paths.length; i++)
 	 */
 	public static Handler getHandler(String name)
 	{
-		for (int i = 0; i < macroHandlers.size(); i++)
+		for (Handler handler : macroHandlers)
 		{
-			Handler handler = macroHandlers.get(i);
 			if (handler.getName().equals(name))
 				return handler;
 		}
@@ -776,44 +774,41 @@ file_loop:			for(int i = 0; i < paths.length; i++)
 		if(macroFiles == null || macroFiles.length == 0)
 			return;
 
-		for(int i = 0; i < macroFiles.length; i++)
+		for (File file : macroFiles)
 		{
-			File file = macroFiles[i];
 			String fileName = file.getName();
-			if(file.isHidden())
+			if (file.isHidden())
 			{
 				/* do nothing! */
 			}
-			else if(file.isDirectory())
+			else if (file.isDirectory())
 			{
-				String submenuName = fileName.replace('_',' ');
+				String submenuName = fileName.replace('_', ' ');
 				List submenu = null;
 				//{{{ try to merge with an existing menu first
-				for(int j = 0; j < vector.size(); j++)
+				for (Object obj : vector)
 				{
-					Object obj = vector.get(j);
-					if(obj instanceof List)
+					if (obj instanceof List)
 					{
-						List vec = (List)obj;
-						if(submenuName.equals(vec.get(0)))
+						List vec = (List) obj;
+						if (submenuName.equals(vec.get(0)))
 						{
 							submenu = vec;
 							break;
 						}
 					}
 				} //}}}
-				if(submenu == null)
+				if (submenu == null)
 				{
 					submenu = new Vector();
 					submenu.add(submenuName);
 					vector.add(submenu);
 				}
 
-				loadMacros(submenu,path + fileName + '/',file);
-			}
-			else
+				loadMacros(submenu, path + fileName + '/', file);
+			} else
 			{
-				addMacro(file,path,vector);
+				addMacro(file, path, vector);
 			}
 		}
 	} //}}}
diff --git a/org/gjt/sp/jedit/MiscUtilities.java b/org/gjt/sp/jedit/MiscUtilities.java
index 1037fcd..e222256 100644
--- a/org/gjt/sp/jedit/MiscUtilities.java
+++ b/org/gjt/sp/jedit/MiscUtilities.java
@@ -27,9 +27,9 @@ package org.gjt.sp.jedit;
 
 //{{{ Imports
 import java.io.*;
-import java.io.File;
-import java.io.IOException;
 import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
 import java.net.URL;
 import java.nio.charset.MalformedInputException;
 import java.util.*;
@@ -57,7 +57,7 @@ import org.gjt.sp.util.StringList;
  * <li>{@link #constructPath(String,String)}</li>
  * </ul>
  *
- * @version $Id: MiscUtilities.java 22828 2013-03-05 19:40:05Z ezust $
+ * @version $Id: MiscUtilities.java 23749 2014-12-04 19:51:43Z ezust $
  */
 public class MiscUtilities
 {
@@ -126,14 +126,30 @@ public class MiscUtilities
 	static final Pattern varPattern2 = Pattern.compile(varPatternString2);
 	static final Pattern winPattern = Pattern.compile(winPatternString);
 
-	/** Accepts a string from the user which may contain variables of various syntaxes.
-	 *  The function supports the following expansion syntaxes:
+
+	/** A helper function for expandVariables when handling Windows paths on non-windows systems.
+	*/
+	private static String win2unix(String winPath)
+	{
+		String unixPath = winPath.replace('\\', '/');
+		Matcher m = winPattern.matcher(unixPath);
+		if (m.find())
+		{
+			String varName = m.group(2);
+			String expansion = System.getenv(varName);
+			if (expansion != null)
+				return m.replaceFirst(expansion);
+		}
+		return unixPath;
+	}
+
+	/** Accepts a string from the user (or a settings file) which may contain a variable-prefix path of various syntaxes. Performs the reverse of abbreviate() from any platform.
+	 *  The function supports the following prefix syntaxes:
 	 *     ~/ or ~\   expand to user.home
-	 *     $varname
-	 *     ${varname} (on non-windows)
-	 *     %varname% (on Windows)
-	 *     And expand each of these by looking at the system environment variables for possible
-	 *     expansions.
+	 *     $varname (all platforms)
+	 *     %varname% (all platforms)
+	 *     ${varname} (non-Windows platforms)
+	 *     And expand each of these by looking at the system environment variables for possible expansions.
 	 *     @return a string which is either the unchanged input string, or one with expanded variables.
 	 *     @since jEdit 4.3
 	 *     @see #abbreviate
@@ -143,8 +159,12 @@ public class MiscUtilities
 	{
 		if (arg.startsWith("~/") || arg.startsWith("~\\"))
 			return System.getProperty("user.home") + arg.substring(1);
+
+		Matcher m = winPattern.matcher(arg);
+		if (!OperatingSystem.isWindows() && m.find() )
+			return win2unix(arg);
 		Pattern p = varPattern;
-		Matcher m = p.matcher(arg);
+		m = p.matcher(arg);
 		if (!m.find())
 		{
 			if (OperatingSystem.isWindows())
@@ -172,8 +192,11 @@ public class MiscUtilities
 	} //}}}
 
 	//{{{ abbreviate() methods
-	/** @return an abbreviated path, replacing values with variables, if a prefix exists.
-		uses platform convention (%varname% on windows, $varname on other platforms)
+	/** The reverse of expandVariables(), returns a shortened path if possible.
+	 *
+	 *  Uses platform convention (%varname% on windows, $varname on other platforms)
+	 *
+	 *	@return an abbreviated path, replacing values with variables, if a prefix exists.
 	 *  @see #expandVariables
 	 *  @since jEdit 4.3pre16
 	 */
@@ -183,15 +206,15 @@ public class MiscUtilities
 			svc = new VarCompressor();
 		return svc.compress(path);
 	}
-	
-	/** Same as abbreviate() but checks a view option which can 
-	 * disable the feature for things jEdit UI components.
-	 * 
+
+	/** Same as abbreviate() but checks a view option which can
+	 *  disable the feature for jEdit UI components.
+	 *  @since jEdit 5.1
 	 */
 	public static String abbreviateView(String path)
 	{
 		if (!jEdit.getBooleanProperty("view.abbreviatePaths")) return path;
-		return abbreviate(path);		
+		return abbreviate(path);
 	} //}}}
 
 	//{{{ resolveSymlinks() method
@@ -585,14 +608,16 @@ public class MiscUtilities
 	} //}}}
 
 	//{{{ openInDesktop() method
-	/** Opens a file using the desktop file associations.
+	/** Opens a file or URI using the desktop file associations.
 		<p>
 		Uses native desktop commands for each platform, which ask the user to choose an
 		association for files that do not already have one, using the desktop's
 		dialog, in contrast to Desktop.open() which just throws an IOException
 		for unknown types.
 
-		@param path path or URL (supported on Linux, anyway) of thing to open
+		If a URI is supplied, use desktop browser.
+
+		@param path: path or URI of thing to open/browse
 		@author Alan Ezust
 		@since jEdit 5.0
 	*/
@@ -601,18 +626,30 @@ public class MiscUtilities
 		StringList sl = new StringList();
 		if (OperatingSystem.isWindows())
 		{
-			sl.add("rundll32");
-			sl.add("SHELL32.DLL,ShellExec_RunDLL");
+			if (MiscUtilities.isURL(path)) try {
+				URI uri = new URI(path);
+				java.awt.Desktop.getDesktop().browse(uri);
+				return;
+			}
+			catch (IOException ioe) {
+				Log.log(Log.ERROR, path, "Can't open URI", ioe);
+			} catch (URISyntaxException use) {
+				Log.log(Log.ERROR, path, "Bad URI syntax:", use);
+			}
+			else {
+				sl.add("rundll32");
+				sl.add("SHELL32.DLL,ShellExec_RunDLL");
+			}
 		}
 		else if (OperatingSystem.isMacOS())
 			sl.add("open");
 		else if (OperatingSystem.isX11())
 		{
 			/* For gnome, use gnome-open. Need a way of testing that gnome is actually
-			   running though. Otherwise it is not the correct program to use. 
+			   running though. Otherwise it is not the correct program to use.
 			File f = new File("/usr/bin/gnome-open");
 			if (f.exists()) sl.add("gnome-open");
-			else */ 
+			else */
 			sl.add("xdg-open");
 		}
 		try
diff --git a/org/gjt/sp/jedit/Mode.java b/org/gjt/sp/jedit/Mode.java
index 6e5b868..51f1ad2 100644
--- a/org/gjt/sp/jedit/Mode.java
+++ b/org/gjt/sp/jedit/Mode.java
@@ -48,7 +48,7 @@ import org.gjt.sp.util.StandardUtilities;
  * One instance of this class is created for each supported edit mode.
  *
  * @author Slava Pestov
- * @version $Id: Mode.java 22949 2013-04-23 18:53:15Z thomasmey $
+ * @version $Id: Mode.java 23224 2013-09-30 20:51:42Z shlomy $
  */
 public class Mode
 {
@@ -394,9 +394,9 @@ public class Mode
 			};
 
 			StringBuilder buf = new StringBuilder();
-			for(int i = 0; i < props.length; i++)
+			for (String prop1 : props)
 			{
-				String prop = (String) getProperty(props[i]);
+				String prop = (String) getProperty(prop1);
 				if (prop != null)
 					buf.append(prop);
 			}
@@ -431,10 +431,8 @@ public class Mode
 			"unalignedCloseBracket",
 		};
 
-		for(int i = 0; i < bracketProps.length; i++)
-		{
-			createBracketIndentRules(bracketProps[i], rules);
-		}
+		for (String bracketProp : bracketProps)
+			createBracketIndentRules(bracketProp, rules);
 
 		String[] finalProps = {
 			"unindentThisLine",
diff --git a/org/gjt/sp/jedit/OperatingSystem.java b/org/gjt/sp/jedit/OperatingSystem.java
index bee1849..d9a809f 100644
--- a/org/gjt/sp/jedit/OperatingSystem.java
+++ b/org/gjt/sp/jedit/OperatingSystem.java
@@ -37,7 +37,7 @@ import org.gjt.sp.util.Log;
 /**
  * Operating system detection routines.
  * @author Slava Pestov
- * @version $Id: OperatingSystem.java 22935 2013-04-17 17:24:33Z ezust $
+ * @version $Id: OperatingSystem.java 23221 2013-09-29 20:03:32Z shlomy $
  * @since jEdit 4.0pre4
  */
 public class OperatingSystem
@@ -90,10 +90,9 @@ public class OperatingSystem
 		// Get available screens
 		// O(n^3), this is nasty, but since we aren't dealling with
 		// many items it should be fine
-		for (int i=0; i < gd.length; i++)
+		for (GraphicsDevice aGd : gd)
 		{
-			GraphicsConfiguration gc = gd[i]
-				.getDefaultConfiguration();
+			GraphicsConfiguration gc = aGd.getDefaultConfiguration();
 			// Don't add duplicates
 			if (window.intersects(gc.getBounds()))
 			{
@@ -264,26 +263,17 @@ public class OperatingSystem
 		return hasScreenMenuBar == 1;
 	} //}}}
 
-	//{{{ hasJava16() method
-	/**
-	 * Returns true always 
-	 * @since jEdit 4.3pre17
-	 * @deprecated obsolete, since we depend on Java 1.6 now
-	 */
-	@Deprecated
-	public static boolean hasJava16()
-	{
-		return true;
-	} //}}}
-
 	//{{{ hasJava17() method
 	/**
+	 * @deprecated - there is no point in checking for this
+	 *				 since we require Java 1.7.
 	 * Returns if Java 2 version 1.7 is in use.
 	 * @since jEdit 5.0pre1
 	 */
+	@Deprecated
 	public static boolean hasJava17()
 	{
-		return java17;
+		return true;
 	} //}}}
 
 	
@@ -306,7 +296,6 @@ public class OperatingSystem
 	private static final int UNKNOWN = 0xBAD;
 
 	private static int os;
-	private static boolean java17;
 	private static int hasScreenMenuBar = -1;
 
 	//{{{ Class initializer
@@ -346,12 +335,13 @@ public class OperatingSystem
 		}
 		// for debugging, make jEdit think its using a different
 		// version of Java than it really is.
+		/*
 		String javaVersion = System.getProperty("jedit.force.java.version");
 		if(javaVersion == null || javaVersion.isEmpty())
 			javaVersion = System.getProperty("java.version");
 		if(javaVersion == null || javaVersion.isEmpty())
-			javaVersion = System.getProperty("java.runtime.version");
-		java17 = javaVersion.compareTo("1.7") >= 0;
+			javaVersion = System.getProperty("java.runtime.version"); */
+		// java17 = javaVersion.compareTo("1.7") >= 0;
 	} //}}}
 
 	//}}}
diff --git a/org/gjt/sp/jedit/PluginJAR.java b/org/gjt/sp/jedit/PluginJAR.java
index e9b3cff..7244b2c 100644
--- a/org/gjt/sp/jedit/PluginJAR.java
+++ b/org/gjt/sp/jedit/PluginJAR.java
@@ -38,10 +38,12 @@ import java.io.InputStream;
 import java.io.Reader;
 import java.lang.reflect.Modifier;
 import java.net.URL;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.LinkedHashSet;
 import java.util.LinkedList;
 import java.util.List;
@@ -142,7 +144,7 @@ import static org.gjt.sp.jedit.EditBus.EBHandler;
  * @see ServiceManager
  *
  * @author Slava Pestov
- * @version $Id: PluginJAR.java 22920 2013-04-06 15:03:55Z kerik-sf $
+ * @version $Id: PluginJAR.java 23224 2013-09-30 20:51:42Z shlomy $
  * @since jEdit 4.2pre1
  */
 public class PluginJAR
@@ -172,10 +174,16 @@ public class PluginJAR
 	private boolean activated;
 
 	// Lists of jarPaths
+	/** These plugins require this plugin */
 	private final Set<String> theseRequireMe = new LinkedHashSet<String>();
+	
 	/** The plugins that uses me as optional dependency. */
 	private final Set<String> theseUseMe = new LinkedHashSet<String>();
+	
+	/** This plugin requires these plugins. */
 	private final Set<String> weRequireThese = new LinkedHashSet<String>();
+	
+	/** These plugins are an optional dependency for me, I'll use them if they are available, no worries if they aren't. */
 	private final Set<String> weUseThese = new LinkedHashSet<String>();
 	//}}}
 
@@ -218,6 +226,7 @@ public class PluginJAR
 				load(jarPath, true);
 			}
 		}
+		
 		// Load extra jars that are part of this plugin
 		String jars = jEdit.getProperty("plugin." + className + ".jars");
 		if(jars != null)
@@ -237,9 +246,36 @@ public class PluginJAR
 		jar.checkDependencies();
 		jar.activatePluginIfNecessary();
 		jEdit.propertiesChanged();
+		
+		// check all other installed plugins to see if any of them  
+		// use me. Reload those that do so the classloaders work together.
+		PluginJAR[] installedPlugins = jEdit.getPluginJARs();
+		for (PluginJAR installed : installedPlugins)
+		{
+			if (installed == null || installed.equals(jar) )
+			{
+				continue;	
+			}
+			EditPlugin ep = installed.getPlugin();
+			if (ep == null) 
+			{
+				continue;
+			}
+			String installedClassname = ep.getClassName();
+			PluginDepends[] deps = getPluginDepends(installedClassname);
+			for (PluginDepends dep : deps)
+			{
+				if ("plugin".equals(dep.what) && className.equals(dep.name))
+				{
+					String reloadPath = ep.getPluginJAR().getPath();
+					jEdit.removePluginJAR(ep.getPluginJAR(), false);
+					load(reloadPath, true);
+				}
+			}
+		}
 		return jar;
 	} // }}}
-
+	
 	//{{{ getPath() method
 	/**
 	 * Returns the full path name of this plugin's JAR file.
@@ -329,21 +365,13 @@ public class PluginJAR
 	 */
 	public static Set<String> getDependencySet(String className)
 	{
-		String dep;
 		Set<String> retval = new LinkedHashSet<String>();
-		int i=0;
-		while((dep = jEdit.getProperty("plugin." + className + ".depend." + i++)) != null)
+		PluginDepends[] deps = getPluginDepends(className);
+		for (PluginDepends pluginDepends : deps)
 		{
-			PluginDepends pluginDepends;
-			try
-			{
-				pluginDepends = getPluginDepends(dep);
-			}
-			catch (IllegalArgumentException e)
+			if (pluginDepends.optional)
 			{
-				Log.log(Log.ERROR, PluginJAR.class,
-					className + " has an invalid dependency: " + dep);
-				continue;
+				continue;	
 			}
 
 			if("plugin".equals(pluginDepends.what))
@@ -353,7 +381,7 @@ public class PluginJAR
 				{
 					Log.log(Log.ERROR, PluginJAR.class, className
 						+ " has an invalid dependency: "
-						+ dep + " (version is missing)");
+						+ pluginDepends.dep + " (version is missing)");
 					continue;
 				}
 
@@ -441,27 +469,12 @@ public class PluginJAR
 	{
 		if(plugin == null)
 			return true;
-		int i = 0;
 		boolean ok = true;
 
 		String name = plugin.getClassName();
-
-		String dep;
-		while((dep = jEdit.getProperty("plugin." + name + ".depend." + i++)) != null)
+		PluginDepends[] deps = getPluginDepends(name);
+		for (PluginDepends pluginDepends : deps)
 		{
-			PluginDepends pluginDepends;
-			try
-			{
-				pluginDepends = getPluginDepends(dep);
-			}
-			catch (IllegalArgumentException e)
-			{
-				Log.log(Log.ERROR,this,name + " has an invalid"
-					+ " dependency: " + dep);
-				ok = false;
-				continue;
-			}
-
 			if("jdk".equals(pluginDepends.what))
 			{
 				if(!pluginDepends.optional && StandardUtilities.compareStrings(
@@ -501,7 +514,7 @@ public class PluginJAR
 				{
 					Log.log(Log.ERROR,this,name
 						+ " has an invalid dependency: "
-						+ dep + " (version is missing)");
+						+ pluginDepends.dep + " (version is missing)");
 					ok = false;
 					continue;
 				}
@@ -578,7 +591,7 @@ public class PluginJAR
 			else
 			{
 				Log.log(Log.ERROR,this,name + " has unknown"
-					+ " dependency: " + dep);
+					+ " dependency: " + pluginDepends.dep);
 				ok = false;
 			}
 		}
@@ -610,7 +623,7 @@ public class PluginJAR
 				}
 			}
 		}
-
+		
 		if(!ok)
 			breakPlugin();
 
@@ -630,38 +643,105 @@ public class PluginJAR
 	} //}}}
 
 	//{{{ getPluginDepends() method
-	private static PluginDepends getPluginDepends(String dep) throws IllegalArgumentException
+	private static PluginDepends[] getPluginDepends(String classname) throws IllegalArgumentException
 	{
-		boolean optional;
-		if(dep.startsWith("optional "))
+		List<PluginDepends> ret = new ArrayList<PluginDepends>();
+		int i = 0;
+		String dep;
+		while((dep = jEdit.getProperty("plugin." + classname + ".depend." + i++)) != null)
 		{
-			optional = true;
-			dep = dep.substring("optional ".length());
+			boolean optional;
+			if(dep.startsWith("optional "))
+			{
+				optional = true;
+				dep = dep.substring("optional ".length());
+			}
+			else
+			{
+				optional = false;
+			}
+	
+			int index = dep.indexOf(' ');
+			if(index == -1)
+				throw new IllegalArgumentException("wrong dependency");
+	
+			String what = dep.substring(0,index);
+			String arg = dep.substring(index + 1);
+			PluginDepends depends = new PluginDepends();
+			depends.what = what;
+			depends.arg = arg;
+			depends.optional = optional;
+			depends.dep = dep;
+			if ("plugin".equals(what))
+				depends.name = arg.indexOf(' ') > 0 ? arg.substring(0, arg.indexOf(' ')) : arg;
+			ret.add(depends);
 		}
-		else
+		return ret.toArray(new PluginDepends[ret.size()]);
+	} //}}}
+
+	//{{{ getDependencies() method
+	/**
+	 * Returns a list of dependencies by searching the plugin properties.
+	 * @param classname The classname of a plugin
+	 * @return A list of classnames of plugins the plugin depends on.
+	 */
+	public static Set<String> getDependencies(String classname) throws IllegalArgumentException
+	{
+		Set<String> ret = new HashSet<String>();
+		int i = 0;
+		String dep;
+		while((dep = jEdit.getProperty("plugin." + classname + ".depend." + i++)) != null)
 		{
-			optional = false;
+			int index = dep.indexOf(' ');
+			String what = dep.substring(0,index);
+			String arg = dep.substring(index + 1);
+			if ("plugin".equals(what))
+			{
+				ret.add(arg.indexOf(' ') > 0 ? arg.substring(0, arg.indexOf(' ')) : arg);
+			}
 		}
+		return ret;
+	} //}}}
 
-		int index = dep.indexOf(' ');
-		if(index == -1)
-			throw new IllegalArgumentException("wrong dependency");
-
-		String what = dep.substring(0,index);
-		String arg = dep.substring(index + 1);
-		PluginDepends depends = new PluginDepends();
-		depends.what = what;
-		depends.arg = arg;
-		depends.optional = optional;
-		return depends;
+	//{{{ getOptionalDependencies() method
+	/**
+	 * Returns a list of optional dependencies by searching the plugin properties.
+	 * @param classname The classname of a plugin
+	 * @return A list of classnames of plugins the plugin optionally depends on.
+	 */
+	public static Set<String> getOptionalDependencies(String classname) throws IllegalArgumentException
+	{
+		Set<String> ret = new HashSet<String>();
+		int i = 0;
+		String dep;
+		while((dep = jEdit.getProperty("plugin." + classname + ".depend." + i++)) != null)
+		{
+			int index = dep.indexOf(' ');
+			String what = dep.substring(0,index);
+			String arg = dep.substring(index + 1);
+			if ("optional".equals(what))
+			{
+				index = arg.indexOf(' ');
+				what = arg.substring(0, index);
+				arg = arg.substring(index + 1);
+				if ("plugin".equals(what))
+				{
+					ret.add(arg.indexOf(' ') > 0 ? arg.substring(0, arg.indexOf(' ')) : arg);
+				}
+			}
+		}
+		return ret;
 	} //}}}
 
 	//{{{ PluginDepends class
 	private static class PluginDepends
 	{
-		String what;
-		String arg;
+		String dep;		// full string, e.g. plugin errorlist.ErrorList 1.3
+		String what;	// depends type, e.g. jedit, jdk, plugin
+		String arg;		// classname + version, e.g errorlist.ErrorList 1.3
+		String name;	// just the class name, e.g. errorlist.ErrorList, only filled in if what is plugin
 		boolean optional;
+		
 	} //}}}
 
 	//{{{ transitiveClosure()
@@ -676,33 +756,56 @@ public class PluginJAR
 	 */
 	public static void transitiveClosure(String[] dependents, List<String> listModel)
 	{
-  		for(int i = 0; i < dependents.length; i++)
-  		{
-  			String jarPath = dependents[i];
-  			if(!listModel.contains(jarPath))
-  			{
-  				listModel.add(jarPath);
-  				PluginJAR jar = jEdit.getPluginJAR(
-  					jarPath);
+		for (String jarPath : dependents)
+		{
+			if (!listModel.contains(jarPath))
+			{
+				listModel.add(jarPath);
+				PluginJAR jar = jEdit.getPluginJAR(jarPath);
 				if (jar == null)
 				{
 					Log.log(Log.WARNING, PluginJAR.class, "The jar file " + jarPath +
-						" doesn't exist, the plugin may have been partially removed");
+									      " doesn't exist, the plugin may have been partially removed");
 				}
 				else
 				{
-					transitiveClosure(jar.getDependentPlugins(),
-									  listModel);
+					transitiveClosure(jar.getDependentPlugins(), listModel);
 				}
-  			}
-  		}
+			}
+		}
   	} //}}}
 
 	//{{{ getDependentPlugins() method
-	  public String[] getDependentPlugins()
-	  {
-		  return theseRequireMe.toArray(new String[theseRequireMe.size()]);
-	  } //}}}
+	/**
+	* @return an array of plugin names that have a hard dependency on this plugin
+	*/
+	public String[] getDependentPlugins()
+	{
+		return theseRequireMe.toArray(new String[theseRequireMe.size()]);
+	} //}}}
+
+	//{{{ getOptionallyDependentPlugins() method
+	/**
+	* @return an array of plugin names that have an optional dependency on this plugin
+	*/
+	public String[] getOptionallyDependentPlugins()
+	{
+		return theseUseMe.toArray(new String[theseUseMe.size()]);
+	} //}}}
+	
+	//{{{ getAllDependentPlugins() method
+	/**
+	* @return an array of plugin names that have a dependency or an optional dependency on this plugin,
+	* this returns a combination of <code>getDependentPlugins</code> and getOptionallyDependentPlugins</code>.
+	*/
+	public String[] getAllDependentPlugins()
+	{
+		String[] dependents = new String[theseRequireMe.size() + theseUseMe.size()];
+		System.arraycopy( theseRequireMe.toArray(), 0, dependents, 0, theseRequireMe.size() );
+		System.arraycopy( theseUseMe.toArray(), 0, dependents, theseRequireMe.size(), theseUseMe.size());
+		return dependents;
+	} //}}}
+	
 
 	//{{{ getPlugin() method
 	/**
@@ -965,7 +1068,7 @@ public class PluginJAR
 	//{{{ Package-private members
 
 	//{{{ Static methods
-
+	
 	//{{{ getPluginCache() method
 	public static PluginCacheEntry getPluginCache(PluginJAR plugin)
 	{
@@ -1053,7 +1156,7 @@ public class PluginJAR
 	} //}}}
 
 	//{{{ init() method
-	boolean init()
+	public boolean init()
 	{
 		PluginCacheEntry cache = getPluginCache(this);
 		if(cache != null)
@@ -1093,7 +1196,7 @@ public class PluginJAR
 	} //}}}
 
 	//{{{ uninit() method
-	void uninit(boolean exit)
+	public void uninit(boolean exit)
 	{
 		deactivatePlugin(exit);
 
@@ -1742,10 +1845,10 @@ public class PluginJAR
 			else
 			{
 				dout.writeInt(cachedServices.length);
-				for(int i = 0; i < cachedServices.length; i++)
+				for (ServiceManager.Descriptor cachedService : cachedServices)
 				{
-					writeString(dout,cachedServices[i].clazz);
-					writeString(dout,cachedServices[i].name);
+					writeString(dout, cachedService.clazz);
+					writeString(dout, cachedService.name);
 				}
 			}
 
@@ -1878,10 +1981,8 @@ public class PluginJAR
 			else
 			{
 				dout.writeInt(str.length);
-				for(int i = 0; i < str.length; i++)
-				{
-					writeString(dout,str[i]);
-				}
+				for (String s : str)
+					writeString(dout, s);
 			}
 		} //}}}
 
@@ -1896,10 +1997,8 @@ public class PluginJAR
 			else
 			{
 				dout.writeInt(bools.length);
-				for(int i = 0; i < bools.length; i++)
-				{
-					dout.writeBoolean(bools[i]);
-				}
+				for (boolean bool : bools)
+					dout.writeBoolean(bool);
 			}
 		} //}}}
 
diff --git a/org/gjt/sp/jedit/Registers.java b/org/gjt/sp/jedit/Registers.java
index a480502..90c67ee 100644
--- a/org/gjt/sp/jedit/Registers.java
+++ b/org/gjt/sp/jedit/Registers.java
@@ -62,7 +62,7 @@ import org.gjt.sp.util.Log;
  *
  * @author Slava Pestov
  * @author John Gellene (API documentation)
- * @version $Id: Registers.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: Registers.java 23224 2013-09-30 20:51:42Z shlomy $
  */
 public class Registers
 {
@@ -790,12 +790,10 @@ public class Registers
 	{
 		DataFlavor[] dataFlavors = transferable.getTransferDataFlavors();
 
-		for (int i = 0;i<dataFlavors.length;i++)
+		for (DataFlavor dataFlavor : dataFlavors)
 		{
-			DataFlavor dataFlavor = dataFlavors[i];
-			Log.log(Log.DEBUG,Registers.class,
-				"debugListDataFlavors(): dataFlavor="+
-				dataFlavor+'.');
+			Log.log(Log.DEBUG, Registers.class, "debugListDataFlavors(): dataFlavor=" +
+				dataFlavor + '.');
 		}
 
 		if (dataFlavors.length == 0)
diff --git a/org/gjt/sp/jedit/ServiceManager.java b/org/gjt/sp/jedit/ServiceManager.java
index 16362d6..f722784 100644
--- a/org/gjt/sp/jedit/ServiceManager.java
+++ b/org/gjt/sp/jedit/ServiceManager.java
@@ -94,7 +94,7 @@ import org.gjt.sp.jedit.buffer.FoldHandler;
  *
  * @since jEdit 4.2pre1
  * @author Slava Pestov
- * @version $Id: ServiceManager.java 22920 2013-04-06 15:03:55Z kerik-sf $
+ * @version $Id: ServiceManager.java 23722 2014-11-09 16:26:59Z ezust $
  */
 public class ServiceManager
 {
@@ -109,9 +109,14 @@ public class ServiceManager
 		ServiceListHandler dh = new ServiceListHandler(plugin,uri);
 		try
 		{
-			InputStream in = uri.openStream();
-			if(in == null)
+			InputStream in;
+			try
 			{
+				in = uri.openStream();
+			}
+			catch(FileNotFoundException e)
+			{
+				in = null;
 				// this happened when calling generateCache() in the context of 'find orphan jars'
 				// in org.gjt.sp.jedit.pluginmgr.ManagePanel.FindOrphan.actionPerformed(ActionEvent)
 				// because for not loaded plugins, the plugin will not be added to the list of pluginJars
@@ -120,7 +125,7 @@ public class ServiceManager
 				// Better log a small error message than a big stack trace
 				Log.log(Log.WARNING, ServiceManager.class, "Unable to open: " + uri);
 			}
-			else  if (!XMLUtilities.parseXML(uri.openStream(), dh)
+			if (in!=null && !XMLUtilities.parseXML(uri.openStream(), dh)
 				&& cache != null)
 			{
 				cache.cachedServices = dh.getCachedServices();
diff --git a/org/gjt/sp/jedit/View.java b/org/gjt/sp/jedit/View.java
index dfad3bd..9dceda1 100644
--- a/org/gjt/sp/jedit/View.java
+++ b/org/gjt/sp/jedit/View.java
@@ -38,11 +38,14 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.Comparator;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 import java.util.Stack;
 
+import java.util.TreeSet;
+
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 import javax.swing.JComponent;
@@ -131,7 +134,7 @@ import org.gjt.sp.util.StandardUtilities;
  *
  * @author Slava Pestov
  * @author John Gellene (API documentation)
- * @version $Id: View.java 22815 2013-02-27 19:23:28Z ezust $
+ * @version $Id: View.java 23412 2014-02-11 05:06:18Z ezust $
  */
 public class View extends JFrame implements InputHandlerProvider
 {
@@ -963,16 +966,24 @@ public class View extends JFrame implements InputHandlerProvider
 
 	//{{{ getBuffers() method
 	/**
-	 * Returns all Buffers opened in this View.
+	 * Returns all Buffers opened in this View,
+	 * sorted according to View options. (as of jEdit 5.2)
 	 * @since jEdit 5.1
 	 */
 	public Buffer[] getBuffers()
 	{
 		BufferSetManager mgr = jEdit.getBufferSetManager();
-		Collection<Buffer> retval = new HashSet<Buffer>();
+		Collection<Buffer> retval = null;
 		for (EditPane ep: getEditPanes())
 		{
 			BufferSet bs = ep.getBufferSet();
+			if (retval == null) {
+				Comparator<Buffer> sorter = bs.getSorter();
+				if (sorter == null)
+					retval = new HashSet<Buffer>();
+				else
+					retval = new TreeSet<Buffer>(sorter);
+			}
 			Collections.addAll(retval, bs.getAllBuffers());
 			// If scope is not editpane, then all buffersets
 			// are the same and we got what we need.
@@ -1211,10 +1222,10 @@ public class View extends JFrame implements InputHandlerProvider
 	{
 		List<Buffer> buffers = new ArrayList<Buffer>();
 		EditPane[] editPanes = getEditPanes();
-		for(int i = 0; i < editPanes.length; i++)
+		for (EditPane ep : editPanes)
 		{
-			Buffer buffer = editPanes[i].getBuffer();
-			if(!buffers.contains(buffer))
+			Buffer buffer = ep.getBuffer();
+			if (!buffers.contains(buffer))
 				buffers.add(buffer);
 		}
 
@@ -1289,9 +1300,8 @@ public class View extends JFrame implements InputHandlerProvider
 	public void visit(JEditVisitor visitor)
 	{
 		EditPane[] panes = getEditPanes();
-		for (int i = 0; i < panes.length; i++)
+		for (EditPane editPane : panes)
 		{
-			EditPane editPane = panes[i];
 			visitor.visit(editPane);
 			visitor.visit(editPane.getTextArea());
 		}
@@ -1399,11 +1409,11 @@ public class View extends JFrame implements InputHandlerProvider
 	} //}}}
 
 	//{{{ isFullScreenMode method
-	public boolean isFullScreenMode() 
+	public boolean isFullScreenMode()
 	{
 		return fullScreenMode;
 	}//}}}
-	
+
 	//{{{ toggleFullScreen() method
 	public void toggleFullScreen()
 	{
@@ -1486,8 +1496,8 @@ public class View extends JFrame implements InputHandlerProvider
 		dispose();
 
 		EditPane[] editPanes = getEditPanes();
-		for(int i = 0; i < editPanes.length; i++)
-			editPanes[i].close();
+		for (EditPane ep : editPanes)
+			ep.close();
 
 		// null some variables so that retaining references
 		// to closed views won't hurt as much.
@@ -1606,10 +1616,9 @@ public class View extends JFrame implements InputHandlerProvider
 		}
 
 		EditPane[] editPanes = getEditPanes();
-		for(int i = 0; i < editPanes.length; i++)
+		for (EditPane ep : editPanes)
 		{
-			EditPane ep = editPanes[i];
-			if(ep.getBuffer() == buffer
+			if (ep.getBuffer() == buffer
 				/* ignore zero-height splits, etc */
 				&& ep.getTextArea().getVisibleLines() > 1)
 			{
@@ -1849,13 +1858,16 @@ loop:		while (true)
 		for (int i = 0; i < mbar.getMenuCount(); i++)
 		{
 			JMenu menu = mbar.getMenu(i);
-			int mnemonic = menu.getMnemonic();
-			if (mnemonic != 0)
+			if (menu != null)
 			{
-				Object keyBinding = inputHandler.getKeyBinding("A+" + Character.toLowerCase((char) mnemonic));
-				if (keyBinding != null)
+				int mnemonic = menu.getMnemonic();
+				if (mnemonic != 0)
 				{
-					menu.setMnemonic(0);
+					Object keyBinding = inputHandler.getKeyBinding("A+" + Character.toLowerCase((char) mnemonic));
+					if (keyBinding != null)
+					{
+						menu.setMnemonic(0);
+					}
 				}
 			}
 		}
@@ -2025,9 +2037,9 @@ loop:		while (true)
 			|| msg.getWhat() == BufferUpdate.LOADED)
 		{
 			EditPane[] editPanes = getEditPanes();
-			for(int i = 0; i < editPanes.length; i++)
+			for (EditPane ep : editPanes)
 			{
-				if(editPanes[i].getBuffer() == buffer)
+				if (ep.getBuffer() == buffer)
 				{
 					updateTitle();
 					break;
@@ -2112,8 +2124,8 @@ loop:		while (true)
 	private void updateGutterBorders()
 	{
 		EditPane[] editPanes = getEditPanes();
-		for(int i = 0; i < editPanes.length; i++)
-			editPanes[i].getTextArea().getGutter().updateBorder();
+		for (EditPane editPane : editPanes)
+			editPane.getTextArea().getGutter().updateBorder();
 	} //}}}
 
 	//{{{ getOpenBuffers() method
diff --git a/org/gjt/sp/jedit/browser/BrowserCommandsMenu.java b/org/gjt/sp/jedit/browser/BrowserCommandsMenu.java
index de3ba9a..3413427 100644
--- a/org/gjt/sp/jedit/browser/BrowserCommandsMenu.java
+++ b/org/gjt/sp/jedit/browser/BrowserCommandsMenu.java
@@ -36,7 +36,7 @@ import org.gjt.sp.jedit.menu.MenuItemTextComparator;
 //}}}
 
 /**
- * @version $Id: BrowserCommandsMenu.java 22900 2013-03-28 21:22:13Z ezust $
+ * @version $Id: BrowserCommandsMenu.java 23222 2013-09-29 20:43:34Z shlomy $
  * @author Slava Pestov and Jason Ginchereau
  */
 public class BrowserCommandsMenu extends JPopupMenu
@@ -244,14 +244,13 @@ public class BrowserCommandsMenu extends JPopupMenu
 
 		List<JMenuItem> encodingMenuItemList = new ArrayList<JMenuItem>();
 		String[] encodings = MiscUtilities.getEncodings(true);
-		for(int i = 0; i < encodings.length; i++)
+		for (String encoding : encodings)
 		{
-			String encoding = encodings[i];
 			JRadioButtonMenuItem mi = new JRadioButtonMenuItem(encoding);
 			mi.setActionCommand("encoding@" + encoding);
 			mi.addActionListener(actionHandler);
 			grp.add(mi);
-			encodingMenuItems.put(encoding,mi);
+			encodingMenuItems.put(encoding, mi);
 			encodingMenuItemList.add(mi);
 		}
 
@@ -270,16 +269,13 @@ public class BrowserCommandsMenu extends JPopupMenu
 		Collections.sort(encodingMenuItemList,
 			new MenuItemTextComparator());
 
-		Iterator iter = encodingMenuItemList.iterator();
-		while(iter.hasNext())
+		for (JMenuItem item : encodingMenuItemList)
 		{
-			JRadioButtonMenuItem mi = (JRadioButtonMenuItem)
-				iter.next();
+			JRadioButtonMenuItem mi = (JRadioButtonMenuItem) item;
 
-			if(menu.getMenuComponentCount() > 20)
+			if (menu.getMenuComponentCount() > 20)
 			{
-				JMenu newMenu = new JMenu(
-					jEdit.getProperty("common.more"));
+				JMenu newMenu = new JMenu(jEdit.getProperty("common.more"));
 				menu.add(newMenu);
 				menu = newMenu;
 			}
diff --git a/org/gjt/sp/jedit/browser/VFSBrowser.java b/org/gjt/sp/jedit/browser/VFSBrowser.java
index 6cefbcb..5197548 100644
--- a/org/gjt/sp/jedit/browser/VFSBrowser.java
+++ b/org/gjt/sp/jedit/browser/VFSBrowser.java
@@ -56,7 +56,7 @@ import org.gjt.sp.jedit.menu.MenuItemTextComparator;
  * VFSFileChooserDialog.
  *
  * @author Slava Pestov
- * @version $Id: VFSBrowser.java 22996 2013-05-17 09:43:00Z kpouer $
+ * @version $Id: VFSBrowser.java 23224 2013-09-30 20:51:42Z shlomy $
  */
 public class VFSBrowser extends JPanel implements DefaultFocusComponent,
 	DockableWindow
@@ -688,9 +688,9 @@ public class VFSBrowser extends JPanel implements DefaultFocusComponent,
 		}
 
 		String typeStr = "files";
-		for(int i = 0; i < files.length; i++)
+		for (VFSFile file : files)
 		{
-			if (files[i].getType() == VFSFile.DIRECTORY)
+			if (file.getType() == VFSFile.DIRECTORY)
 			{
 				typeStr = "directories and their contents";
 				break;
@@ -1155,18 +1155,18 @@ public class VFSBrowser extends JPanel implements DefaultFocusComponent,
 
 		//{{{ new API
 		EditPlugin[] plugins = jEdit.getPlugins();
-		for (int i = 0; i < plugins.length; i++)
+		for (EditPlugin plugin : plugins)
 		{
-			JMenuItem menuItem = plugins[i].createBrowserMenuItems();
-			if(menuItem != null)
+			JMenuItem menuItem = plugin.createBrowserMenuItems();
+			if (menuItem != null)
 				vec.add(menuItem);
 		} //}}}
 
 		if (!vec.isEmpty())
 		{
 			Collections.sort(vec,new MenuItemTextComparator());
-			for(int i = 0; i < vec.size(); i++)
-				pluginMenu.add(vec.get(i));
+			for (JMenuItem item : vec)
+				pluginMenu.add(item);
 		}
 		else
 		{
@@ -1210,59 +1210,54 @@ public class VFSBrowser extends JPanel implements DefaultFocusComponent,
 
 		Buffer buffer = null;
 
-check_selected: for(int i = 0; i < selectedFiles.length; i++)
+check_selected:
+		for (VFSFile file : selectedFiles)
 		{
-			VFSFile file = selectedFiles[i];
-
-			if(file.getType() == VFSFile.DIRECTORY
-				|| file.getType() == VFSFile.FILESYSTEM)
+			if (file.getType() == VFSFile.DIRECTORY ||
+			    file.getType() == VFSFile.FILESYSTEM)
 			{
-				if(mode == M_OPEN_NEW_VIEW && this.mode == BROWSER)
-					browseDirectoryInNewWindow(view,file.getPath());
-				else
-					if (selectedFiles.length == 1)
-						setDirectory(file.getPath());
+				if (mode == M_OPEN_NEW_VIEW && this.mode == BROWSER)
+					browseDirectoryInNewWindow(view, file.getPath());
+				else if (selectedFiles.length == 1)
+					setDirectory(file.getPath());
 			}
-			else if(this.mode == BROWSER || this.mode == BROWSER_DIALOG)
+			else if (this.mode == BROWSER || this.mode == BROWSER_DIALOG)
 			{
-				if(mode == M_INSERT)
+				if (mode == M_INSERT)
 				{
-					view.getBuffer().insertFile(view,
-						file.getPath());
+					view.getBuffer().insertFile(view, file.getPath());
 					continue check_selected;
 				}
 
 				Buffer _buffer = jEdit.getBuffer(file.getPath());
-				if(_buffer == null)
+				if (_buffer == null)
 				{
 					Hashtable<String, Object> props = new Hashtable<String, Object>();
-					if(currentEncoding != null)
+					if (currentEncoding != null)
 					{
-						props.put(JEditBuffer.ENCODING,currentEncoding);
+						props.put(JEditBuffer.ENCODING, currentEncoding);
 					}
-					props.put(Buffer.ENCODING_AUTODETECT,
-						autoDetectEncoding);
-					_buffer = jEdit.openFile(view, null,
-						file.getPath(),false,props);
+					props.put(Buffer.ENCODING_AUTODETECT, autoDetectEncoding);
+					_buffer = jEdit.openFile(view, null, file.getPath(), false, props);
 				}
-				else if(doubleClickClose && canDoubleClickClose
-					&& this.mode != BROWSER_DIALOG
-					&& selectedFiles.length == 1)
+				else if (doubleClickClose && canDoubleClickClose &&
+					 this.mode != BROWSER_DIALOG &&
+					 selectedFiles.length == 1)
 				{
 					// close if this buffer is currently
 					// visible in the view.
 					EditPane[] editPanes = view.getEditPanes();
-					for(int j = 0; j < editPanes.length; j++)
+					for (EditPane editPane : editPanes)
 					{
-						if(editPanes[j].getBuffer() == _buffer)
+						if (editPane.getBuffer() == _buffer)
 						{
-							jEdit.closeBuffer(view,_buffer);
+							jEdit.closeBuffer(view, _buffer);
 							return;
 						}
 					}
 				}
 
-				if(_buffer != null)
+				if (_buffer != null)
 					buffer = _buffer;
 			}
 			else
@@ -1393,23 +1388,23 @@ check_selected: for(int i = 0; i < selectedFiles.length; i++)
 		{
 			VFSFileFilter filter = getVFSFileFilter();
 
-			for(int i = 0; i < list.length; i++)
+			for (VFSFile file : list)
 			{
-				VFSFile file = list[i];
-				if(file.isHidden() && !showHiddenFiles)
+				if (file.isHidden() && !showHiddenFiles)
 				{
 					invisible++;
 					continue;
 				}
 
-				if (filter != null && (filterEnabled || filter instanceof DirectoriesOnlyFilter)
+				if (filter != null &&
+				    (filterEnabled || filter instanceof DirectoriesOnlyFilter)
 				    && !filter.accept(file))
 				{
 					invisible++;
 					continue;
 				}
 
-				if(file.getType() == VFSFile.FILE)
+				if (file.getType() == VFSFile.FILE)
 					files++;
 				else
 					directories++;
@@ -1447,11 +1442,10 @@ check_selected: for(int i = 0; i < selectedFiles.length; i++)
 
 		if(mode == BROWSER)
 		{
-			for(int i = 0; i < selectedFiles.length; i++)
+			for (VFSFile file : selectedFiles)
 			{
-				VFSFile file = selectedFiles[i];
 				Buffer buffer = jEdit.getBuffer(file.getPath());
-				if(buffer != null && view != null)
+				if (buffer != null && view != null)
 					view.setBuffer(buffer);
 			}
 		}
@@ -1999,10 +1993,10 @@ check_selected: for(int i = 0; i < selectedFiles.length; i++)
 					}
 					else
 					{
-						for(int i = 0; i < selected.length; i++)
+						for (VFSFile file : selected)
 						{
-							VFSFile file = selected[i];
-							FavoritesVFS.addToFavorites(file.getPath(),
+							FavoritesVFS.addToFavorites(
+								file.getPath(),
 								file.getType());
 						}
 					}
diff --git a/org/gjt/sp/jedit/browser/VFSDirectoryEntryTable.java b/org/gjt/sp/jedit/browser/VFSDirectoryEntryTable.java
index ac488b3..3a01440 100644
--- a/org/gjt/sp/jedit/browser/VFSDirectoryEntryTable.java
+++ b/org/gjt/sp/jedit/browser/VFSDirectoryEntryTable.java
@@ -49,7 +49,7 @@ import org.gjt.sp.util.ThreadUtilities;
 
 /**
  * @author Slava Pestov
- * @version $Id: VFSDirectoryEntryTable.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: VFSDirectoryEntryTable.java 23222 2013-09-29 20:43:34Z shlomy $
  * @since jEdit 4.2pre1
  */
 public class VFSDirectoryEntryTable extends JTable
@@ -126,10 +126,8 @@ public class VFSDirectoryEntryTable extends JTable
 
 		java.util.List<VFSFile> returnValue = new LinkedList<VFSFile>();
 		int[] selectedRows = getSelectedRows();
-		for(int i = 0; i < selectedRows.length; i++)
-		{
-			returnValue.add(model.files[selectedRows[i]].dirEntry);
-		}
+		for (int selectedRow : selectedRows)
+			returnValue.add(model.files[selectedRow].dirEntry);
 		return returnValue.toArray(new VFSFile[returnValue.size()]);
 	} //}}}
 
diff --git a/org/gjt/sp/jedit/browser/VFSDirectoryEntryTableModel.java b/org/gjt/sp/jedit/browser/VFSDirectoryEntryTableModel.java
index c8ebeeb..0e60a58 100644
--- a/org/gjt/sp/jedit/browser/VFSDirectoryEntryTableModel.java
+++ b/org/gjt/sp/jedit/browser/VFSDirectoryEntryTableModel.java
@@ -36,7 +36,7 @@ import org.gjt.sp.util.StandardUtilities;
 
 /**
  * @author Slava Pestov
- * @version $Id: VFSDirectoryEntryTableModel.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: VFSDirectoryEntryTableModel.java 23336 2013-11-16 12:05:40Z ezust $
  * @since jEdit 4.2pre1
  */
 public class VFSDirectoryEntryTableModel extends AbstractTableModel
@@ -446,9 +446,9 @@ vfs_attr_loop:	for(int i = 0; i < attrs.length; i++)
 			// if the modified attribute is present, then we have a LocalFile
 			if(sortAttribute == VFS.EA_MODIFIED)
 				result = (
-					(Long)((FileVFS.LocalFile)file1).getModified())
+					(Long)file1.getModified())
 					.compareTo(
-					(Long)((FileVFS.LocalFile)file2).getModified());
+					(Long)file2.getModified());
 			// sort by size
 			else if(sortAttribute == VFS.EA_SIZE)
 				result = (
diff --git a/org/gjt/sp/jedit/browser/VFSFileChooserDialog.java b/org/gjt/sp/jedit/browser/VFSFileChooserDialog.java
index b5bcbe4..d429f3d 100644
--- a/org/gjt/sp/jedit/browser/VFSFileChooserDialog.java
+++ b/org/gjt/sp/jedit/browser/VFSFileChooserDialog.java
@@ -46,7 +46,7 @@ import org.gjt.sp.util.*;
  * Wraps the VFS browser in a modal dialog.
  * Shows up when "File-Open" is used. 
  * @author Slava Pestov
- * @version $Id: VFSFileChooserDialog.java 22943 2013-04-22 11:44:40Z thomasmey $
+ * @version $Id: VFSFileChooserDialog.java 23222 2013-09-29 20:43:34Z shlomy $
  */
 public class VFSFileChooserDialog extends EnhancedDialog
 {
@@ -409,10 +409,9 @@ public class VFSFileChooserDialog extends EnhancedDialog
 	{
 		List<String> l = new ArrayList<String>();
 		VFSFile[] selectedFiles = browser.getSelectedFiles();
-		for(int i = 0; i < selectedFiles.length; i++)
+		for (VFSFile file : selectedFiles)
 		{
-			VFSFile file = selectedFiles[i];
-			if(file.getType() == type1 || file.getType() == type2)
+			if (file.getType() == type1 || file.getType() == type2)
 				l.add(file.getPath());
 		}
 		return l.toArray(new String[l.size()]);
diff --git a/org/gjt/sp/jedit/buffer/JEditBuffer.java b/org/gjt/sp/jedit/buffer/JEditBuffer.java
index f1a093b..e9141dc 100644
--- a/org/gjt/sp/jedit/buffer/JEditBuffer.java
+++ b/org/gjt/sp/jedit/buffer/JEditBuffer.java
@@ -68,7 +68,7 @@ import java.util.regex.Pattern;
  * </ul>
  *
  * @author Slava Pestov
- * @version $Id: JEditBuffer.java 22963 2013-04-30 14:07:57Z kpouer $
+ * @version $Id: JEditBuffer.java 23224 2013-09-30 20:51:42Z shlomy $
  *
  * @since jEdit 4.3pre3
  */
@@ -817,13 +817,14 @@ public class JEditBuffer
 		{
 			beginCompoundEdit();
 
-			for(int i = 0; i < lines.length; i++)
+			for (int line : lines)
 			{
 				Segment seg = new Segment();
-				getLineText(lines[i],seg);
+				getLineText(line, seg);
 
 				// blank line
-				if (seg.count == 0) continue;
+				if (seg.count == 0)
+					continue;
 
 				int lineStart = seg.offset;
 				int lineEnd = seg.offset + seg.count - 1;
@@ -838,9 +839,10 @@ public class JEditBuffer
 				int tail = lineEnd - pos;
 
 				// no whitespace
-				if (tail == 0) continue;
+				if (tail == 0)
+					continue;
 
-				remove(getLineEndOffset(lines[i]) - 1 - tail,tail);
+				remove(getLineEndOffset(line) - 1 - tail, tail);
 			}
 		}
 		finally
@@ -865,22 +867,19 @@ public class JEditBuffer
 		{
 			beginCompoundEdit();
 
-			for(int i = 0; i < lines.length; i++)
+			for (int l : lines)
 			{
-				int lineStart = getLineStartOffset(lines[i]);
-				CharSequence line = getLineSegment(lines[i]);
-				int whiteSpace = StandardUtilities
-					.getLeadingWhiteSpace(line);
-				if(whiteSpace == 0)
-					continue;
-				int whiteSpaceWidth = Math.max(0,StandardUtilities
-					.getLeadingWhiteSpaceWidth(line,tabSize)
-					- indentSize);
-
-				insert(lineStart + whiteSpace,StandardUtilities
-					.createWhiteSpace(whiteSpaceWidth,
-					noTabs ? 0 : tabSize));
-				remove(lineStart,whiteSpace);
+				int lineStart = getLineStartOffset(l);
+				CharSequence line = getLineSegment(l);
+				int whiteSpace = StandardUtilities.getLeadingWhiteSpace(line);
+				if (whiteSpace == 0) continue;
+				int whiteSpaceWidth = Math.max(0, StandardUtilities
+									  .getLeadingWhiteSpaceWidth(line, tabSize)
+								  - indentSize);
+
+				insert(lineStart + whiteSpace,
+				       StandardUtilities.createWhiteSpace(whiteSpaceWidth, noTabs ? 0 : tabSize));
+				remove(lineStart, whiteSpace);
 			}
 
 		}
@@ -905,24 +904,21 @@ public class JEditBuffer
 			int tabSize = getTabSize();
 			int indentSize = getIndentSize();
 			boolean noTabs = getBooleanProperty("noTabs");
-			for(int i = 0; i < lines.length; i++)
+			for (int l : lines)
 			{
-				int lineStart = getLineStartOffset(lines[i]);
-				CharSequence line = getLineSegment(lines[i]);
-				int whiteSpace = StandardUtilities
-					.getLeadingWhiteSpace(line);
+				int lineStart = getLineStartOffset(l);
+				CharSequence line = getLineSegment(l);
+				int whiteSpace = StandardUtilities.getLeadingWhiteSpace(line);
 
 				// silly usability hack
 				//if(lines.length != 1 && whiteSpace == 0)
 				//	continue;
 
-				int whiteSpaceWidth = StandardUtilities
-					.getLeadingWhiteSpaceWidth(
-					line,tabSize) + indentSize;
-				insert(lineStart + whiteSpace,StandardUtilities
-					.createWhiteSpace(whiteSpaceWidth,
-					noTabs ? 0 : tabSize));
-				remove(lineStart,whiteSpace);
+				int whiteSpaceWidth =
+					StandardUtilities.getLeadingWhiteSpaceWidth(line, tabSize) + indentSize;
+				insert(lineStart + whiteSpace,
+				       StandardUtilities.createWhiteSpace(whiteSpaceWidth, noTabs ? 0 : tabSize));
+				remove(lineStart, whiteSpace);
 			}
 		}
 		finally
@@ -962,8 +958,8 @@ public class JEditBuffer
 		try
 		{
 			beginCompoundEdit();
-			for(int i = 0; i < lines.length; i++)
-				indentLine(lines[i],true);
+			for (int line : lines)
+				indentLine(line, true);
 		}
 		finally
 		{
@@ -1142,13 +1138,8 @@ loop:		for(int i = 0; i < seg.count; i++)
 
 		List<IndentRule> indentRules = getIndentRules(lineIndex);
 		List<IndentAction> actions = new LinkedList<IndentAction>();
-		for (int i = 0;i<indentRules.size();i++)
-		{
-			IndentRule rule = indentRules.get(i);
-			rule.apply(this,lineIndex,prevLineIndex,
-				prevPrevLineIndex,actions);
-		}
-
+		for (IndentRule rule : indentRules)
+			rule.apply(this, lineIndex, prevLineIndex, prevPrevLineIndex, actions);
 
 		for (IndentAction action : actions)
 		{
diff --git a/org/gjt/sp/jedit/buffer/LineManager.java b/org/gjt/sp/jedit/buffer/LineManager.java
index 7df832f..65d9f7c 100644
--- a/org/gjt/sp/jedit/buffer/LineManager.java
+++ b/org/gjt/sp/jedit/buffer/LineManager.java
@@ -37,7 +37,7 @@ import org.gjt.sp.util.Log;
  * called through, implements such protection.
  *
  * @author Slava Pestov
- * @version $Id: LineManager.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: LineManager.java 23220 2013-09-29 19:19:24Z shlomy $
  * @since jEdit 4.2pre3
  */
 public class LineManager
@@ -330,13 +330,13 @@ public class LineManager
 	//}}}
 
 	//{{{ setLineEndOffset() method
-	private final void setLineEndOffset(int line, int end)
+	private void setLineEndOffset(int line, int end)
 	{
 		endOffsets[line] = end;
 	} //}}}
 
 	//{{{ moveGap() method
-	private final void moveGap(int newGapLine, int newGapWidth, String method)
+	private void moveGap(int newGapLine, int newGapWidth, String method)
 	{
 		if(gapLine == -1)
 			gapWidth = newGapWidth;
diff --git a/org/gjt/sp/jedit/bufferio/BufferLoadRequest.java b/org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
index b5dde4d..470c433 100644
--- a/org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
+++ b/org/gjt/sp/jedit/bufferio/BufferLoadRequest.java
@@ -25,6 +25,7 @@ package org.gjt.sp.jedit.bufferio;
 //{{{ Imports
 import java.io.*;
 import java.nio.charset.*;
+import java.util.Collections;
 import java.util.List;
 import java.util.ArrayList;
 import java.util.Set;
@@ -39,7 +40,7 @@ import org.gjt.sp.util.*;
 /**
  * A buffer load request.
  * @author Slava Pestov
- * @version $Id: BufferLoadRequest.java 22357 2012-10-13 04:58:01Z ezust $
+ * @version $Id: BufferLoadRequest.java 23224 2013-09-30 20:51:42Z shlomy $
  */
 public class BufferLoadRequest extends BufferIORequest
 {
@@ -245,12 +246,7 @@ public class BufferLoadRequest extends BufferIORequest
 
 				String fallbackEncodings = jEdit.getProperty("fallbackEncodings");
 				if(fallbackEncodings != null && fallbackEncodings.length() > 0)
-				{
-					for(String encoding: fallbackEncodings.split("\\s+"))
-					{
-						encodingProviders.add(encoding);
-					}
-				}
+					Collections.addAll(encodingProviders, fallbackEncodings.split("\\s+"));
 			}
 			else
 			{
diff --git a/org/gjt/sp/jedit/bufferset/BufferSet.java b/org/gjt/sp/jedit/bufferset/BufferSet.java
index e151a9d..f0c752e 100644
--- a/org/gjt/sp/jedit/bufferset/BufferSet.java
+++ b/org/gjt/sp/jedit/bufferset/BufferSet.java
@@ -32,6 +32,7 @@ import java.util.List;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
+import javax.annotation.Nullable;
 //}}}
 
 /** An ordered list of buffers, normally attached to an EditPane
@@ -154,6 +155,16 @@ public class BufferSet
 		return buffers.get(index);
 	} //}}}
 
+	//{{{ getSorter()
+	/** @return the Comparator used for this bufferset
+	    can be null if there is no sorting 
+		@since jEdit 5.2
+	*/
+	@Nullable
+	public Comparator<Buffer> getSorter() {
+		return sorter;
+	}//}}}
+	
 	//{{{ getPreviousBuffer() method
 	public Buffer getPreviousBuffer(int index)
 	{
@@ -349,7 +360,7 @@ public class BufferSet
 	//}}}
 
 	//{{{ NameSorter class
-	private static class NameSorter implements Comparator<Buffer>
+	public static class NameSorter implements Comparator<Buffer>
 	{
 		public int compare(Buffer o1, Buffer o2)
 		{
@@ -364,7 +375,7 @@ public class BufferSet
 	} //}}}
 
 	//{{{ PathSorter class
-	private static class PathSorter implements Comparator<Buffer>
+	public static class PathSorter implements Comparator<Buffer>
 	{
 		public int compare(Buffer o1, Buffer o2)
 		{
diff --git a/org/gjt/sp/jedit/gui/ActionBar.java b/org/gjt/sp/jedit/gui/ActionBar.java
index 3cabfe8..eb256cd 100644
--- a/org/gjt/sp/jedit/gui/ActionBar.java
+++ b/org/gjt/sp/jedit/gui/ActionBar.java
@@ -215,10 +215,10 @@ public class ActionBar extends JToolBar
 		str = str.toLowerCase();
 		String[] actions = jEdit.getActionNames();
 		ArrayList<String> returnValue = new ArrayList<String>(actions.length);
-		for(int i = 0; i < actions.length; i++)
+		for (String act : actions)
 		{
-			if(actions[i].toLowerCase().contains(str))
-				returnValue.add(actions[i]);
+			if (act.toLowerCase().contains(str))
+				returnValue.add(act);
 		}
 
 		return returnValue.toArray(new String[returnValue.size()]);
diff --git a/org/gjt/sp/jedit/gui/BufferSwitcher.java b/org/gjt/sp/jedit/gui/BufferSwitcher.java
index 4d0a793..020af61 100644
--- a/org/gjt/sp/jedit/gui/BufferSwitcher.java
+++ b/org/gjt/sp/jedit/gui/BufferSwitcher.java
@@ -21,15 +21,26 @@ package org.gjt.sp.jedit.gui;
 
 //{{{ Imports
 import javax.swing.event.*;
+import javax.swing.plaf.ComboBoxUI;
+import javax.swing.plaf.basic.BasicComboBoxUI;
+import java.lang.reflect.Field;
+
 import javax.swing.*;
+
 import java.awt.*;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.io.IOException;
+
 import org.gjt.sp.jedit.*;
 import org.gjt.sp.jedit.bufferset.BufferSet;
+import org.gjt.sp.jedit.bufferset.BufferSetManager;
 import org.gjt.sp.util.ThreadUtilities;
 //}}}
 
 /** BufferSwitcher class
-   @version $Id: BufferSwitcher.java 22075 2012-08-26 23:13:58Z ezust $
+   @version $Id: BufferSwitcher.java 23712 2014-11-01 23:45:33Z ezust $
 */
 public class BufferSwitcher extends JComboBox
 {
@@ -38,12 +49,14 @@ public class BufferSwitcher extends JComboBox
 	private boolean updating;
 	// item that was selected before popup menu was opened
 	private Object itemSelectedBefore;
+	public static final DataFlavor BufferDataFlavor = new DataFlavor(BufferTransferableData.class, DataFlavor.javaJVMLocalObjectMimeType);
 
 	public BufferSwitcher(final EditPane editPane)
 	{
 		this.editPane = editPane;
 
 		//setFont(new Font("Dialog",Font.BOLD,10));
+		setTransferHandler(new ComboBoxTransferHandler(this));
 		setRenderer(new BufferCellRenderer());
 		setMaximumRowCount(jEdit.getIntegerProperty("bufferSwitcher.maxRowCount", 10));
 		addPopupMenuListener(new PopupMenuListener()
@@ -94,6 +107,7 @@ public class BufferSwitcher extends JComboBox
 				setModel(new DefaultComboBoxModel(bufferSet.getAllBuffers()));
 				setSelectedItem(editPane.getBuffer());
 				setToolTipText(editPane.getBuffer().getPath(true));
+				addDnD();
 				updating = false;
 			}
 		};
@@ -121,6 +135,281 @@ public class BufferSwitcher extends JComboBox
 			return this;
 		}
 	}
+	
+	private void addDnD() 
+	{
+		ComboBoxUI ui = getUI();
+		if (ui instanceof BasicComboBoxUI)
+		{
+			try
+			{
+				Field listBoxField = getField(ui.getClass(), "listBox");
+				listBoxField.setAccessible(true);
+				JList list = (JList)listBoxField.get(ui);
+				list.setDragEnabled(true);
+				list.setDropMode(DropMode.INSERT);
+				list.setTransferHandler(new BufferSwitcherTransferHandler());
+			}
+			catch (Exception ignored) // NOPMD
+			{
+				// don't do anything if the above fails, it just means dnd won't work.
+			}
+		}
+	}
+	
+	/**
+	 * Return the named field from the given class.
+	 */
+	private Field getField( Class aClass, String fieldName ) throws NoSuchFieldException {
+		if ( aClass == null )
+			throw new NoSuchFieldException( "Invalid field : " + fieldName );
+		try 
+		{
+			return aClass.getDeclaredField( fieldName );
+		}
+		catch ( NoSuchFieldException e ) 
+		{
+			return getField( aClass.getSuperclass(), fieldName );
+		}
+	}
+	
+	private class ComboBoxTransferHandler extends TransferHandler
+	{
+		JComboBox comboBox;
+
+		public ComboBoxTransferHandler(JComboBox comboBox)
+		{
+			this.comboBox = comboBox;
+		}
+
+		public boolean canImport(TransferHandler.TransferSupport info)
+		{
+			// we only import Strings
+			if (!info.isDataFlavorSupported(BufferSwitcher.BufferDataFlavor))
+			{
+				return false;
+			}
+			if (!comboBox.isPopupVisible())
+			{
+				comboBox.showPopup();
+			}
+			return false;
+		}
+	}
+	
+	private class BufferSwitcherTransferable implements Transferable
+	{
+		private final DataFlavor[] supportedDataFlavor = { BufferSwitcher.BufferDataFlavor };
+		private final Buffer buffer;
+		private final JComponent source;
+		
+		public BufferSwitcherTransferable(Buffer buffer, JComponent source)
+		{
+			this.buffer = buffer;
+			this.source = source;
+		}
+
+		@Override
+		public DataFlavor[] getTransferDataFlavors()
+		{
+			return supportedDataFlavor;
+		}
+
+		@Override
+		public boolean isDataFlavorSupported(DataFlavor flavor)
+		{
+			return BufferSwitcher.BufferDataFlavor.equals(flavor);
+		}
+
+		@Override
+		public Object getTransferData(DataFlavor flavor)
+				throws UnsupportedFlavorException, IOException
+		{
+			if (!isDataFlavorSupported(flavor))
+				throw new UnsupportedFlavorException(flavor);
+			return new BufferTransferableData(buffer, source);
+		}
+	}
+	
+	private class BufferTransferableData
+	{
+		private final Buffer buffer;
+		private final JComponent source;
+		
+		public BufferTransferableData(Buffer buffer, JComponent source)
+		{
+			this.buffer = buffer;
+			this.source = source;
+		}
+		
+		public Buffer getBuffer()
+		{
+			return this.buffer;
+		}
+		
+		public JComponent getSource()
+		{
+			return this.source;
+		}
+	}
+	
+	private class BufferSwitcherTransferHandler extends TransferHandler
+	{
+		@Override
+		public boolean canImport(TransferSupport support)
+		{
+
+			if (!support
+					.isDataFlavorSupported(BufferSwitcher.BufferDataFlavor))
+			{
+				return false;
+			}
+
+			JList.DropLocation dl = (JList.DropLocation) support.getDropLocation();
+			if (dl.getIndex() == -1)
+			{
+				return false;
+			}
+
+			Transferable t = support.getTransferable();
+			BufferTransferableData data;
+			try
+			{
+				data = (BufferTransferableData) t
+						.getTransferData(BufferSwitcher.BufferDataFlavor);
+			}
+			catch (UnsupportedFlavorException e)
+			{
+				return false;
+			}
+			catch (IOException e)
+			{
+				return false;
+			}
+			JComponent target = (JComponent) support.getComponent();
+			EditPane sourceEditPane = (EditPane) GUIUtilities.getComponentParent(
+					data.getSource(), EditPane.class);
+			EditPane targetEditPane = (EditPane) GUIUtilities.getComponentParent(
+					target, EditPane.class);
+			BufferSet.Scope scope = jEdit.getBufferSetManager().getScope();
+			View sourceView = sourceEditPane.getView();
+			View targetView = targetEditPane.getView();
+			switch (scope)
+			{
+				case editpane:
+				{
+					return sourceEditPane != targetEditPane;
+				}
+				case view:
+				{
+					return sourceView != targetView;
+				}
+				case global:
+					return false;
+			}
+
+			return false;
+		}
+
+		@Override
+		public boolean importData(TransferSupport support)
+		{
+			if (!support.isDrop())
+			{
+				return false;
+			}
+			
+			Transferable t = support.getTransferable();
+			BufferTransferableData data;
+			try
+			{
+				data = (BufferTransferableData) t
+						.getTransferData(BufferSwitcher.BufferDataFlavor);
+			}
+			catch (UnsupportedFlavorException e)
+			{
+				return false;
+			}
+			catch (IOException e)
+			{
+				return false;
+			}
+			JComponent target = (JComponent) support.getComponent();
+			EditPane targetEditPane = (EditPane) GUIUtilities.getComponentParent(
+					target, EditPane.class);
+
+			Buffer buffer = data.getBuffer();
+
+			View view = targetEditPane.getView();
+
+			BufferSetManager bufferSetManager = jEdit.getBufferSetManager();
+			if (buffer != null)
+			{
+				bufferSetManager.addBuffer(targetEditPane, buffer);
+				targetEditPane.setBuffer(buffer);
+			}
+			view.toFront();
+			view.requestFocus();
+			targetEditPane.requestFocus();
+
+			return true;
+		}
+
+		@Override
+		public int getSourceActions(JComponent c)
+		{
+			return COPY_OR_MOVE;
+		}
+
+		@Override
+		public void exportDone(JComponent c, Transferable t, int action)
+		{
+			if (action == MOVE)
+			{
+				BufferTransferableData data;
+
+				try
+				{
+					data = (BufferTransferableData) t
+							.getTransferData(BufferSwitcher.BufferDataFlavor);
+				}
+				catch (UnsupportedFlavorException e)
+				{
+					return;
+				}
+				catch (IOException e)
+				{
+					return;
+				}
+
+				Buffer buffer = data.getBuffer();
+
+				EditPane editPane = (EditPane) GUIUtilities.getComponentParent(c,
+						EditPane.class);
+
+				BufferSetManager bufferSetManager = jEdit.getBufferSetManager();
+				if (buffer != null)
+				{
+					bufferSetManager.removeBuffer(editPane, buffer);
+				}
+			}
+		}
+
+		@Override
+		public Transferable createTransferable(JComponent c)
+		{
+			JList list = (JList) c;
+			Buffer buffer = (Buffer) list.getSelectedValue();
+			if (buffer == null)
+			{
+				return null;
+			}
+			else
+			{
+				return new BufferSwitcherTransferable(buffer, c);
+			}
+		}
+	}
 }
 
 // :noTabs=false:
diff --git a/org/gjt/sp/jedit/gui/CloseDialog.java b/org/gjt/sp/jedit/gui/CloseDialog.java
index b012e32..8a4be16 100644
--- a/org/gjt/sp/jedit/gui/CloseDialog.java
+++ b/org/gjt/sp/jedit/gui/CloseDialog.java
@@ -178,17 +178,14 @@ public class CloseDialog extends EnhancedDialog
 			{
 				Object[] paths = bufferList.getSelectedValues();
 
-				for(int i = 0; i < paths.length; i++)
+				for (Object path1 : paths)
 				{
-					String path = (String)paths[i];
+					String path = (String) path1;
 					Buffer buffer = jEdit.getBuffer(path);
-					if(!buffer.save(view,null,true,true))
-						return;
+					if (!buffer.save(view, null, true, true)) return;
 					TaskManager.instance.waitForIoTasks();
-					if(buffer.getBooleanProperty(BufferIORequest
-						.ERROR_OCCURRED))
-						return;
-					jEdit._closeBuffer(view,buffer);
+					if (buffer.getBooleanProperty(BufferIORequest.ERROR_OCCURRED)) return;
+					jEdit._closeBuffer(view, buffer);
 					bufferModel.removeElement(path);
 				}
 
@@ -207,11 +204,11 @@ public class CloseDialog extends EnhancedDialog
 			{
 				Object[] paths = bufferList.getSelectedValues();
 
-				for(int i = 0; i < paths.length; i++)
+				for (Object path1 : paths)
 				{
-					String path = (String)paths[i];
+					String path = (String) path1;
 					Buffer buffer = jEdit.getBuffer(path);
-					jEdit._closeBuffer(view,buffer);
+					jEdit._closeBuffer(view, buffer);
 					bufferModel.removeElement(path);
 				}
 
diff --git a/org/gjt/sp/jedit/gui/CompleteWord.java b/org/gjt/sp/jedit/gui/CompleteWord.java
index c707033..78af4b2 100644
--- a/org/gjt/sp/jedit/gui/CompleteWord.java
+++ b/org/gjt/sp/jedit/gui/CompleteWord.java
@@ -108,10 +108,7 @@ public class CompleteWord extends CompletionPopup
 		else
 		{
 			String longestPrefix = MiscUtilities.getLongestPrefix(
-				completions,
-				keywordMap != null
-				? keywordMap.getIgnoreCase()
-				: false);
+				completions, keywordMap != null && keywordMap.getIgnoreCase());
 
 			if (word.length() < longestPrefix.length())
 			{
@@ -258,17 +255,14 @@ public class CompleteWord extends CompletionPopup
 		if(keywordMap != null)
 		{
 			String[] keywords = keywordMap.getKeywords();
-			for(int i = 0; i < keywords.length; i++)
+			for (String _keyword : keywords)
 			{
-				String _keyword = keywords[i];
-				if(_keyword.regionMatches(keywordMap.getIgnoreCase(),
-					0,word,0,wordLen))
+				if (_keyword.regionMatches(keywordMap.getIgnoreCase(),
+							   0, word, 0, wordLen))
 				{
-					Completion keyword = new Completion(_keyword,true);
-					if(!completions.contains(keyword))
-					{
+					Completion keyword = new Completion(_keyword, true);
+					if (!completions.contains(keyword))
 						completions.add(keyword);
-					}
 				}
 			}
 		} //}}}
@@ -465,7 +459,7 @@ public class CompleteWord extends CompletionPopup
 	protected void keyTyped(KeyEvent e)
 	{
 		char ch = e.getKeyChar();
-		if(Character.isDigit(ch))
+		if(jEdit.getBooleanProperty("insertCompletionWithDigit") && Character.isDigit(ch)) 
 		{
 			int index = ch - '0';
 			if(index == 0)
diff --git a/org/gjt/sp/jedit/gui/ContextAddDialog.java b/org/gjt/sp/jedit/gui/ContextAddDialog.java
index dee30e4..95186e7 100644
--- a/org/gjt/sp/jedit/gui/ContextAddDialog.java
+++ b/org/gjt/sp/jedit/gui/ContextAddDialog.java
@@ -205,14 +205,13 @@ public class ContextAddDialog extends EnhancedDialog
 		EditAction[] actions = actionSet.getActions();
 		Vector<MenuItem> listModel = new Vector<MenuItem>(actions.length);
 
-		for(int i = 0; i < actions.length; i++)
+		for (EditAction action : actions)
 		{
-			EditAction action = actions[i];
 			String label = action.getLabel();
-			if(label == null)
+			if (label == null)
 				continue;
 
-			listModel.addElement(new MenuItem(action.getName(),label));
+			listModel.addElement(new MenuItem(action.getName(), label));
 		}
 
 		Collections.sort(listModel,new AbstractContextOptionPane.MenuItemCompare());
diff --git a/org/gjt/sp/jedit/gui/DockableWindowContainer.java b/org/gjt/sp/jedit/gui/DockableWindowContainer.java
index b206e15..dfad1b0 100644
--- a/org/gjt/sp/jedit/gui/DockableWindowContainer.java
+++ b/org/gjt/sp/jedit/gui/DockableWindowContainer.java
@@ -23,10 +23,10 @@ package org.gjt.sp.jedit.gui;
  *
  * This class should never be used directly, and is not public.
  * @author Slava Pestov
- * @version $Id: DockableWindowContainer.java 21502 2012-03-29 17:19:44Z ezust $
+ * @version $Id: DockableWindowContainer.java 23665 2014-08-22 05:12:35Z ezust $
  * @since jEdit 2.6pre3
  */
-interface DockableWindowContainer
+public interface DockableWindowContainer
 {
 	void register(DockableWindowManagerImpl.Entry entry);
 	void remove(DockableWindowManagerImpl.Entry entry);
diff --git a/org/gjt/sp/jedit/gui/DockableWindowManager.java b/org/gjt/sp/jedit/gui/DockableWindowManager.java
index 0419f20..f2fad8e 100644
--- a/org/gjt/sp/jedit/gui/DockableWindowManager.java
+++ b/org/gjt/sp/jedit/gui/DockableWindowManager.java
@@ -113,7 +113,7 @@ import org.gjt.sp.util.Log;
  * @author Slava Pestov
  * @author John Gellene (API documentation)
  * @author Shlomy Reinstein (refactoring into a base and an impl)
- * @version $Id: DockableWindowManager.java 22905 2013-03-30 18:46:10Z ezust $
+ * @version $Id: DockableWindowManager.java 23222 2013-09-29 20:43:34Z shlomy $
  * @since jEdit 2.6pre3
  *
  */
@@ -222,13 +222,11 @@ public abstract class DockableWindowManager extends JPanel
 	public void applyDockingLayout(DockingLayout docking)
 	{
 		// By default, use the docking positions specified by the jEdit properties
-		Iterator<Entry<String, String>> iterator = positions.entrySet().iterator();
-		while (iterator.hasNext())
+		for (Entry<String, String> entry : positions.entrySet())
 		{
-			Entry<String, String> entry = iterator.next();
 			String dockable = entry.getKey();
 			String position = entry.getValue();
-			if (! position.equals(FLOATING))
+			if (!position.equals(FLOATING))
 				showDockableWindow(dockable);
 		}
 	} //}}}
@@ -558,9 +556,8 @@ public abstract class DockableWindowManager extends JPanel
 		}
 
 		String[] dockables = factory.getRegisteredDockableWindows();
-		for(int i = 0; i < dockables.length; i++)
+		for (String dockable : dockables)
 		{
-			String dockable = dockables[i];
 			String oldPosition = positions.get(dockable);
 			String newPosition = getDockablePosition(dockable);
 			if (oldPosition == null || !newPosition.equals(oldPosition))
@@ -662,8 +659,8 @@ public abstract class DockableWindowManager extends JPanel
 				match1 = match(e, b1, match1);
 			if (b2 != null)
 				match2 = match(e, b2, match2);
-			if ((match1 > 0 && match1 == b1.size()) ||
-				(match2 > 0 && match2 == b2.size()))
+			if ((match1 > 0 && b1 != null && match1 == b1.size()) ||
+				(match2 > 0 && b2 != null && match2 == b2.size()))
 			{
 				hideDockableWindow(name);
 				match1 = match2 = 0;
diff --git a/org/gjt/sp/jedit/gui/DockableWindowManagerImpl.java b/org/gjt/sp/jedit/gui/DockableWindowManagerImpl.java
index f0d8672..c410b73 100644
--- a/org/gjt/sp/jedit/gui/DockableWindowManagerImpl.java
+++ b/org/gjt/sp/jedit/gui/DockableWindowManagerImpl.java
@@ -558,11 +558,8 @@ public class DockableWindowManagerImpl extends DockableWindowManager
 			String[] dockables = ((PanelWindowContainer)
 				container).getDockables();
 			Map<String,String> dockableMap = new TreeMap<String, String>();
-			for (int i = 0; i < dockables.length; i++)
-			{
-				String action = dockables[i];
+			for (String action : dockables)
 				dockableMap.put(getDockableTitle(action), action);
-			}
 			for (Map.Entry<String, String> entry : dockableMap.entrySet())
 			{
 				JMenuItem item = new JMenuItem(entry.getKey());
@@ -581,25 +578,23 @@ public class DockableWindowManagerImpl extends DockableWindowManager
 			if(!clone)
 			{
 				String[] positions = { FLOATING, TOP, LEFT, BOTTOM, RIGHT };
-				for(int i = 0; i < positions.length; i++)
+				for (final String pos : positions)
 				{
-					final String pos = positions[i];
-					if(pos.equals(currentPos))
+					if (pos.equals(currentPos))
 						continue;
 
-					JMenuItem moveMenuItem = new JMenuItem(jEdit.getProperty("view.docking.menu-"
-						+ pos));
+					JMenuItem moveMenuItem =
+						new JMenuItem(jEdit.getProperty("view.docking.menu-" + pos));
 
 					moveMenuItem.addActionListener(new ActionListener()
 					{
 						public void actionPerformed(ActionEvent evt)
 						{
-							jEdit.setProperty(dockable + ".dock-position",pos);
-							EditBus.send(new DockableWindowUpdate(
-								DockableWindowManagerImpl.this,
-								DockableWindowUpdate.PROPERTIES_CHANGED,
-								dockable
-							));
+							jEdit.setProperty(dockable + ".dock-position", pos);
+							EditBus.send(
+								new DockableWindowUpdate(DockableWindowManagerImpl.this,
+											 DockableWindowUpdate.PROPERTIES_CHANGED,
+											 dockable));
 							showDockableWindow(dockable);
 						}
 					});
@@ -841,9 +836,8 @@ public class DockableWindowManagerImpl extends DockableWindowManager
 
 		String[] windowList = factory.getRegisteredDockableWindows();
 
-		for(int i = 0; i < windowList.length; i++)
+		for (String dockable : windowList)
 		{
-			String dockable = windowList[i];
 			Entry entry = windows.get(dockable);
 			if (entry == null)
 			{
@@ -851,46 +845,33 @@ public class DockableWindowManagerImpl extends DockableWindowManager
 				// is not yet created if the plugin has some jars.
 				continue;
 			}
-			String newPosition = jEdit.getProperty(dockable
-				+ ".dock-position",FLOATING);
-			if(newPosition.equals(entry.position))
-			{
+			String newPosition = jEdit.getProperty(dockable + ".dock-position", FLOATING);
+			if (newPosition.equals(entry.position))
 				continue;
-			}
 
 			entry.position = newPosition;
-			if(entry.container != null)
+			if (entry.container != null)
 			{
 				entry.container.unregister(entry);
 				entry.container = null;
-				if (entry.factory.movable && (! newPosition.equals(FLOATING)))
+				if (entry.factory.movable && (!newPosition.equals(FLOATING)))
 				{
 					if (entry.win instanceof DockableWindow)
-						((DockableWindow)entry.win).move(newPosition);
-				}
-				else
-					entry.win = null;
+						((DockableWindow) entry.win).move(newPosition);
+				} else entry.win = null;
 			}
 
-			if(newPosition.equals(FLOATING))
+			if (newPosition.equals(FLOATING))
 			{
-			}
-
-			else
+			} else
 			{
-				if(newPosition.equals(TOP))
-					entry.container = top;
-				else if(newPosition.equals(LEFT))
-					entry.container = left;
-				else if(newPosition.equals(BOTTOM))
-					entry.container = bottom;
-				else if(newPosition.equals(RIGHT))
-					entry.container = right;
+				if (newPosition.equals(TOP)) entry.container = top;
+				else if (newPosition.equals(LEFT)) entry.container = left;
+				else if (newPosition.equals(BOTTOM)) entry.container = bottom;
+				else if (newPosition.equals(RIGHT)) entry.container = right;
 				else
 				{
-					Log.log(Log.WARNING,this,
-						"Unknown position: "
-						+ newPosition);
+					Log.log(Log.WARNING, this, "Unknown position: " + newPosition);
 					continue;
 				}
 
diff --git a/org/gjt/sp/jedit/gui/EnhancedDialog.java b/org/gjt/sp/jedit/gui/EnhancedDialog.java
index c37c8f2..bf4008f 100644
--- a/org/gjt/sp/jedit/gui/EnhancedDialog.java
+++ b/org/gjt/sp/jedit/gui/EnhancedDialog.java
@@ -20,6 +20,10 @@
 package org.gjt.sp.jedit.gui;
 
 import javax.swing.*;
+
+import org.gjt.sp.jedit.GUIUtilities;
+import org.gjt.sp.jedit.gui.KeyEventTranslator;
+
 import java.awt.event.*;
 import java.awt.*;
 
@@ -30,7 +34,7 @@ import java.awt.*;
  * Enter is pressed) and cancel() (called when Escape is pressed, or window
  * is closed).
  * @author Slava Pestov
- * @version $Id: EnhancedDialog.java 21502 2012-03-29 17:19:44Z ezust $
+ * @version $Id: EnhancedDialog.java 23832 2015-01-24 03:26:47Z ezust $
  */
 public abstract class EnhancedDialog extends JDialog
 {
@@ -101,10 +105,8 @@ public abstract class EnhancedDialog extends JDialog
 				Container cont = (Container)comp;
 				cont.addContainerListener(this);
 				Component[] comps = cont.getComponents();
-				for(int i = 0; i < comps.length; i++)
-				{
-					componentAdded(comps[i]);
-				}
+				for (Component comp1 : comps)
+					componentAdded(comp1);
 			}
 		}
 
@@ -116,10 +118,8 @@ public abstract class EnhancedDialog extends JDialog
 				Container cont = (Container)comp;
 				cont.removeContainerListener(this);
 				Component[] comps = cont.getComponents();
-				for(int i = 0; i < comps.length; i++)
-				{
-					componentRemoved(comps[i]);
-				}
+				for (Component comp1 : comps)
+					componentRemoved(comp1);
 			}
 		}
 	}
@@ -157,7 +157,10 @@ public abstract class EnhancedDialog extends JDialog
 				evt.consume();
 				ok();
 			}
-			else if(evt.getKeyCode() == KeyEvent.VK_ESCAPE)
+			else if(evt.getKeyCode() == KeyEvent.VK_ESCAPE
+					||
+					isCloseBufferShortcut(evt)
+					)
 			{
 				evt.consume();
 				if(comp instanceof JComboBox)
@@ -172,6 +175,35 @@ public abstract class EnhancedDialog extends JDialog
 				else cancel();
 			}
 		}
+
+		private boolean isCloseBufferShortcut(KeyEvent evt) {
+
+			String[] s = GUIUtilities.getShortcutLabel("close-buffer", false).split(" or ");
+
+			if(s.length == 1){ // w/o alternative shortcut
+
+				if(s[0].contains(" "))  //primary shortcut is a multiple-key shortcut
+					return false;
+				else{
+					return KeyEventTranslator.parseKey(s[0]).equals(KeyEventTranslator.translateKeyEvent(evt));
+				}
+			}
+			else{ // w/ alternative shortcut
+				boolean primarymatch,altmatch;
+				primarymatch=altmatch=false;
+
+				if(!s[0].contains(" "))
+					primarymatch=KeyEventTranslator.parseKey(s[0]).equals(KeyEventTranslator.translateKeyEvent(
+						evt));
+
+				if(!primarymatch && !s[1].contains(" "))
+					altmatch=KeyEventTranslator.parseKey(s[1]).equals(KeyEventTranslator.translateKeyEvent(evt));
+
+				if(primarymatch || altmatch)
+					return true;
+			}
+			return false;
+		}
 	}
 
 	class WindowHandler extends WindowAdapter
diff --git a/org/gjt/sp/jedit/gui/ExtendedGridLayout.java b/org/gjt/sp/jedit/gui/ExtendedGridLayout.java
index aec22df..2957a71 100644
--- a/org/gjt/sp/jedit/gui/ExtendedGridLayout.java
+++ b/org/gjt/sp/jedit/gui/ExtendedGridLayout.java
@@ -1153,13 +1153,11 @@ public class ExtendedGridLayout implements LayoutManager2
 		int gridRowsSize = gridRows.size();
 		if (gridRowsSize > 0)
 		{
-			ListIterator<ExtendedGridLayoutConstraints> gridRowIterator = gridRows.get(gridRows.size()-1).listIterator();
-			while (gridRowIterator.hasNext())
+			for (ExtendedGridLayoutConstraints cell :
+				gridRows.get(gridRows.size() - 1))
 			{
-				ExtendedGridLayoutConstraints cell = gridRowIterator.next();
-				if ((null != cell) &&
-				    ((REMAINDER != cell.getRowspan()) &&
-				     (null != cell.getRowspanPlaceholder(false))))
+				if ((null != cell) && ((REMAINDER != cell.getRowspan())
+					&& (null != cell.getRowspanPlaceholder(false))))
 				{
 					haveNext = true;
 					break;
@@ -1168,7 +1166,8 @@ public class ExtendedGridLayout implements LayoutManager2
 			while (haveNext)
 			{
 				haveNext = false;
-				gridRowIterator = gridRows.get(gridRows.size()-1).listIterator();
+				ListIterator<ExtendedGridLayoutConstraints> gridRowIterator =
+					gridRows.get(gridRows.size()-1).listIterator();
 				List<ExtendedGridLayoutConstraints> gridRow = new ArrayList<ExtendedGridLayoutConstraints>();
 				gridRows.add(gridRow);
 				ListIterator<ExtendedGridLayoutConstraints> newGridRowIterator = gridRow.listIterator();
diff --git a/org/gjt/sp/jedit/gui/FilePropertiesDialog.java b/org/gjt/sp/jedit/gui/FilePropertiesDialog.java
index 8e742d8..9a480b2 100644
--- a/org/gjt/sp/jedit/gui/FilePropertiesDialog.java
+++ b/org/gjt/sp/jedit/gui/FilePropertiesDialog.java
@@ -110,16 +110,12 @@ public class FilePropertiesDialog extends EnhancedDialog
 
 		int filesCounter = 0;
 		int directoriesCounter = 0;
-		for(int i=0;i<selectedFiles.length;i++)
+		for (VFSFile selectedFile : selectedFiles)
 		{
-			if(selectedFiles[i].getType() == VFSFile.DIRECTORY)
-			{
+			if (selectedFile.getType() == VFSFile.DIRECTORY)
 				directoriesCounter++;
-			}
-			else if(selectedFiles[i].getType() == VFSFile.FILE)
-			{
+			else if (selectedFile.getType() == VFSFile.FILE)
 				filesCounter++;
-			}
 		}
 		JPanel nameField = new JPanel();
 		nameField.add(new JLabel(jEdit.getProperty("fileprop.selectedFiles")+": "+filesCounter+", "+
@@ -137,17 +133,15 @@ public class FilePropertiesDialog extends EnhancedDialog
 		long filesSize = 0L;
 		JPanel centerPanel = new JPanel(new BorderLayout());
 
-		for (int i=0;i<selectedFiles.length;i++)
+		for (VFSFile selectedFile : selectedFiles)
 		{
-			if(selectedFiles[i].getType() == VFSFile.DIRECTORY)
+			if (selectedFile.getType() == VFSFile.DIRECTORY)
 			{
-				File ioFile = new File(selectedFiles[i].getPath());
+				File ioFile = new File(selectedFile.getPath());
 				filesSize += IOUtilities.fileLength(ioFile);
 			}
-			else if(selectedFiles[i].getType() == VFSFile.FILE)
-			{
-				filesSize += selectedFiles[i].getLength();
-			}
+			else if (selectedFile.getType() == VFSFile.FILE)
+				filesSize += selectedFile.getLength();
 		}
 
 		JPanel propField = new JPanel();
diff --git a/org/gjt/sp/jedit/gui/FilesChangedDialog.java b/org/gjt/sp/jedit/gui/FilesChangedDialog.java
index b3fa0eb..bf62693 100644
--- a/org/gjt/sp/jedit/gui/FilesChangedDialog.java
+++ b/org/gjt/sp/jedit/gui/FilesChangedDialog.java
@@ -37,7 +37,7 @@ import org.gjt.sp.util.EnhancedTreeCellRenderer;
  * Files changed on disk dialog.
  *
  * @author Slava Pestov
- * @version $Id: FilesChangedDialog.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: FilesChangedDialog.java 23221 2013-09-29 20:03:32Z shlomy $
  */
 public class FilesChangedDialog extends EnhancedDialog
 {
@@ -224,10 +224,10 @@ public class FilesChangedDialog extends EnhancedDialog
 		boolean enabled = false;
 		if(paths != null)
 		{
-			for(int i = 0; i < paths.length; i++)
+			for (TreePath tp : paths)
 			{
-				Object[] path = paths[i].getPath();
-				if(path.length == 3)
+				Object[] path = tp.getPath();
+				if (path.length == 3)
 					enabled = true;
 			}
 		}
@@ -279,24 +279,18 @@ public class FilesChangedDialog extends EnhancedDialog
 
 		int row = bufferTree.getRowForPath(paths[0]);
 
-		for(int i = 0; i < paths.length; i++)
+		for (TreePath path : paths)
 		{
-			TreePath path = paths[i];
-
 			// is it a header?
-			if(path.getPathCount() == 2)
+			if (path.getPathCount() == 2)
 				continue;
 
-			DefaultMutableTreeNode node = (DefaultMutableTreeNode)
-				path.getLastPathComponent();
-			if(!(node.getUserObject() instanceof String))
-			{
+			DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
+			if (!(node.getUserObject() instanceof String))
 				return;
-			}
 
-			Buffer buffer = jEdit.getBuffer(
-				(String)node.getUserObject());
-			if(buffer == null)
+			Buffer buffer = jEdit.getBuffer((String) node.getUserObject());
+			if (buffer == null)
 				return;
 
 			if ("RELOAD".equals(action))
@@ -307,9 +301,7 @@ public class FilesChangedDialog extends EnhancedDialog
 				buffer.setAutoReloadDialog(false);
 			}
 
-			DefaultMutableTreeNode parent =
-				(DefaultMutableTreeNode)
-				node.getParent();
+			DefaultMutableTreeNode parent = (DefaultMutableTreeNode) node.getParent();
 			parent.remove(node);
 		}
 
diff --git a/org/gjt/sp/jedit/gui/FilteredListModel.java b/org/gjt/sp/jedit/gui/FilteredListModel.java
index 9824371..6d82927 100644
--- a/org/gjt/sp/jedit/gui/FilteredListModel.java
+++ b/org/gjt/sp/jedit/gui/FilteredListModel.java
@@ -21,6 +21,7 @@
  */
 package org.gjt.sp.jedit.gui;
 
+import javax.annotation.Nullable;
 import javax.swing.*;
 import javax.swing.event.*;
 import java.util.*;
@@ -102,7 +103,7 @@ public abstract class FilteredListModel<E extends ListModel> extends AbstractLis
 	} //}}}
 
 	//{{{ setFilter() method
-	public void setFilter(final String filter)
+	public void setFilter(@Nullable final String filter)
 	{
 		Runnable runner = new Runnable()
 		{
@@ -111,7 +112,7 @@ public abstract class FilteredListModel<E extends ListModel> extends AbstractLis
 				Set<Integer> selectedIndices = saveSelection();
 				list.clearSelection();
 				FilteredListModel.this.filter = filter;
-				if (filter != null && filter.length() > 0)
+				if (filter != null && !filter.isEmpty())
 				{
 					int size = delegated.getSize();
 					String prepped_filter = prepareFilter(filter);
@@ -141,7 +142,8 @@ public abstract class FilteredListModel<E extends ListModel> extends AbstractLis
 	} //}}}
 
 	//{{{ prepareFilter() method
-	public String prepareFilter(String filter)
+	@Nullable
+	public String prepareFilter(@Nullable String filter)
 	{
 		return filter;
 	} //}}}
@@ -154,7 +156,7 @@ public abstract class FilteredListModel<E extends ListModel> extends AbstractLis
 	 * @param filter the filter string
 	 * @return true if the row must be visible
 	 */
-	public abstract boolean passFilter(int row, String filter);
+	public abstract boolean passFilter(int row, @Nullable String filter);
 	//}}}
 
 	//{{{ saveSelection()
diff --git a/org/gjt/sp/jedit/gui/GrabKeyDialog.java b/org/gjt/sp/jedit/gui/GrabKeyDialog.java
index a3fac91..1954dd7 100644
--- a/org/gjt/sp/jedit/gui/GrabKeyDialog.java
+++ b/org/gjt/sp/jedit/gui/GrabKeyDialog.java
@@ -243,15 +243,11 @@ public class GrabKeyDialog extends JDialog
 		try
 		{
 			Field[] fields = KeyEvent.class.getFields();
-			for(int i = 0; i < fields.length; i++)
+			for (Field field : fields)
 			{
-				Field field = fields[i];
 				String name = field.getName();
-				if(name.startsWith("VK_")
-					&& field.getInt(null) == keyCode)
-				{
+				if (name.startsWith("VK_") && field.getInt(null) == keyCode)
 					return name.substring(3);
-				}
 			}
 		}
 		catch(Exception e)
diff --git a/org/gjt/sp/jedit/gui/JCheckBoxList.java b/org/gjt/sp/jedit/gui/JCheckBoxList.java
index 18265cc..648020c 100644
--- a/org/gjt/sp/jedit/gui/JCheckBoxList.java
+++ b/org/gjt/sp/jedit/gui/JCheckBoxList.java
@@ -269,9 +269,9 @@ class CheckBoxListModel extends AbstractTableModel
 	CheckBoxListModel(Object[] _items)
 	{
 		items = new Vector<JCheckBoxList.Entry>(_items.length);
-		for(int i = 0; i < _items.length; i++)
+		for (Object _item : _items)
 		{
-			items.add(createEntry(_items[i]));
+			items.add(createEntry(_item));
 		}
 	}
 
diff --git a/org/gjt/sp/jedit/gui/KeyEventTranslator.java b/org/gjt/sp/jedit/gui/KeyEventTranslator.java
index 41df0ef..1d25e40 100644
--- a/org/gjt/sp/jedit/gui/KeyEventTranslator.java
+++ b/org/gjt/sp/jedit/gui/KeyEventTranslator.java
@@ -27,17 +27,18 @@ import java.awt.event.*;
 import javax.swing.KeyStroke;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Objects;
+
 import org.gjt.sp.jedit.Debug;
 import org.gjt.sp.jedit.OperatingSystem;
 import org.gjt.sp.util.Log;
-import org.gjt.sp.util.StandardUtilities;
 //}}}
 
 /** In conjunction with the <code>KeyEventWorkaround</code>, hides some
  * warts in the AWT key event API.
  *
  * @author Slava Pestov
- * @version $Id: KeyEventTranslator.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: KeyEventTranslator.java 23381 2013-12-09 12:43:14Z kpouer $
  */
 public class KeyEventTranslator
 {
@@ -79,15 +80,7 @@ public class KeyEventTranslator
 				|| (keyCode >= KeyEvent.VK_A
 				&& keyCode <= KeyEvent.VK_Z))
 			{
-				if(Debug.ALTERNATIVE_DISPATCHER)
-					return null;
-				else
-				{
-					returnValue = new Key(
-						modifiersToString(modifiers),
-						'\0',Character.toLowerCase(
-						(char)keyCode));
-				}
+				returnValue = new Key(modifiersToString(modifiers), '\0', Character.toLowerCase((char)keyCode));			
 			}
 			else
 			{
@@ -108,14 +101,8 @@ public class KeyEventTranslator
 					// do a "<space> to insert ".
 					if((modifiers & ~InputEvent.SHIFT_MASK) == 0)
 						returnValue = null;
-                    else if (Debug.ALTERNATIVE_DISPATCHER && (modifiers & ~InputEvent.META_MASK) == 0)
-                        returnValue = null;
-					else
-					{
-						returnValue = new Key(
-							modifiersToString(modifiers),
-							0,' ');
-					}
+                    else 
+						returnValue = new Key(modifiersToString(modifiers), 0, ' ');
 				}
 				else
 				{
@@ -128,9 +115,6 @@ public class KeyEventTranslator
 		case KeyEvent.KEY_TYPED:
 			char ch = evt.getKeyChar();
 
-			if(KeyEventWorkaround.isMacControl(evt))
-				ch |= 0x60;
-
 			switch(ch)
 			{
 			case '\n':
@@ -138,11 +122,7 @@ public class KeyEventTranslator
 			case '\b':
 				return null;
 			case ' ':
-                if (Debug.ALTERNATIVE_DISPATCHER && (modifiers & ~InputEvent.META_MASK) == 0)
-                    returnValue = new Key(
-                        modifiersToString(modifiers),
-                        0,' ');
-				else if((modifiers & ~InputEvent.SHIFT_MASK) != 0)
+                if ((modifiers & ~InputEvent.SHIFT_MASK) != 0)
 					return null;
 			}
 
@@ -163,15 +143,8 @@ public class KeyEventTranslator
 
 			if((modifiers & InputEvent.ALT_GRAPH_MASK) == 0
 				&& (modifiers & ~ignoreMods) != 0)
-			{
-				if(Debug.ALTERNATIVE_DISPATCHER)
-				{
-					returnValue = new Key(
-						modifiersToString(modifiers),
-						0,ch);
-				}
-				else
-					return null;
+			{				
+				return null;
 			}
 			else
 			{
@@ -401,10 +374,10 @@ public class KeyEventTranslator
 	{
 		StringBuilder buf = null;
 
-		for(int i = 0; i < MODS.length; i++)
+		for (int modifier : MODS)
 		{
-			if((mods & MODS[i]) != 0)
-				buf = lazyAppend(buf,getSymbolicModifierName(MODS[i]));
+			if ((mods & modifier) != 0)
+				buf = lazyAppend(buf, getSymbolicModifierName(modifier));
 		}
 
 		if(buf == null)
@@ -530,7 +503,7 @@ public class KeyEventTranslator
 
 		private final int hashCode;
 		/**
-			Wether this Key event applies to all jEdit windows (and not only a specific jEdit GUI component).
+			Whether this Key event applies to all jEdit windows (and not only a specific jEdit GUI component).
 		*/
 		protected boolean isFromGlobalContext;
 
@@ -554,8 +527,7 @@ public class KeyEventTranslator
 			if(o instanceof Key)
 			{
 				Key k = (Key)o;
-				if(StandardUtilities.objectsEqual(modifiers,
-					k.modifiers) && key == k.key
+				if(Objects.equals(modifiers, k.modifiers) && key == k.key
 					&& input == k.input)
 				{
 					return true;
diff --git a/org/gjt/sp/jedit/gui/KeyEventWorkaround.java b/org/gjt/sp/jedit/gui/KeyEventWorkaround.java
index c7aaffb..3bec234 100644
--- a/org/gjt/sp/jedit/gui/KeyEventWorkaround.java
+++ b/org/gjt/sp/jedit/gui/KeyEventWorkaround.java
@@ -35,7 +35,7 @@ import org.gjt.sp.util.Log;
  * Java's keyboard handling is crap, to put it mildly.
  *
  * @author Slava Pestov
- * @version $Id: KeyEventWorkaround.java 22842 2013-03-14 21:38:44Z elberry $
+ * @version $Id: KeyEventWorkaround.java 23204 2013-09-23 21:41:51Z ezust $
  */
 public class KeyEventWorkaround
 {
@@ -188,17 +188,6 @@ public class KeyEventWorkaround
 		}
 	} //}}}
 
-	//{{{ isMacControl() method
-	/**
-	 * Apple sucks.
-	 */
-	public static boolean isMacControl(KeyEvent evt)
-	{
-		return (OperatingSystem.isMacOS() &&
-			(evt.getModifiers() & InputEvent.CTRL_MASK) != 0
-			&& evt.getKeyChar() <= 0x2B);
-	} //}}}
-
 	//{{{ isNumericKeypad() method
 	public static boolean isNumericKeypad(int keyCode)
 	{
@@ -282,8 +271,7 @@ public class KeyEventWorkaround
 		case KeyEvent.KEY_TYPED:
 			// need to let \b through so that backspace will work
 			// in HistoryTextFields
-			if(!isMacControl(evt)
-				&& (ch < 0x20 || ch == 0x7f || ch == 0xff)
+			if((ch < 0x20 || ch == 0x7f || ch == 0xff)
 				&& ch != '\b' && ch != '\t' && ch != '\n')
 			{
 				return null;
@@ -295,17 +283,14 @@ public class KeyEventWorkaround
 					+ AbstractInputHandler.toString(evt)+": last="+last+".");
 			}
 
-			if(!Debug.ALTERNATIVE_DISPATCHER)
+			if((modifiers & InputEvent.CTRL_MASK) != 0
+				&& (modifiers & InputEvent.ALT_MASK) == 0
+				|| (modifiers & InputEvent.CTRL_MASK) == 0
+				&& (modifiers & InputEvent.ALT_MASK) != 0
+				&& !Debug.ALT_KEY_PRESSED_DISABLED
+				|| (modifiers & InputEvent.META_MASK) != 0)
 			{
-				if((modifiers & InputEvent.CTRL_MASK) != 0
-					&& (modifiers & InputEvent.ALT_MASK) == 0
-					|| (modifiers & InputEvent.CTRL_MASK) == 0
-					&& (modifiers & InputEvent.ALT_MASK) != 0
-					&& !Debug.ALT_KEY_PRESSED_DISABLED
-					|| (modifiers & InputEvent.META_MASK) != 0)
-				{
-					return null;
-				}
+				return null;
 			}
 
 			// if the last key was a numeric keypad key
diff --git a/org/gjt/sp/jedit/gui/LogViewer.java b/org/gjt/sp/jedit/gui/LogViewer.java
index c7899cd..d00f167 100644
--- a/org/gjt/sp/jedit/gui/LogViewer.java
+++ b/org/gjt/sp/jedit/gui/LogViewer.java
@@ -25,6 +25,9 @@ package org.gjt.sp.jedit.gui;
 //{{{ Imports
 import java.awt.*;
 import java.awt.event.*;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import javax.annotation.Nullable;
 import javax.swing.*;
 import javax.swing.border.EmptyBorder;
 import javax.swing.event.*;
@@ -36,10 +39,13 @@ import org.gjt.sp.util.ThreadUtilities;
 //}}}
 
 /** Activity Log Viewer
- * @version $Id: LogViewer.java 21989 2012-08-08 12:21:07Z jarekczek $
+ * @version $Id: LogViewer.java 23426 2014-02-28 10:39:28Z kpouer $
  */
 public class LogViewer extends JPanel implements DefaultFocusComponent
 {
+
+	private final ColorizerCellRenderer cellRenderer;
+
 	//{{{ LogViewer constructor
 	public LogViewer()
 	{
@@ -119,6 +125,8 @@ public class LogViewer extends JPanel implements DefaultFocusComponent
 
 		list = new LogList(listModel);
 		listModel.setList(list);
+		cellRenderer = new ColorizerCellRenderer();
+		list.setCellRenderer(cellRenderer);
 		setFilter();
 
 		add(BorderLayout.NORTH,caption);
@@ -135,7 +143,6 @@ public class LogViewer extends JPanel implements DefaultFocusComponent
 	@Override
 	public void setBounds(int x, int y, int width, int height)
 	{
-		list.setCellRenderer( new ColorizerCellRenderer() );
 		super.setBounds(x, y, width, height);
 		scrollLaterIfRequired();
 	} //}}}
@@ -152,6 +159,7 @@ public class LogViewer extends JPanel implements DefaultFocusComponent
 	public void addNotify()
 	{
 		super.addNotify();
+		cellRenderer.updateColors();
 		ListModel model = Log.getLogListModel();
 		model.addListDataListener(listModel);
 		model.addListDataListener(listHandler = new ListHandler());
@@ -205,6 +213,7 @@ public class LogViewer extends JPanel implements DefaultFocusComponent
 	//{{{ propertiesChanged() method
 	private void propertiesChanged()
 	{
+		cellRenderer.updateColors();
 		list.setFont(jEdit.getFontProperty("view.font"));
 		list.setFixedCellHeight(list.getFontMetrics(list.getFont())
 					.getHeight());
@@ -257,9 +266,9 @@ public class LogViewer extends JPanel implements DefaultFocusComponent
 				Object[] selected = list.getSelectedValues();
 				if(selected != null && selected.length != 0)
 				{
-					for(int i = 0; i < selected.length; i++)
+					for (Object sel : selected)
 					{
-						buf.append(selected[i]);
+						buf.append(sel);
 						buf.append('\n');
 					}
 				}
@@ -349,6 +358,16 @@ public class LogViewer extends JPanel implements DefaultFocusComponent
 	//{{{ ColorizerCellRenderer class
 	private static class ColorizerCellRenderer extends JLabel implements ListCellRenderer
 	{
+		private static Color debugColor;
+		private static Color messageColor;
+		private static Color noticeColor;
+		private static Color warningColor;
+		private static Color errorColor;
+
+		private ColorizerCellRenderer()
+		{
+			updateColors();
+		}
 
 		// This is the only method defined by ListCellRenderer.
 		// We just reconfigure the JLabel each time we're called.
@@ -373,31 +392,40 @@ public class LogViewer extends JPanel implements DefaultFocusComponent
 				Color color = list.getForeground();
 				if (s.contains("[debug]"))
 				{
-					color = jEdit.getColorProperty("log-viewer.message.debug.color", Color.BLUE);
+					color = debugColor;
 				}
 				else if (s.contains("[message]"))
 				{
-					color = jEdit.getColorProperty("log-viewer.message.message.color", Color.BLACK);
+					color = messageColor;
 				}
 				else if (s.contains("[notice]"))
 				{
-					color = jEdit.getColorProperty("log-viewer.message.notice.color", Color.GREEN);
+					color = noticeColor;
 				}
 				else if (s.contains("[warning]"))
 				{
-					color = jEdit.getColorProperty("log-viewer.message.warning.color", Color.ORANGE);
+					color = warningColor;
 				}
 				else if (s.contains("[error]"))
 				{
-					color = jEdit.getColorProperty("log-viewer.message.error.color", Color.RED);
+					color = errorColor;
 				}
-				setForeground( color );
+				setForeground(color);
 			}
-			setEnabled( list.isEnabled() );
-			setFont( list.getFont() );
-			setOpaque( true );
+			setEnabled(list.isEnabled());
+			setFont(list.getFont());
+			setOpaque(true);
 			return this;
 		}
+
+		public void updateColors()
+		{
+			debugColor = jEdit.getColorProperty("log-viewer.message.debug.color", Color.BLUE);
+			messageColor = jEdit.getColorProperty("log-viewer.message.message.color", Color.BLACK);
+			noticeColor = jEdit.getColorProperty("log-viewer.message.notice.color", Color.GREEN);
+			warningColor = jEdit.getColorProperty("log-viewer.message.warning.color", Color.ORANGE);
+			errorColor = jEdit.getColorProperty("log-viewer.message.error.color", Color.RED);
+		}
 	} //}}}
 
 	//{{{ MyFilteredListModel
@@ -415,20 +443,22 @@ public class LogViewer extends JPanel implements DefaultFocusComponent
 		}
 
 		@Override
-		public boolean passFilter(int row, String filter)
+		public boolean passFilter(int row, @Nullable String filter)
 		{
+			if (filter == null || filter.isEmpty())
+				return true;
 			String text = delegated.getElementAt(row).toString().toLowerCase();
-			if (text.contains("[debug]") && !showDebug)
+			if (!showDebug && text.contains("[debug]"))
 				return false;
-			if (text.contains("[message]") && !showMessage)
+			if (!showMessage && text.contains("[message]"))
 				return false;
-			if (text.contains("[notice]") && !showNotice)
+			if (!showNotice && text.contains("[notice]"))
 				return false;
-			if (text.contains("[warning]") && !showWarning)
+			if (!showWarning && text.contains("[warning]"))
 				return false;
-			if (text.contains("[error]") && !showError)
+			if (!showError && text.contains("[error]"))
 				return false;
-			return filter.length() == 0 || text.contains(filter);
+			return text.contains(filter);
 		}
 	} //}}}
 
diff --git a/org/gjt/sp/jedit/gui/OptionsDialog.java b/org/gjt/sp/jedit/gui/OptionsDialog.java
index adbd903..d19dde3 100644
--- a/org/gjt/sp/jedit/gui/OptionsDialog.java
+++ b/org/gjt/sp/jedit/gui/OptionsDialog.java
@@ -41,7 +41,7 @@ import org.gjt.sp.util.Log;
 
 /** An abstract options dialog box.
  * @author Slava Pestov
- * @version $Id: OptionsDialog.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: OptionsDialog.java 23516 2014-04-24 03:50:48Z ezust $
  * @todo refactor to use OptionGroupPane
  */
 public abstract class OptionsDialog extends EnhancedDialog
@@ -90,13 +90,11 @@ public abstract class OptionsDialog extends EnhancedDialog
 	{
 		getDefaultGroup().addOptionPane(pane);
 	} //}}}
-
+	
 	//{{{ ok() method
 	@Override
 	public void ok()
 	{
-		if(currentPane != null)
-			jEdit.setProperty(name + ".last",currentPane.getName());
 		ok(true);
 	} //}}}
 
@@ -112,6 +110,9 @@ public abstract class OptionsDialog extends EnhancedDialog
 	//{{{ ok() method
 	public void ok(boolean dispose)
 	{
+		if(currentPane != null)
+			jEdit.setProperty(name + ".last",currentPane.getName());
+	
 		OptionTreeModel m = (OptionTreeModel) paneTree
 			.getModel();
 		save(m.getRoot());
@@ -294,9 +295,11 @@ public abstract class OptionsDialog extends EnhancedDialog
 	protected void init(String name, String pane)
 	{
 		this.name = name;
-
 		deferredOptionPanes = new HashMap<Object, OptionPane>();
 
+		if (pane == null) 
+			pane = jEdit.getProperty(name + ".last");		
+		
 		JPanel content = new JPanel(new BorderLayout(12,12));
 		content.setBorder(new EmptyBorder(12,12,12,12));
 		setContentPane(content);
diff --git a/org/gjt/sp/jedit/gui/PanelWindowContainer.java b/org/gjt/sp/jedit/gui/PanelWindowContainer.java
index 9f24793..f212c8d 100644
--- a/org/gjt/sp/jedit/gui/PanelWindowContainer.java
+++ b/org/gjt/sp/jedit/gui/PanelWindowContainer.java
@@ -72,7 +72,7 @@ import org.gjt.sp.util.StandardUtilities;
 /** A container for dockable windows. This class should never be used
  * directly.
  * @author Slava Pestov
- * @version $Id: PanelWindowContainer.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: PanelWindowContainer.java 23221 2013-09-29 20:03:32Z shlomy $
  * @since jEdit 4.0pre1
  */
 public class PanelWindowContainer implements DockableWindowContainer, DockingArea
@@ -389,10 +389,8 @@ public class PanelWindowContainer implements DockableWindowContainer, DockingAre
 		buttonPanel.add(closeBox);
 		buttonPanel.add(menuBtn);
 		Collections.sort(buttons,new DockableWindowCompare());
-		for(int i = 0; i < buttons.size(); i++)
-		{
-			buttonPanel.add(buttons.get(i));
-		}
+		for (AbstractButton button : buttons)
+			buttonPanel.add(button);
 	} //}}}
 
 	//{{{ getWrappedDimension() method
@@ -820,10 +818,8 @@ public class PanelWindowContainer implements DockableWindowContainer, DockingAre
 			Component[] comp = parent.getComponents();
 			if(comp.length <= 2)
 			{
-				for(int i = 0; i < comp.length; i++)
-				{
-					comp[i].setVisible(false);
-				}
+				for (Component aComp : comp)
+					aComp.setVisible(false);
 				return;
 			}
 
diff --git a/org/gjt/sp/jedit/gui/PasteFromListDialog.java b/org/gjt/sp/jedit/gui/PasteFromListDialog.java
index 83c1a07..a2b004a 100644
--- a/org/gjt/sp/jedit/gui/PasteFromListDialog.java
+++ b/org/gjt/sp/jedit/gui/PasteFromListDialog.java
@@ -115,10 +115,10 @@ public class PasteFromListDialog extends EnhancedDialog
 		 * to the model. This has the effect of moving it to the
 		 * top of the list.
 		 */
-		for(int i = 0; i < selected.length; i++)
+		for (Object sel : selected)
 		{
-			listModel.removeElement(selected[i]);
-			listModel.insertElementAt(selected[i],0);
+			listModel.removeElement(sel);
+			listModel.insertElementAt(sel, 0);
 		}
 
 		view.getTextArea().setSelectedText(text);
diff --git a/org/gjt/sp/jedit/gui/SplashScreen.java b/org/gjt/sp/jedit/gui/SplashScreen.java
index 487c754..dabb236 100644
--- a/org/gjt/sp/jedit/gui/SplashScreen.java
+++ b/org/gjt/sp/jedit/gui/SplashScreen.java
@@ -1,6 +1,7 @@
 /*
  * SplashScreen.java - Splash screen
  * Copyright (C) 1998, 2004 Slava Pestov
+ * Copyright (C) 2014 Eric Le Lay
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -28,61 +29,79 @@ import org.gjt.sp.util.Log;
 //}}}
 
 /** The splash screen displayed on startup.
- * @version $Id: SplashScreen.java 21515 2012-03-31 08:35:49Z jarekczek $
+ * @version $Id: SplashScreen.java 23449 2014-03-30 19:14:26Z kerik-sf $
  */
 public class SplashScreen extends JComponent
 {
+	private static final long serialVersionUID = 1L;
+
 	//{{{ SplashScreen constructor
 	public SplashScreen()
 	{
-		setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
-		setBackground(Color.white);
+		realSplash = java.awt.SplashScreen.getSplashScreen();
+		fm = getFontMetrics(labelFont);
+		if(realSplash == null)
+		{
+			setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+			setBackground(Color.white);
 
-		setFont(defaultFont);
-		fm = getFontMetrics(defaultFont);
-		image = getToolkit().getImage(
-			getClass().getResource("/org/gjt/sp/jedit/icons/splash.png"));
-		MediaTracker tracker = new MediaTracker(this);
-		tracker.addImage(image,0);
+			image = getToolkit().getImage(
+				getClass().getResource("/org/gjt/sp/jedit/icons/splash.png"));
+			MediaTracker tracker = new MediaTracker(this);
+			tracker.addImage(image,0);
 
-		try
-		{
-			tracker.waitForAll();
-		}
-		catch(Exception e)
-		{
-			Log.log(Log.ERROR,this,e);
-		}
-		Dimension screen = getToolkit().getScreenSize(); // sane default
-		win = new JWindow();
-		GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
-		GraphicsDevice[] gs = ge.getScreenDevices();
-		GraphicsDevice gd = gs[0];
-		if (gd != null)
-		{
-			GraphicsConfiguration gconf = gd.getDefaultConfiguration();
-			if (gconf != null)
+			try
 			{
-				Rectangle bounds = gconf.getBounds();
-				screen = new Dimension(bounds.width, bounds.height);
+				tracker.waitForAll();
 			}
+			catch(Exception e)
+			{
+				Log.log(Log.ERROR,this,e);
+			}
+			Dimension screen = getToolkit().getScreenSize(); // sane default
+			win = new JWindow();
+			GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+			GraphicsDevice[] gs = ge.getScreenDevices();
+			GraphicsDevice gd = gs[0];
+			if (gd != null)
+			{
+				GraphicsConfiguration gconf = gd.getDefaultConfiguration();
+				if (gconf != null)
+				{
+					Rectangle bounds = gconf.getBounds();
+					screen = new Dimension(bounds.width, bounds.height);
+				}
+			}
+			Dimension size = new Dimension(image.getWidth(this) + 2,
+				image.getHeight(this)+2);
+			win.setSize(size);
+			win.getContentPane().add(this, BorderLayout.CENTER);
+			win.setLocation((screen.width - size.width) / 2,
+				(screen.height - size.height) / 2);
+			win.validate();
+			win.setVisible(true);
+		}
+		else
+		{
+			win = null;
+			image=null;
 		}
-		Dimension size = new Dimension(image.getWidth(this) + 2,
-			image.getHeight(this) + 2 + PROGRESS_HEIGHT);
-		win.setSize(size);
-
-		win.getContentPane().add(this, BorderLayout.CENTER);
-
-		win.setLocation((screen.width - size.width) / 2,
-			(screen.height - size.height) / 2);
-		win.validate();
-		win.setVisible(true);
 	} //}}}
 
 	//{{{ dispose() method
 	public void dispose()
 	{
-		win.dispose();
+		if(realSplash==null)
+		{
+			win.dispose();
+		}
+		else
+		{
+			if(realSplash.isVisible())
+			{
+				realSplash.close();
+			}
+		}
 	} //}}}
 
 	//{{{ advance() methods
@@ -92,15 +111,18 @@ public class SplashScreen extends JComponent
 		progress++;
 		repaint();
 
-		// wait for it to be painted to ensure progress is updated
-		// continuously
-		try
+		if(realSplash == null)
 		{
-			wait();
-		}
-		catch(InterruptedException ie)
-		{
-			Log.log(Log.ERROR,this,ie);
+			// wait for it to be painted to ensure progress is updated
+			// continuously
+			try
+			{
+				wait();
+			}
+			catch(InterruptedException ie)
+			{
+				Log.log(Log.ERROR,this,ie);
+			}
 		}
 	}
 
@@ -111,15 +133,18 @@ public class SplashScreen extends JComponent
 		this.label = label;
 		repaint();
 
-		// wait for it to be painted to ensure progress is updated
-		// continuously
-		try
-		{
-			wait();
-		}
-		catch(InterruptedException ie)
+		if(realSplash == null)
 		{
-			Log.log(Log.ERROR,this,ie);
+			// wait for it to be painted to ensure progress is updated
+			// continuously
+			try
+			{
+				wait();
+			}
+			catch(InterruptedException ie)
+			{
+				Log.log(Log.ERROR,this,ie);
+			}
 		}
 	} //}}}
 
@@ -141,41 +166,82 @@ public class SplashScreen extends JComponent
 		}
 	} //}}}
 
+	//{{{ repaint() method
+	@Override
+	public void repaint()
+	{
+		if(realSplash == null)
+		{
+			// fallback to the default code
+			super.repaint();
+			return;
+		}
+
+		Graphics2D g = realSplash.createGraphics();
+		if (g == null)
+		{
+			Log.log(Log.ERROR, SplashScreen.class,
+					"using native splash screen, but can't obtain graphics from it");
+			return;
+		}
+
+		Dimension size = realSplash.getSize();
+
+		// tell the splash screen the zone to repaint (everything)
+		g.setComposite(AlphaComposite.Clear);
+		g.fillRect(0,0,size.width,size.height);
+		g.setPaintMode();
+
+		doPaintContents(g, size);
+
+		realSplash.update();
+	} //}}}
+
 	//{{{ paintComponent() method
 	@Override
 	public synchronized void paintComponent(Graphics g)
 	{
 		Dimension size = getSize();
 
+		g.drawImage(image,1,1,this);
+
+		doPaintContents(g, size);
+
+		// for the wait() inside advance(...)
+		notify();
+	} //}}}
+
+	//{{{ doPaintContents() method
+	/**
+	 *  Code common to the native and swing splash screens
+	 */
+	private void doPaintContents(Graphics g, Dimension size)
+	{
 		g.setColor(Color.black);
 		g.drawRect(0,0,size.width - 1,size.height - 1);
 
-		g.drawImage(image,1,1,this);
-
-		// XXX: This should not be hardcoded
 		g.setColor(Color.white);
-		g.fillRect(1,image.getHeight(this) + 1,
-			((win.getWidth() - 2) * progress) / PROGRESS_COUNT, PROGRESS_HEIGHT);
+		g.fillRect(1,size.height - 1 - PROGRESS_HEIGHT,
+			((size.width - 2) * progress) / PROGRESS_COUNT, PROGRESS_HEIGHT);
 
 		g.setColor(Color.black);
 
 		if (label != null)
 		{
-			int drawOffsetX = (getWidth() - fm.stringWidth(label)) / 2;
-			int drawOffsetY = image.getHeight(this) + (PROGRESS_HEIGHT
-							      + fm.getAscent() + fm.getDescent()) / 2;
+			int drawOffsetX = (size.width - fm.stringWidth(label)) / 2;
+			int drawOffsetY = size.height - 2 - PROGRESS_HEIGHT
+					+ (PROGRESS_HEIGHT + fm.getAscent() + fm.getDescent()) / 2;
 
 			paintString(g, label, drawOffsetX, drawOffsetY);
 		}
 
 		String version = "version " + jEdit.getVersion();
 
-		int drawOffsetX = (getWidth() / 2) - (fm.stringWidth(version) / 2);
-		int drawOffsetY = image.getHeight(this) - fm.getDescent() - 2;
+		int drawOffsetX = (size.width / 2) - (fm.stringWidth(version) / 2);
+		int drawOffsetY = size.height - PROGRESS_HEIGHT - fm.getDescent() - 3;
 
 		paintString(g, version, drawOffsetX, drawOffsetY);
 
-		notify();
 	} //}}}
 
 	//{{{ paintString() method
@@ -202,9 +268,9 @@ public class SplashScreen extends JComponent
 	private String lastLabel;
 	private long firstAdvanceTime = System.currentTimeMillis();
 	private long lastAdvanceTime = System.currentTimeMillis();
-	private Font defaultFont = new Font("Dialog",Font.PLAIN,10);
 	private Font labelFont = UIManager.getFont("Label.font").deriveFont(9.8f);
 	private Color versionColor1 = new Color(55, 55, 55);
 	private Color versionColor2 = new Color(255, 255, 255, 50);
+	private java.awt.SplashScreen realSplash;
 	//}}}
 }
diff --git a/org/gjt/sp/jedit/gui/StatusBar.java b/org/gjt/sp/jedit/gui/StatusBar.java
index 3f309b2..9364829 100644
--- a/org/gjt/sp/jedit/gui/StatusBar.java
+++ b/org/gjt/sp/jedit/gui/StatusBar.java
@@ -30,8 +30,8 @@ import javax.swing.text.Segment;
 import javax.swing.*;
 import java.awt.event.*;
 import java.awt.*;
+import java.util.Objects;
 import java.util.StringTokenizer;
-import org.gjt.sp.jedit.io.*;
 import org.gjt.sp.jedit.textarea.*;
 import org.gjt.sp.jedit.*;
 import org.gjt.sp.jedit.gui.statusbar.StatusWidgetFactory;
@@ -52,7 +52,7 @@ import org.gjt.sp.util.*;
  * <li>Displaying memory status
  * </ul>
  *
- * @version $Id: StatusBar.java 22942 2013-04-22 11:27:52Z thomasmey $
+ * @version $Id: StatusBar.java 23410 2014-02-09 19:23:35Z ezust $
  * @author Slava Pestov
  * @since jEdit 3.2pre2
  */
@@ -132,7 +132,7 @@ public class StatusBar extends JPanel
 			panel.remove(caretStatus);
 
 		String statusBar = jEdit.getProperty("view.status");
-		if (!StandardUtilities.objectsEqual(currentBar, statusBar))
+		if (!Objects.equals(currentBar, statusBar))
 		{
 			box.removeAll();
 			StringTokenizer tokenizer = new StringTokenizer(statusBar);
@@ -334,6 +334,7 @@ public class StatusBar extends JPanel
 	} //}}}
 
 	//{{{ updateCaretStatus() method
+	/** Updates the status bar with information about the caret position, line number, etc */
 	public void updateCaretStatus()
 	{
 		if (showCaretStatus)
diff --git a/org/gjt/sp/jedit/gui/statusbar/ErrorsWidgetFactory.java b/org/gjt/sp/jedit/gui/statusbar/ErrorsWidgetFactory.java
index 0571ab7..a4f9827 100644
--- a/org/gjt/sp/jedit/gui/statusbar/ErrorsWidgetFactory.java
+++ b/org/gjt/sp/jedit/gui/statusbar/ErrorsWidgetFactory.java
@@ -23,7 +23,10 @@
 package org.gjt.sp.jedit.gui.statusbar;
 
 //{{{ Imports
+import org.gjt.sp.jedit.ActionSet;
 import org.gjt.sp.jedit.EditAction;
+import org.gjt.sp.jedit.JEditActionSet;
+import org.gjt.sp.jedit.JEditBeanShellAction;
 import org.gjt.sp.jedit.Registers;
 import org.gjt.sp.jedit.View;
 import org.gjt.sp.jedit.jEdit;
@@ -31,8 +34,10 @@ import org.gjt.sp.jedit.GUIUtilities;
 import org.gjt.sp.jedit.gui.EnhancedDialog;
 import org.gjt.sp.jedit.syntax.SyntaxStyle;
 import org.gjt.sp.jedit.textarea.JEditEmbeddedTextArea;
+import org.gjt.sp.jedit.textarea.StandaloneTextArea;
 import org.gjt.sp.jedit.textarea.TextArea;
 import org.gjt.sp.util.Log;
+import org.jedit.keymap.Keymap;
 
 import javax.swing.*;
 import java.awt.*;
@@ -212,6 +217,19 @@ public class ErrorsWidgetFactory implements StatusWidgetFactory
 			printStream = new PrintStream(byteArrayOutputStream);
 			throwables = Log.throwables.toArray();
 			textArea = new JEditEmbeddedTextArea();
+			JEditActionSet<JEditBeanShellAction> actionSet = new StandaloneTextArea.StandaloneActionSet(jEdit.getPropertyManager(),
+																										textArea,
+																										TextArea.class.getResource("textarea.actions.xml"));
+			textArea.addActionSet(actionSet);
+			actionSet.load();
+			actionSet.initKeyBindings();
+			Keymap keymap = jEdit.getKeymapManager().getKeymap();
+			String shortcut = keymap.getShortcut("copy.shortcut");
+			if (shortcut != null)
+				textArea.getInputHandler().addKeyBinding(shortcut, "copy");
+			String shortcut2 = keymap.getShortcut("copy.shortcut2");
+			if (shortcut2 != null)
+				textArea.getInputHandler().addKeyBinding(shortcut2, "copy");
 
 			JPopupMenu menu = new JPopupMenu();
 			JMenuItem copy = new JMenuItem(jEdit.getProperty("copy.label").replace("$",""));
diff --git a/org/gjt/sp/jedit/gui/statusbar/MultiSelectWidgetFactory.java b/org/gjt/sp/jedit/gui/statusbar/MultiSelectWidgetFactory.java
index 70e8182..90c69d8 100644
--- a/org/gjt/sp/jedit/gui/statusbar/MultiSelectWidgetFactory.java
+++ b/org/gjt/sp/jedit/gui/statusbar/MultiSelectWidgetFactory.java
@@ -30,9 +30,7 @@ import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
 import javax.swing.*;
 
-import org.gjt.sp.jedit.GUIUtilities;
 import org.gjt.sp.jedit.View;
-import org.gjt.sp.jedit.gui.CompletionPopup;
 import org.gjt.sp.jedit.jEdit;
 import org.gjt.sp.jedit.textarea.JEditTextArea;
 //}}}
@@ -44,6 +42,7 @@ import org.gjt.sp.jedit.textarea.JEditTextArea;
 public class MultiSelectWidgetFactory implements StatusWidgetFactory
 {
 	//{{{ getWidget() method
+	@Override
 	public Widget getWidget(View view)
 	{
 		Widget multiSelect = new MultiSelectWidget(view);
@@ -73,11 +72,13 @@ public class MultiSelectWidgetFactory implements StatusWidgetFactory
 			});
 		}
 
+		@Override
 		public JComponent getComponent()
 		{
 			return multiSelect;
 		}
 
+		@Override
 		public void update()
 		{
 			JEditTextArea textArea = view.getTextArea();
@@ -96,6 +97,7 @@ public class MultiSelectWidgetFactory implements StatusWidgetFactory
 			}
 		}
 
+		@Override
 		public void propertiesChanged()
 		{
 			// retarded GTK look and feel!
diff --git a/org/gjt/sp/jedit/gui/statusbar/TaskMonitorWidgetFactory.java b/org/gjt/sp/jedit/gui/statusbar/TaskMonitorWidgetFactory.java
index 9deb849..5eb5c0b 100644
--- a/org/gjt/sp/jedit/gui/statusbar/TaskMonitorWidgetFactory.java
+++ b/org/gjt/sp/jedit/gui/statusbar/TaskMonitorWidgetFactory.java
@@ -3,7 +3,7 @@
  * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
- * Copyright © 2011 Matthieu Casanova
+ * Copyright © 2011-2013 Matthieu Casanova
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -28,8 +28,11 @@ import org.gjt.sp.util.TaskListener;
 import org.gjt.sp.util.TaskManager;
 
 import javax.swing.*;
+import java.awt.Font;
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
+import java.text.FieldPosition;
+import java.text.MessageFormat;
 //}}}
 
 /**
@@ -52,8 +55,19 @@ public class TaskMonitorWidgetFactory implements StatusWidgetFactory
     //{{{ TaskMonitorWidget class
     private static class TaskMonitorWidget extends JLabel implements Widget, TaskListener
     {
-        private TaskMonitorWidget(final View view)
+		private final MessageFormat messageFormat;
+		private final Object[] args;
+		private final StringBuffer stringBuffer;
+		private FieldPosition fieldPosition;
+
+		private TaskMonitorWidget(final View view)
         {
+			setBorder(BorderFactory.createEmptyBorder(0,2,0,2));
+			setFont(getFont().deriveFont(Font.BOLD));
+			String property = jEdit.getProperty("statusbar.task-monitor.template");
+			args = new Object[1];
+			messageFormat = new MessageFormat(property);
+			fieldPosition = new FieldPosition(0);
             addMouseListener(new MouseAdapter()
             {
                 @Override
@@ -65,7 +79,8 @@ public class TaskMonitorWidgetFactory implements StatusWidgetFactory
                     }
                 }
             });
-        }
+			stringBuffer = new StringBuffer();
+		}
 
         @Override
         public void addNotify()
@@ -99,12 +114,19 @@ public class TaskMonitorWidgetFactory implements StatusWidgetFactory
             int count = TaskManager.instance.countTasks();
             if (count == 0)
             {
+				setIcon(null);
                 setText(null);
             }
             else
             {
-                setText(jEdit.getProperty("statusbar.task-monitor.template", new Object[]{Integer.toString(count)}));
-            }
+				synchronized (messageFormat)
+				{
+					setIcon(GUIUtilities.loadIcon("loader.gif"));
+					args[0] = count;
+					setText(messageFormat.format(args, stringBuffer, fieldPosition).toString());
+					stringBuffer.setLength(0);
+				}
+			}
         }
 
         @Override
diff --git a/org/gjt/sp/jedit/gui/tray/JTrayIconManager.java b/org/gjt/sp/jedit/gui/tray/JTrayIconManager.java
index b01cb6e..48a4149 100644
--- a/org/gjt/sp/jedit/gui/tray/JTrayIconManager.java
+++ b/org/gjt/sp/jedit/gui/tray/JTrayIconManager.java
@@ -89,7 +89,8 @@ public class JTrayIconManager
 				trayIcon = null;
 				return;
 			}
-			if (trayIcon instanceof EBComponent) {
+			if (trayIcon instanceof EBComponent)
+			{
 				EditBus.addToBus(trayIcon);
 			}
 		}
@@ -101,7 +102,8 @@ public class JTrayIconManager
 		if (trayIcon != null)
 		{
 			SystemTray.getSystemTray().remove(trayIcon);
-			if (trayIcon instanceof EBComponent) {
+			if (trayIcon instanceof EBComponent)
+			{
 				EditBus.removeFromBus(trayIcon);
 			}
 			trayIcon = null;
diff --git a/org/gjt/sp/jedit/help/HelpHistoryModel.java b/org/gjt/sp/jedit/help/HelpHistoryModel.java
index 349f5bb..80a893b 100644
--- a/org/gjt/sp/jedit/help/HelpHistoryModel.java
+++ b/org/gjt/sp/jedit/help/HelpHistoryModel.java
@@ -29,7 +29,7 @@ import java.util.ArrayList;
 /**
  * History model used by the help browser 
  * @author Nicholas O'Leary
- * @version $Id: HelpHistoryModel.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: HelpHistoryModel.java 23221 2013-09-29 20:03:32Z shlomy $
  */
 public class HelpHistoryModel
 {
@@ -133,12 +133,10 @@ public class HelpHistoryModel
 	//{{{ updateTitle() method
 	public void updateTitle(String url, String title)
 	{
-		for (int i=0;i<history.length;i++)
+		for (HistoryEntry aHistory : history)
 		{
-			if ((history[i] != null) && history[i].url.equals(url))
-			{
-				history[i].title = title;
-			}
+			if ((aHistory != null) && aHistory.url.equals(url))
+				aHistory.title = title;
 		}
 		fireUpdate();
 	}//}}}
@@ -186,10 +184,8 @@ public class HelpHistoryModel
 	//{{{ fireUpdate() method
 	public void fireUpdate()
 	{
-		for (int i=0 ; i<listeners.size() ; i++)
-		{
-			listeners.get(i).historyUpdated();
-		}
+		for (HelpHistoryModelListener listener : listeners)
+			listener.historyUpdated();
 	} //}}}
 
 	//{{{ Private members
diff --git a/org/gjt/sp/jedit/help/HelpIndex.java b/org/gjt/sp/jedit/help/HelpIndex.java
index c3a9b82..f26657a 100644
--- a/org/gjt/sp/jedit/help/HelpIndex.java
+++ b/org/gjt/sp/jedit/help/HelpIndex.java
@@ -101,17 +101,16 @@ class HelpIndex
 		}
 
 		PluginJAR[] jars = jEdit.getPluginJARs();
-		for(int i = 0; i < jars.length; i++)
+		for (PluginJAR jar : jars)
 		{
 			try
 			{
-				indexJAR(jars[i].getZipFile());
+				indexJAR(jar.getZipFile());
 			}
-			catch(Throwable e)
+			catch (Throwable e)
 			{
-				Log.log(Log.ERROR,this,"Error indexing JAR: "
-					+ jars[i].getPath());
-				Log.log(Log.ERROR,this,e);
+				Log.log(Log.ERROR, this, "Error indexing JAR: " + jar.getPath());
+				Log.log(Log.ERROR, this, e);
 			}
 		}
 
@@ -128,10 +127,8 @@ class HelpIndex
 		String[] files = VFSManager.getFileVFS()
 			._listDirectory(null,dir,"*.{html,txt}",true,null);
 
-		for(int i = 0; i < files.length; i++)
-		{
-			indexURL(files[i]);
-		}
+		for (String file : files)
+			indexURL(file);
 	} //}}}
 
 	//{{{ indexJAR() method
@@ -147,7 +144,7 @@ class HelpIndex
 			ZipEntry entry = (ZipEntry)e.nextElement();
 			String name = entry.getName();
 			String lname = name.toLowerCase();
-			if(lname.endsWith(".html")/*  || lname.endsWith(".txt") */)
+			if(lname.endsWith(".html") || lname.endsWith(".txt") )
 			{
 				// only works for jEdit plugins
 				String url = "jeditresource:/" +
@@ -165,20 +162,19 @@ class HelpIndex
 	 * index.
 	 * @param url The HTML file's URL
 	 */
-	public void indexURL(String url) throws Exception
+	public void indexURL(String path) throws Exception
 	{
-		InputStream _in;
-
-		if(MiscUtilities.isURL(url))
-			_in =  new URL(url).openStream();
-		else
+		URL url;		
+		if (MiscUtilities.isURL(path))
+			url = new URL(path);
+		else 
 		{
-			_in = new FileInputStream(url);
-			// hack since HelpViewer needs a URL...
-			url = "file:" + url;
+			File f = new File(path);
+			url = f.toURI().toURL();
 		}
-
-		indexStream(_in,url);
+		InputStream _in;
+		_in =  url.openStream();
+		indexStream(_in, url.toString());
 	} //}}}
 
 	//{{{ lookupWord() method
diff --git a/org/gjt/sp/jedit/help/HelpTOCPanel.java b/org/gjt/sp/jedit/help/HelpTOCPanel.java
index ff2c099..327695f 100644
--- a/org/gjt/sp/jedit/help/HelpTOCPanel.java
+++ b/org/gjt/sp/jedit/help/HelpTOCPanel.java
@@ -175,21 +175,16 @@ public class HelpTOCPanel extends JPanel
 		DefaultMutableTreeNode pluginTree = new DefaultMutableTreeNode(
 			jEdit.getProperty("helpviewer.toc.plugins"),true);
 
-		for(int i = 0; i < plugins.length; i++)
+		for (EditPlugin plugin : plugins)
 		{
-			EditPlugin plugin = plugins[i];
-
 			String name = plugin.getClassName();
 
 			String docs = jEdit.getProperty("plugin." + name + ".docs");
 			String label = jEdit.getProperty("plugin." + name + ".name");
-			if(label != null && docs != null)
+			if (label != null && docs != null)
 			{
-				String path = plugin.getPluginJAR()
-					.getClassLoader()
-					.getResourceAsPath(docs);
-				pluginTree.add(createNode(
-					path,label));
+				String path = plugin.getPluginJAR().getClassLoader().getResourceAsPath(docs);
+				pluginTree.add(createNode(path, label));
 			}
 		}
 
diff --git a/org/gjt/sp/jedit/help/HelpViewer.java b/org/gjt/sp/jedit/help/HelpViewer.java
index eaaa9e9..047106e 100644
--- a/org/gjt/sp/jedit/help/HelpViewer.java
+++ b/org/gjt/sp/jedit/help/HelpViewer.java
@@ -27,12 +27,18 @@ import java.awt.BorderLayout;
 import java.awt.Component;
 import java.awt.Cursor;
 import java.awt.Dimension;
+import java.awt.Toolkit;
 
 import java.awt.EventQueue;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.awt.event.KeyAdapter;
 import java.awt.event.KeyEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+
+
+import java.awt.datatransfer.StringSelection;
 
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
@@ -48,7 +54,9 @@ import javax.swing.BoxLayout;
 import javax.swing.JEditorPane;
 import javax.swing.JFrame;
 import javax.swing.JLabel;
+import javax.swing.JMenuItem;
 import javax.swing.JPanel;
+import javax.swing.JPopupMenu;
 import javax.swing.JScrollBar;
 import javax.swing.JScrollPane;
 import javax.swing.JSplitPane;
@@ -60,6 +68,10 @@ import javax.swing.event.HyperlinkListener;
 
 import javax.swing.text.html.HTMLDocument;
 import javax.swing.text.html.HTMLFrameHyperlinkEvent;
+import javax.swing.text.html.HTML;
+
+import javax.swing.text.AttributeSet;
+import javax.swing.text.Element;
 
 import org.gjt.sp.jedit.EditBus;
 import org.gjt.sp.jedit.GUIUtilities;
@@ -78,10 +90,12 @@ import static org.gjt.sp.jedit.help.HelpHistoryModel.HistoryEntry;
  * jEdit's searchable help viewer. It uses a Swing JEditorPane to display the HTML,
  * and implements a URL history.
  * @author Slava Pestov
- * @version $Id: HelpViewer.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: HelpViewer.java 23463 2014-04-07 19:33:50Z kerik-sf $
  */
 public class HelpViewer extends JFrame implements HelpViewerInterface, HelpHistoryModelListener
 {
+	private static final long serialVersionUID = 1L;
+
 	//{{{ HelpViewer constructor
 	/**
 	 * Creates a new help viewer with the default help page.
@@ -116,7 +130,7 @@ public class HelpViewer extends JFrame implements HelpViewerInterface, HelpHisto
 		try
 		{
 			baseURL = new File(MiscUtilities.constructPath(
-				jEdit.getJEditHome(),"doc")).toURL().toString();
+				jEdit.getJEditHome(),"doc")).toURI().toURL().toString();
 		}
 		catch(MalformedURLException mu)
 		{
@@ -160,6 +174,7 @@ public class HelpViewer extends JFrame implements HelpViewerInterface, HelpHisto
 		viewer.setFont(jEdit.getFontProperty("helpviewer.font"));
 		viewer.addPropertyChangeListener(new PropertyChangeHandler());
 		viewer.addKeyListener(new KeyHandler());
+		viewer.addMouseListener(new MouseHandler());
 
 		viewerScrollPane = new JScrollPane(viewer);
 
@@ -572,9 +587,76 @@ public class HelpViewer extends JFrame implements HelpViewerInterface, HelpHisto
 				scrollBar.setValue(scrollBar.getValue()+scrollBar.getUnitIncrement(1));
 				ke.consume();
 				break;
+			case KeyEvent.VK_HOME:
+				scrollBar = viewerScrollPane.getHorizontalScrollBar();
+				scrollBar.setValue(0);
+				scrollBar = viewerScrollPane.getVerticalScrollBar();
+				scrollBar.setValue(0);
+				ke.consume();
+				break;
+			case KeyEvent.VK_END:
+				scrollBar = viewerScrollPane.getHorizontalScrollBar();
+				scrollBar.setValue(scrollBar.getMaximum());
+				scrollBar = viewerScrollPane.getVerticalScrollBar();
+				scrollBar.setValue(scrollBar.getMaximum());
+				ke.consume();
+				break;
 			}
 		}
 	} //}}}
 
+	//{{{ MouseHandler class
+	private class MouseHandler extends MouseAdapter
+	{
+		@Override
+		public void mousePressed(MouseEvent me)
+		{
+			if(me.isPopupTrigger())
+			{
+				handlePopupTrigger(me);
+			}
+		}
+
+		@Override
+		public void mouseReleased(MouseEvent me)
+		{
+			if(me.isPopupTrigger())
+			{
+				handlePopupTrigger(me);
+			}
+		}
+
+		private void handlePopupTrigger(MouseEvent me)
+		{
+            int caret = viewer.getUI().viewToModel(viewer, me.getPoint());
+            if (caret >= 0 && viewer.getDocument() instanceof HTMLDocument)
+            {
+                HTMLDocument hdoc = (HTMLDocument) viewer.getDocument();
+                Element elem = hdoc.getCharacterElement(caret);
+                if (elem.getAttributes().getAttribute(HTML.Tag.A) != null)
+                {
+                    Object attribute = elem.getAttributes().getAttribute(HTML.Tag.A);
+                    if (attribute instanceof AttributeSet)
+                    {
+                        AttributeSet set = (AttributeSet) attribute;
+                        final String href = (String) set.getAttribute(HTML.Attribute.HREF);
+                        if (href != null)
+                        {
+							JPopupMenu popup = new JPopupMenu();
+							JMenuItem copy = popup.add(jEdit.getProperty("helpviewer.copy-link.label"));
+							copy.addActionListener(new ActionListener(){
+								public void actionPerformed(ActionEvent e)
+								{
+									StringSelection url = new StringSelection(href);
+									Toolkit.getDefaultToolkit().getSystemClipboard().setContents(url, url);
+								}
+							});
+							popup.show(viewer, me.getX(), me.getY());
+                        }
+                    }
+                }
+            }
+		}
+	} //}}}
 	//}}}
 }
diff --git a/org/gjt/sp/jedit/help/HistoryButton.java b/org/gjt/sp/jedit/help/HistoryButton.java
index 18b2bf0..99a9f03 100644
--- a/org/gjt/sp/jedit/help/HistoryButton.java
+++ b/org/gjt/sp/jedit/help/HistoryButton.java
@@ -34,7 +34,7 @@ import javax.swing.event.*;
 /**
  * History Button
  * @author Nicholas O'Leary
- * @version $Id: HistoryButton.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: HistoryButton.java 23221 2013-09-29 20:03:32Z shlomy $
  */
 public class HistoryButton extends JPanel implements ActionListener
 {
@@ -143,12 +143,10 @@ public class HistoryButton extends JPanel implements ActionListener
 				}
 				else
 				{
-					for (int i=0 ; i<urls.length ; i++)
+					for (HelpHistoryModel.HistoryEntry url : urls)
 					{
-						if (urls[i] != null)
-						{
-							historyList.add(new HistoryListActionHandler(urls[i]));
-						}
+						if (url != null)
+							historyList.add(new HistoryListActionHandler(url));
 					}
 				}
 
diff --git a/org/gjt/sp/jedit/icons/splash.png b/org/gjt/sp/jedit/icons/splash.png
index 0d11725..d7c62df 100644
Binary files a/org/gjt/sp/jedit/icons/splash.png and b/org/gjt/sp/jedit/icons/splash.png differ
diff --git a/org/gjt/sp/jedit/icons/themes/classic/loader.gif b/org/gjt/sp/jedit/icons/themes/classic/loader.gif
new file mode 100644
index 0000000..d0bce15
Binary files /dev/null and b/org/gjt/sp/jedit/icons/themes/classic/loader.gif differ
diff --git a/org/gjt/sp/jedit/icons/themes/tango/loader.gif b/org/gjt/sp/jedit/icons/themes/tango/loader.gif
new file mode 100644
index 0000000..d0bce15
Binary files /dev/null and b/org/gjt/sp/jedit/icons/themes/tango/loader.gif differ
diff --git a/org/gjt/sp/jedit/io/FavoritesVFS.java b/org/gjt/sp/jedit/io/FavoritesVFS.java
index ea92325..aaacf46 100644
--- a/org/gjt/sp/jedit/io/FavoritesVFS.java
+++ b/org/gjt/sp/jedit/io/FavoritesVFS.java
@@ -38,7 +38,7 @@ import org.gjt.sp.jedit.*;
  * favorite and clicking 'delete' in the browser just deletes the
  * favorite, and not the directory itself.
  * @author Slava Pestov
- * @version $Id: FavoritesVFS.java 22828 2013-03-05 19:40:05Z ezust $
+ * @version $Id: FavoritesVFS.java 23221 2013-09-29 20:03:32Z shlomy $
  */
 public class FavoritesVFS extends VFS
 {
@@ -122,9 +122,9 @@ public class FavoritesVFS extends VFS
 	public boolean _rename(Object session, String from, String to, Component comp)
 	{
 		VFSFile[] favorites = getFavorites();
-		for (int i = 0; i < favorites.length; i++)
+		for (VFSFile fav : favorites)
 		{
-			Favorite favorite = (Favorite) favorites[i];
+			Favorite favorite = (Favorite) fav;
 			if (favorite.getPath().equals(from))
 			{
 				favorite.label = to;
@@ -195,7 +195,7 @@ public class FavoritesVFS extends VFS
 				String p = favorite.getPath();
 				String l = favorite.getLabel();
 				jEdit.setProperty("vfs.favorite." + i, p);
-				if (p.equals(l) || MiscUtilities.abbreviateView(p).equals(l))
+				if (p.equals(l) || MiscUtilities.abbreviate(p).equals(l))
 					jEdit.unsetProperty("vfs.favorite." + i + ".label");
 				else 
 					jEdit.setProperty("vfs.favorite." + i + ".label", l);
diff --git a/org/gjt/sp/jedit/io/FileRootsVFS.java b/org/gjt/sp/jedit/io/FileRootsVFS.java
index 5149810..86a9d5f 100644
--- a/org/gjt/sp/jedit/io/FileRootsVFS.java
+++ b/org/gjt/sp/jedit/io/FileRootsVFS.java
@@ -36,7 +36,7 @@ import org.gjt.sp.jedit.OperatingSystem;
 /**
  * A VFS that lists local root filesystems.
  * @author Slava Pestov
- * @version $Id: FileRootsVFS.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: FileRootsVFS.java 23221 2013-09-29 20:03:32Z shlomy $
  */
 public class FileRootsVFS extends VFS
 {
@@ -93,11 +93,11 @@ public class FileRootsVFS extends VFS
 
 			roots.add(new File("/"));
 
-			for (int i=0; i<volumes.length; i++)
+			for (File volume : volumes)
 			{
 				// Make sure people don't do stupid things like putting files in /Volumes
-				if (volumes[i].isDirectory())
-					roots.add(volumes[i]);
+				if (volume.isDirectory())
+					roots.add(volume);
 			}
 
 			return roots.toArray(new File[roots.size()]);
diff --git a/org/gjt/sp/jedit/io/FileVFS.java b/org/gjt/sp/jedit/io/FileVFS.java
index 2e5903e..e78ce87 100644
--- a/org/gjt/sp/jedit/io/FileVFS.java
+++ b/org/gjt/sp/jedit/io/FileVFS.java
@@ -29,10 +29,12 @@ import java.io.Closeable;
 
 import javax.swing.filechooser.FileSystemView;
 import javax.swing.*;
+
 import java.awt.Component;
 import java.io.*;
 import java.text.*;
 import java.util.Date;
+
 import org.gjt.sp.jedit.*;
 import org.gjt.sp.util.IOUtilities;
 import org.gjt.sp.util.Log;
@@ -41,7 +43,7 @@ import org.gjt.sp.util.Log;
 /**
  * Local filesystem VFS.
  * @author Slava Pestov
- * @version $Id: FileVFS.java 22774 2013-02-12 06:55:37Z ezust $
+ * @version $Id: FileVFS.java 23336 2013-11-16 12:05:40Z ezust $
  */
 public class FileVFS extends VFS
 {
@@ -55,8 +57,8 @@ public class FileVFS extends VFS
 			| NON_AWT_SESSION_CAP
 			| (OperatingSystem.isCaseInsensitiveFS()
 			? CASE_INSENSITIVE_CAP : 0),
-			new String[] { EA_TYPE, EA_SIZE, EA_STATUS,
-			EA_MODIFIED });
+			new String[] { EA_SIZE, EA_MODIFIED, EA_STATUS,
+			EA_TYPE });
 	} //}}}
 
 	//{{{ getParentOfPath() method
@@ -174,16 +176,12 @@ public class FileVFS extends VFS
 		if (path.exists())
 		{
 			File[] files = path.listFiles();
-			for (int i = 0; i < files.length; i++)
+			for (File file : files)
 			{
-				if (files[i].isDirectory())
-				{
-					recursiveDelete(files[i]);
-				}
+				if (file.isDirectory())
+					recursiveDelete(file);
 				else
-				{
-					files[i].delete();
-				}
+					file.delete();
 			}
 		}
 		return path.delete();
@@ -212,8 +210,7 @@ public class FileVFS extends VFS
 		private File file;
 
 		// use system default short format
-		public static DateFormat DATE_FORMAT
-			= DateFormat.getInstance();
+		public static DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy/MM/dd HH:mm");
 
 		private long modified;
 
@@ -322,6 +319,7 @@ public class FileVFS extends VFS
 		} //}}}
 
 		//{{{ getModified() method
+		@Override
 		public long getModified()
 		{
 			fetchAttrs();
diff --git a/org/gjt/sp/jedit/io/VFS.java b/org/gjt/sp/jedit/io/VFS.java
index 3c59213..5b61cc5 100644
--- a/org/gjt/sp/jedit/io/VFS.java
+++ b/org/gjt/sp/jedit/io/VFS.java
@@ -104,7 +104,7 @@ import org.gjt.sp.util.ThreadUtilities;
  * @see VFSManager#getVFSForProtocol(String)
  *
  * @author Slava Pestov
- * @author $Id: VFS.java 22454 2012-11-10 11:15:08Z thomasmey $
+ * @author $Id: VFS.java 23222 2013-09-29 20:43:34Z shlomy $
  */
 public abstract class VFS
 {
@@ -1114,10 +1114,9 @@ public abstract class VFS
 			if(colors == null)
 				loadColors();
 
-			for(int i = 0; i < colors.size(); i++)
+			for (ColorEntry entry : colors)
 			{
-				ColorEntry entry = colors.get(i);
-				if(entry.re.matcher(name).matches())
+				if (entry.re.matcher(name).matches())
 					return entry.color;
 			}
 
diff --git a/org/gjt/sp/jedit/io/VFSFile.java b/org/gjt/sp/jedit/io/VFSFile.java
index 7950fb2..8b0924c 100644
--- a/org/gjt/sp/jedit/io/VFSFile.java
+++ b/org/gjt/sp/jedit/io/VFSFile.java
@@ -480,4 +480,14 @@ public class VFSFile implements Serializable
 
 	/** This is true if the attributes are already fetched. */
 	private boolean fetchedAttrs;
+	
+	/**
+	 * return file modified date, this function simply return 0,
+	 * VFS implementation should overwrite this to return the 
+	 * real modified data 
+	 */
+	public long getModified()
+	{
+		return 0;
+	}
 }
diff --git a/org/gjt/sp/jedit/io/VFSManager.java b/org/gjt/sp/jedit/io/VFSManager.java
index 97a1cd8..6512b1a 100644
--- a/org/gjt/sp/jedit/io/VFSManager.java
+++ b/org/gjt/sp/jedit/io/VFSManager.java
@@ -55,7 +55,7 @@ import org.gjt.sp.util.StandardUtilities;
  * {@link #waitForRequests()}.
  *
  * @author Slava Pestov
- * @version $Id: VFSManager.java 22943 2013-04-22 11:44:40Z thomasmey $
+ * @version $Id: VFSManager.java 23222 2013-09-29 20:43:34Z shlomy $
  */
 public class VFSManager
 {
@@ -151,12 +151,7 @@ public class VFSManager
 		List<String> returnValue = new LinkedList<String>();
 		String[] newAPI = ServiceManager.getServiceNames(SERVICE);
 		if(newAPI != null)
-		{
-			for(int i = 0; i < newAPI.length; i++)
-			{
-				returnValue.add(newAPI[i]);
-			}
-		}
+			Collections.addAll(returnValue, newAPI);
 		return returnValue.toArray(new String[returnValue.size()]);
 	} //}}}
 
@@ -172,7 +167,7 @@ public class VFSManager
 	 */
 	public static void waitForRequests()
 	{
-		if(EventQueue.isDispatchThread() != true)
+		if(!EventQueue.isDispatchThread())
 			throw new IllegalStateException();
 
 		TaskManager.instance.waitForIoTasks();
@@ -324,10 +319,9 @@ public class VFSManager
 
 			synchronized(vfsUpdateLock)
 			{
-				for(int i = 0; i < vfsUpdates.size(); i++)
+				for (VFSUpdate msg : vfsUpdates)
 				{
-					VFSUpdate msg = vfsUpdates.get(i);
-					if(msg.getPath().equals(path))
+					if (msg.getPath().equals(path))
 					{
 						// don't send two updates
 						// for the same path
@@ -363,10 +357,8 @@ public class VFSManager
 				Collections.sort(vfsUpdates,
 					new StandardUtilities.StringCompare<VFSUpdate>()
 				);
-				for(int i = 0; i < vfsUpdates.size(); i++)
-				{
-					EditBus.send(vfsUpdates.get(i));
-				}
+				for (VFSUpdate vfsUpdate : vfsUpdates)
+					EditBus.send(vfsUpdate);
 
 				vfsUpdates.clear();
 			}
diff --git a/org/gjt/sp/jedit/jEdit.java b/org/gjt/sp/jedit/jEdit.java
index 6903a95..eb76c87 100644
--- a/org/gjt/sp/jedit/jEdit.java
+++ b/org/gjt/sp/jedit/jEdit.java
@@ -50,6 +50,7 @@ import java.net.*;
 import java.text.MessageFormat;
 import java.util.*;
 import java.util.List;
+import java.lang.reflect.InvocationTargetException;
 
 import org.xml.sax.SAXParseException;
 
@@ -83,7 +84,7 @@ import org.gjt.sp.util.SyntaxUtilities;
 /**
  * The main class of the jEdit text editor.
  * @author Slava Pestov
- * @version $Id: jEdit.java 23090 2013-07-28 17:02:35Z Vampire0 $
+ * @version $Id: jEdit.java 23842 2015-02-02 01:11:51Z elberry $
  */
 public class jEdit
 {
@@ -104,7 +105,7 @@ public class jEdit
 	public static String getBuild()
 	{
 		// (major).(minor).(<99 = preX, 99 = "final").(bug fix)
-		return "05.01.99.00";
+		return "05.02.99.00";
 	} //}}}
 
 	//{{{ main() method
@@ -116,13 +117,13 @@ public class jEdit
 	public static void main(String[] args)
 	{
 		StringList slargs = new StringList(args);
-		//{{{ Check for Java 1.6 or later
+		//{{{ Check for Java 1.7 or later
 		String javaVersion = System.getProperty("java.version");
-		if(javaVersion.compareTo("1.6") < 0)
+		if(javaVersion.compareTo("1.7") < 0)
 		{
 			System.err.println("You are running Java version "
 				+ javaVersion + '.');
-			System.err.println("jEdit requires Java 1.6 or later.");
+			System.err.println("jEdit requires Java 1.7 or later.");
 			System.exit(1);
 		} //}}}
 
@@ -379,14 +380,6 @@ public class jEdit
 			System.exit(0);
 		} //}}}
 
-		// This must be done before anything graphical is displayed, so we can't even
-		// wait for the settings to be loaded, because the splash screen will already
-		// be visible
-		if (OperatingSystem.isMacOS() && !new File(settingsDirectory, "noquartz").exists())
-		{
-			System.setProperty("apple.awt.graphics.UseQuartz", "true");
-		}
-
 		// don't show splash screen if there is a file named
 		// 'nosplash' in the settings directory
 		logTime("before splash screen activation");
@@ -1060,7 +1053,14 @@ public class jEdit
 
 		if (getBooleanProperty("systrayicon"))
 		{
-			JTrayIconManager.addTrayIcon();
+			EventQueue.invokeLater(new Runnable()
+			{
+				@Override
+				public void run()
+				{
+					JTrayIconManager.addTrayIcon();
+				}
+			});
 		}
 		else
 		{
@@ -1269,14 +1269,13 @@ public class jEdit
 		if(plugins == null)
 			return;
 
-		for(int i = 0; i < plugins.length; i++)
+		for (String plugin : plugins)
 		{
-			String plugin = plugins[i];
-			if(!plugin.toLowerCase().endsWith(".jar"))
+			if (!plugin.toLowerCase().endsWith(".jar"))
 				continue;
 
-			String path = MiscUtilities.constructPath(directory,plugin);
-			if (jEdit.getBooleanProperty("plugin-blacklist."+plugin))
+			String path = MiscUtilities.constructPath(directory, plugin);
+			if (jEdit.getBooleanProperty("plugin-blacklist." + plugin))
 				continue;
 
 			addPluginJAR(path);
@@ -1512,21 +1511,20 @@ public class jEdit
 		Buffer retVal = null;
 		Buffer lastBuffer = null;
 
-		for(int i = 0; i < args.length; i++)
+		for (String arg : args)
 		{
-			String arg = args[i];
-			if(arg == null)
+			if (arg == null)
 				continue;
-			else if(arg.startsWith("+line:") || arg.startsWith("+marker:"))
+			else if (arg.startsWith("+line:") || arg.startsWith("+marker:"))
 			{
-				if(lastBuffer != null)
-					gotoMarker(view,lastBuffer,arg);
+				if (lastBuffer != null)
+					gotoMarker(view, lastBuffer, arg);
 				continue;
 			}
 
-			lastBuffer = openFile((View)null,parent,arg,false,null);
+			lastBuffer = openFile((View) null, parent, arg, false, null);
 
-			if(retVal == null && lastBuffer != null)
+			if (retVal == null && lastBuffer != null)
 				retVal = lastBuffer;
 		}
 
@@ -2236,13 +2234,11 @@ public class jEdit
 		// save caret info. Buffer.load() will load it.
 		visit(new SaveCaretInfoVisitor());
 
-
-		for(int i = 0; i < buffers.length; i++)
+		for (Buffer buffer : buffers)
 		{
-			Buffer buffer = buffers[i];
 			if (buffer.isUntitled())
 				continue;
-			buffer.load(view,true);
+			buffer.load(view, true);
 		}
 	} //}}}
 
@@ -2972,11 +2968,8 @@ public class jEdit
 
 			// Stop all plugins
 			PluginJAR[] plugins = getPluginJARs();
-			for(int i = 0; i < plugins.length; i++)
-			{
-				removePluginJAR(plugins[i],true);
-			}
-
+			for (PluginJAR plugin : plugins)
+				removePluginJAR(plugin, true);
 
 			// Save settings
 			saveSettings();
@@ -3620,30 +3613,26 @@ public class jEdit
 		Arrays.sort(snippets,
 			new StandardUtilities.StringCompare<String>(true));
 
-		for (int i = 0; i < snippets.length; ++i)
+		for (String snippet : snippets)
 		{
-			String snippet = snippets[i];
-			if(!snippet.toLowerCase().endsWith(".props"))
+			if (!snippet.toLowerCase().endsWith(".props"))
 				continue;
 
 			try
 			{
-				String path = MiscUtilities.constructPath(
-					siteSettingsDirectory,snippet);
-				Log.log(Log.DEBUG,jEdit.class,
-					"Loading site snippet: " + path);
+				String path = MiscUtilities.constructPath(siteSettingsDirectory, snippet);
+				Log.log(Log.DEBUG, jEdit.class, "Loading site snippet: " + path);
 
 				propMgr.loadSiteProps(new FileInputStream(new File(path)));
 			}
-			catch(FileNotFoundException fnf)
+			catch (FileNotFoundException fnf)
 			{
-				Log.log(Log.DEBUG,jEdit.class,fnf);
+				Log.log(Log.DEBUG, jEdit.class, fnf);
 			}
-			catch(IOException e)
+			catch (IOException e)
 			{
-				Log.log(Log.ERROR,jEdit.class,"Cannot load site snippet "
-					+ snippet);
-				Log.log(Log.ERROR,jEdit.class,e);
+				Log.log(Log.ERROR, jEdit.class, "Cannot load site snippet " + snippet);
+				Log.log(Log.ERROR, jEdit.class, e);
 			}
 		}
 	} //}}}
@@ -3689,10 +3678,8 @@ public class jEdit
 		}
 
 		PluginJAR[] jars = getPluginJARs();
-		for(int i = 0; i < jars.length; i++)
-		{
-			jars[i].checkDependencies();
-		}
+		for (PluginJAR jar : jars)
+			jar.checkDependencies();
 	} //}}}
 
 	//{{{ initUserProperties() method
@@ -3787,6 +3774,7 @@ public class jEdit
 	private static void initPLAF()
 	{
 		String lf = getProperty("lookAndFeel");
+		final String sLf = getPLAFClassName(lf);
 		String sLfOld = null;
 		String sLfNew = null;
 		LookAndFeel lfOld = UIManager.getLookAndFeel();
@@ -3794,7 +3782,7 @@ public class jEdit
 			sLfOld = lfOld.getClass().getName();
 
 		// do not change anything if Look and Feel did not change
-		if (isStartupDone() && getPLAFClassName(lf).equals(sLfOld))
+		if (isStartupDone() && sLf.equals(sLfOld))
 		{
 			return;
 		}
@@ -3839,20 +3827,51 @@ public class jEdit
 		KeyboardFocusManager.setCurrentKeyboardFocusManager(
 			new MyFocusManager());
 
-		try
+		// A couple of issues here -- (these are fixed)
+		// First, setLookAndFeel must be called on the EDT. On initial start
+		// up this isn't a problem, but initPLAF is called on propertiesChanged,
+		// which can happen a lot.
+		// Second, this will fail to load the look and feel as set in the
+		// LookAndFeel plugin on initial start up because the plugins haven't
+		// been loaded yet.
+		if (EventQueue.isDispatchThread())
 		{
-			// A couple of issues here --
-			// First, setLookAndFeel must be called on the EDT. On initial start
-			// up this isn't a problem, but initPLAF is called on propertiesChanged,
-			// which can happen a lot.
-			// Second, this will fail to load the look and feel as set in the
-			// LookAndFeel plugin on initial start up because the plugins haven't
-			// been loaded yet.
-			UIManager.setLookAndFeel(getPLAFClassName(lf));
+			try 
+			{
+				UIManager.setLookAndFeel(sLf);
+			}
+			catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) 
+			{
+				// ignored, there really isn't anything to do and this may be
+				// bogus, the lnf may be from the Look And Feel plugin
+			}
 		}
-		catch(Exception e)
+		else 
 		{
-			Log.log(Log.ERROR,jEdit.class,e);
+			try
+			{
+				EventQueue.invokeAndWait(
+					new Runnable()
+					{
+						public void run() 
+						{
+							try
+							{
+								UIManager.setLookAndFeel(sLf);
+							}
+							catch (ClassNotFoundException | IllegalAccessException | InstantiationException | UnsupportedLookAndFeelException e) 
+							{
+								// same as above, there really isn't anything to do and this may be
+								// bogus, the lnf may be from the Look And Feel plugin
+							}
+						}
+					}
+				);
+			}
+			catch (InterruptedException | InvocationTargetException e) 
+			{
+				// don't worry about this one either	
+			}
 		}
 
 		LookAndFeel lfNew = UIManager.getLookAndFeel();
@@ -3865,9 +3884,9 @@ public class jEdit
 				" old=" + sLfOld +
 				" requested=" + lf +
 				" new=" + sLfNew );
-		if (lf == null || !lf.equals(sLfNew))
+		if (!sLf.equals(sLfNew))
 			Log.log(Log.WARNING, jEdit.class,
-				"initPLAF failed to set required l&f");
+				"initPLAF failed to set requested l&f " + lf);
 
 		UIDefaults defaults = UIManager.getDefaults();
 
@@ -3884,16 +3903,15 @@ public class jEdit
 				jEdit.getColorProperty("view.selectionColor"));
 
 			String[] prefixes = { "PasswordField", "TextField", "TextArea", "List", "Table" };
-			for(int i = 0; i < prefixes.length; i++)
+			for (String prefix : prefixes)
 			{
-				String prefix = prefixes[i];
-				defaults.put(prefix + ".foreground",foreground);
-				defaults.put(prefix + ".background",background);
-				defaults.put(prefix + ".disabledForeground",foreground);
-				defaults.put(prefix + ".disabledBackground",background);
-				defaults.put(prefix + ".caretForeground",caretColor);
-				defaults.put(prefix + ".selectionForeground",foreground);
-				defaults.put(prefix + ".selectionBackground",selectionColor);
+				defaults.put(prefix + ".foreground", foreground);
+				defaults.put(prefix + ".background", background);
+				defaults.put(prefix + ".disabledForeground", foreground);
+				defaults.put(prefix + ".disabledBackground", background);
+				defaults.put(prefix + ".caretForeground", caretColor);
+				defaults.put(prefix + ".selectionForeground", foreground);
+				defaults.put(prefix + ".selectionBackground", selectionColor);
 			}
 
 			defaults.put("ComboBox.foreground",foreground);
@@ -4009,25 +4027,20 @@ public class jEdit
 		String defaultEncoding = getProperty("buffer.encoding");
 		setProperty("buffer.encoding", "UTF-8");
 
-		for(int i = 0; i < snippets.length; ++i)
+		for (File snippet : snippets)
 		{
-			File snippet = snippets[i];
-
-			Macros.Handler handler = Macros.getHandlerForPathName(
-				snippet.getPath());
-			if(handler == null)
+			Macros.Handler handler = Macros.getHandlerForPathName(snippet.getPath());
+			if (handler == null)
 				continue;
 
 			try
 			{
-				Macros.Macro newMacro = handler.createMacro(
-					snippet.getName(),
-					snippet.getPath());
-				handler.runMacro(null,newMacro,false);
+				Macros.Macro newMacro = handler.createMacro(snippet.getName(), snippet.getPath());
+				handler.runMacro(null, newMacro, false);
 			}
-			catch(Exception e)
+			catch (Exception e)
 			{
-				Log.log(Log.ERROR,jEdit.class,e);
+				Log.log(Log.ERROR, jEdit.class, e);
 			}
 		}
 
@@ -4239,22 +4252,21 @@ public class jEdit
 	private static void getNotLoadedPluginJARs(Collection<String> returnValue,
 		String dir, String[] list)
 	{
-loop:	for(int i = 0; i < list.length; i++)
+loop:
+		for (String name : list)
 		{
-			String name = list[i];
-			if(!name.toLowerCase().endsWith(".jar"))
+			if (!name.toLowerCase().endsWith(".jar"))
 				continue loop;
 
-			String path = MiscUtilities.constructPath(dir,name);
+			String path = MiscUtilities.constructPath(dir, name);
 
-			for(int j = 0; j < jars.size(); j++)
+			for (int j = 0; j < jars.size(); j++)
 			{
 				PluginJAR jar = jars.elementAt(j);
 				String jarPath = jar.getPath();
 
-				if (path.equals(jarPath) ||
-					name.equals(MiscUtilities.getFileName(jarPath)) &&
-					!new File(jarPath).exists())
+				if (path.equals(jarPath)
+				    || name.equals(MiscUtilities.getFileName(jarPath)) && !new File(jarPath).exists())
 					continue loop;
 			}
 
@@ -4574,10 +4586,8 @@ loop:	for(int i = 0; i < list.length; i++)
 		inputHandler.removeAllKeyBindings();
 
 		ActionSet[] actionSets = getActionSets();
-		for (int i = 0; i < actionSets.length; i++)
-		{
-			actionSets[i].initKeyBindings();
-		}
+		for (ActionSet actionSet : actionSets)
+			actionSet.initKeyBindings();
 	} //}}}
 
 	//{{{ composeBufferPropsFromHistory() method
diff --git a/org/gjt/sp/jedit/jedit.props b/org/gjt/sp/jedit/jedit.props
index 2a18511..b084b44 100644
--- a/org/gjt/sp/jedit/jedit.props
+++ b/org/gjt/sp/jedit/jedit.props
@@ -1,6 +1,6 @@
 ###
 ### jEdit global properties
-### :tabSize=8:indentSize=8:noTabs=false:
+### :tabSize=4:indentSize=4:noTabs=false:
 ### :folding=explicit:collapseFolds=1:
 ### :encoding=UTF-8:
 ###
@@ -24,7 +24,7 @@ metal.secondary.fontsize=12
 metal.secondary.fontstyle=0
 #}}}
 
-# Decorate frames and dialogs using Swing L&F? (JDK 1.4 only)
+# Decorate frames and dialogs using Swing L&F?
 decorate.frames=false
 decorate.dialogs=false
 
@@ -64,11 +64,14 @@ persistentMarkers=true
 twoStageSave=true
 
 # Strip trailing EOL
-stripTrailingEOL=true
+stripTrailingEOL=false
 
 # Complete words from all open buffers
 completeFromAllBuffers=false
 
+# Insert a word completion when the corresponding digit is pressed
+insertCompletionWithDigit=true
+
 # Need this so that new files have a trailing EOL
 buffer.trailingEOL=true
 
@@ -159,10 +162,10 @@ largefilemode=ask
 buffer.encodingAutodetect=true
 
 # Tab width
-buffer.tabSize=8
+buffer.tabSize=4
 
 # Indent width
-buffer.indentSize=8
+buffer.indentSize=4
 
 # Automatic indentation
 buffer.autoIndent=full
@@ -396,10 +399,6 @@ view.style.markup=color:#0000ff
 view.style.operator=color:#000000 style:b
 #}}}
 
-# Fancy Java2D stuff
-view.antiAlias=false
-view.fracFontMetrics=false
-
 # Docking and tool bar positioning
 view.docking.alternateLayout=false
 # "alternate" is actually closer to standard location IMHO...
@@ -439,7 +438,7 @@ print.color=false
 # Print tab size
 print.tabSize=2
 
-# Force JDK 1.3 API even on 1.4
+# Use old (JDK 1.3) printing API
 print.force13=false
 
 # Force use of glyph vectors to work around spacing problems
diff --git a/org/gjt/sp/jedit/jedit_gui.props b/org/gjt/sp/jedit/jedit_gui.props
index 7ef02ed..5c960e1 100644
--- a/org/gjt/sp/jedit/jedit_gui.props
+++ b/org/gjt/sp/jedit/jedit_gui.props
@@ -1,6 +1,6 @@
 ###
 ### jEdit user interface definitions,
-### :tabSize=8:indentSize=8:noTabs=false:
+### :tabSize=4:indentSize=4:noTabs=false:
 ### :folding=explicit:collapseFolds=1:
 ### :encoding=UTF-8:
 ###
@@ -574,6 +574,7 @@ about.text.contributors=Slava Pestov\n\
 	Ben Glazer\n\
 	Ben Sarsgard\n\
 	Ben Williams\n\
+	Benjamin Zengin\n\
 	Bernhard Walle\n\
 	Bertalan Fodor\n\
 	Bill McMilleon\n\
@@ -757,7 +758,8 @@ about.text.contributors=Slava Pestov\n\
 	Will Varfar\n\
 	Wiktor Adamski\n\
 	Wojciech Stryjewski\n\
-	Wolfgang Chico-Töpfer
+	Wolfgang Chico-Töpfer\n\
+	Yihua Zhang
 #}}}
 
 #{{{ Search and replace dialog
@@ -901,6 +903,10 @@ fullScreenIncludesStatus=true
 
 # Enable subpixel antialiasing by default in textarea.
 view.antiAlias=subpixel HRGB
+
+# Fancy Java2D stuff
+view.fracFontMetrics=false
+
 #}}}
 
 #{{{ File System Browser panes
diff --git a/org/gjt/sp/jedit/menu/EnhancedCheckBoxMenuItem.java b/org/gjt/sp/jedit/menu/EnhancedCheckBoxMenuItem.java
index e2727b7..1c28939 100644
--- a/org/gjt/sp/jedit/menu/EnhancedCheckBoxMenuItem.java
+++ b/org/gjt/sp/jedit/menu/EnhancedCheckBoxMenuItem.java
@@ -51,7 +51,7 @@ public class EnhancedCheckBoxMenuItem extends JCheckBoxMenuItem
 	{
 		this.context = context;
 		this.action = action;
-		this.shortcut = GUIUtilities.getShortcutLabel(action);
+		this.shortcut = GUIUtilities.getShortcutLabel(action, true);
 		String toolTip = jEdit.getProperty(action+ ".tooltip");
 		if (toolTip != null) {
 			setToolTipText(toolTip);
diff --git a/org/gjt/sp/jedit/menu/EnhancedMenuItem.java b/org/gjt/sp/jedit/menu/EnhancedMenuItem.java
index 9ac56e8..61e1685 100644
--- a/org/gjt/sp/jedit/menu/EnhancedMenuItem.java
+++ b/org/gjt/sp/jedit/menu/EnhancedMenuItem.java
@@ -49,7 +49,7 @@ public class EnhancedMenuItem extends JMenuItem
 	public EnhancedMenuItem(String label, String action, ActionContext context)
 	{
 		this.action = action;
-		this.shortcut = GUIUtilities.getShortcutLabel(action);
+		this.shortcut = GUIUtilities.getShortcutLabel(action, true);
 		String toolTip = jEdit.getProperty(action+ ".tooltip");
 		if (toolTip != null) {
 			setToolTipText(toolTip);
diff --git a/org/gjt/sp/jedit/menu/FavoritesProvider.java b/org/gjt/sp/jedit/menu/FavoritesProvider.java
index bc74032..76ae671 100644
--- a/org/gjt/sp/jedit/menu/FavoritesProvider.java
+++ b/org/gjt/sp/jedit/menu/FavoritesProvider.java
@@ -79,23 +79,16 @@ public class FavoritesProvider implements DynamicMenuProvider
 				new VFS.DirectoryEntryCompare(
 				jEdit.getBooleanProperty("vfs.browser.sortMixFilesAndDirs"),
 				jEdit.getBooleanProperty("vfs.browser.sortIgnoreCase")));
-			for(int i = 0; i < favorites.length; i++)
+			for (VFSFile fav : favorites)
 			{
-				FavoritesVFS.Favorite favorite = (FavoritesVFS.Favorite) favorites[i];
-				JMenuItem mi = new JMenuItem(
-					favorite.getLabel());
+				FavoritesVFS.Favorite favorite = (FavoritesVFS.Favorite) fav;
+				JMenuItem mi = new JMenuItem(favorite.getLabel());
 				mi.setActionCommand(favorite.getPath());
-				mi.setIcon(FileCellRenderer
-					.getIconForFile(
-					favorite,false));
-				if(favorite.getType() == VFSFile.FILE)
-				{
+				mi.setIcon(FileCellRenderer.getIconForFile(favorite, false));
+				if (favorite.getType() == VFSFile.FILE)
 					mi.addActionListener(fileListener);
-				}
 				else
-				{
 					mi.addActionListener(dirListener);
-				}
 				menu.add(mi);
 			}
 		}
diff --git a/org/gjt/sp/jedit/menu/MacrosProvider.java b/org/gjt/sp/jedit/menu/MacrosProvider.java
index 71486ce..7266cf5 100644
--- a/org/gjt/sp/jedit/menu/MacrosProvider.java
+++ b/org/gjt/sp/jedit/menu/MacrosProvider.java
@@ -93,9 +93,7 @@ public class MacrosProvider implements DynamicMenuProvider
 		if (subMenu != null)
 			menuItems.add(subMenu);
 
-		for(int i = 0; i < menuItems.size(); i++)
-		{
-			menu.add(menuItems.get(i));
-		}
+		for (JMenuItem menuItem : menuItems)
+			menu.add(menuItem);
 	} //}}}
 }
diff --git a/org/gjt/sp/jedit/menu/PluginsProvider.java b/org/gjt/sp/jedit/menu/PluginsProvider.java
index 1134d26..83d8f22 100644
--- a/org/gjt/sp/jedit/menu/PluginsProvider.java
+++ b/org/gjt/sp/jedit/menu/PluginsProvider.java
@@ -49,17 +49,16 @@ public class PluginsProvider implements DynamicMenuProvider
 		}
 
 		PluginJAR[] pluginArray = jEdit.getPluginJARs();
-		for(int i = 0; i < pluginArray.length; i++)
+		for (PluginJAR jar : pluginArray)
 		{
-			PluginJAR jar = pluginArray[i];
 			EditPlugin plugin = jar.getPlugin();
-			if(plugin == null)
+			if (plugin == null)
 				continue;
 
 			JMenuItem menuItem = plugin.createMenuItems();
-			if(menuItem != null)
+			if (menuItem != null)
 			{
-				addToLetterMap(letters,menuItem);
+				addToLetterMap(letters, menuItem);
 				count++;
 			}
 		}
@@ -74,24 +73,18 @@ public class PluginsProvider implements DynamicMenuProvider
 		}
 
 		// Sort each letter
-		for(int i = 0; i < letters.length; i++)
-		{
-			Collections.sort(letters[i],new MenuItemTextComparator());
-		}
+		for (List<JMenuItem> letter1 : letters)
+			Collections.sort(letter1, new MenuItemTextComparator());
 
 		int maxItems = jEdit.getIntegerProperty("menu.spillover",20);
 
 		// if less than 20 items, put them directly in the menu
 		if(count <= maxItems)
 		{
-			for(int i = 0; i < letters.length; i++)
+			for (List<JMenuItem> items : letters)
 			{
-				Iterator<JMenuItem> iter
-					= letters[i].iterator();
-				while(iter.hasNext())
-				{
-					menu.add(iter.next());
-				}
+				for (JMenuItem item : items)
+					menu.add(item);
 			}
 
 			return;
@@ -119,15 +112,14 @@ public class PluginsProvider implements DynamicMenuProvider
 				submenu = null;
 			}
 
-			Iterator<JMenuItem> iter = letter.iterator();
-			while(iter.hasNext())
+			for (JMenuItem item : letter)
 			{
-				if(submenu == null)
+				if (submenu == null)
 				{
 					submenu = new JMenu();
 					menu.add(submenu);
 				}
-				submenu.add(iter.next());
+				submenu.add(item);
 			}
 
 			count += letter.size();
diff --git a/org/gjt/sp/jedit/msg/PluginUpdate.java b/org/gjt/sp/jedit/msg/PluginUpdate.java
index 19264bc..3fd1e6a 100644
--- a/org/gjt/sp/jedit/msg/PluginUpdate.java
+++ b/org/gjt/sp/jedit/msg/PluginUpdate.java
@@ -22,12 +22,15 @@
 
 package org.gjt.sp.jedit.msg;
 
+import java.io.File;
+import javax.annotation.Nullable;
+
 import org.gjt.sp.jedit.*;
 
 /**
  * Message sent when plugins are loaded and unloaded.
  * @author Slava Pestov
- * @version $Id: PluginUpdate.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: PluginUpdate.java 23320 2013-11-07 11:01:28Z kpouer $
  *
  * @since jEdit 4.2pre1
  */
@@ -60,8 +63,14 @@ public class PluginUpdate extends EBMessage
 	 * @since jEdit 4.2pre1
 	 */
 	public static final Object UNLOADED = "UNLOADED";
-	//}}}
 
+	/**
+	 * Plugin removed, as in deleted from disk.
+	 * @since jEdit 5.2
+	 */
+	public static final Object REMOVED = "REMOVED";
+	//}}}
+	
 	//{{{ PluginUpdate constructor
 	/**
 	 * Creates a new plugin update message.
@@ -74,6 +83,11 @@ public class PluginUpdate extends EBMessage
 	{
 		super(jar);
 
+		if (jar == null) {
+			throw new IllegalArgumentException("PluginJAR may not be null.");	
+		}
+		this.jar = jar;
+		
 		if(what == null)
 			throw new NullPointerException("What must be non-null");
 
@@ -87,6 +101,27 @@ public class PluginUpdate extends EBMessage
 		this.exit = exit;
 	} //}}}
 
+	//{{{ PluginUpdate constructor
+	/**
+	 * Creates a new plugin update message. This constructor should be used
+	 * when the plugin is being removed and the PluginJAR is no longer available.
+	 * @param file The file representing the plugin
+	 * @param what What happened
+	 * @param exit Is the editor exiting?
+	 * @since jEdit 4.2pre3
+	 */
+	public PluginUpdate(File file, Object what, boolean exit)
+	{
+		super(file);
+		this.file = file;
+		
+		if(what == null)
+			throw new NullPointerException("What must be non-null");
+
+		this.what = what;
+		this.exit = exit;
+	} //}}}
+
 	//{{{ getWhat() method
 	/**
 	 * Returns what caused this plugin update.
@@ -111,10 +146,21 @@ public class PluginUpdate extends EBMessage
 	//{{{ getPluginJAR() method
 	/**
 	 * Returns the plugin involved.
+	 * It might be null when the plugin is removed
 	 */
+	@Nullable
 	public PluginJAR getPluginJAR()
 	{
-		return (PluginJAR)getSource();
+		return jar;
+	} //}}}
+
+	//{{{ getFile() method
+	/**
+	 * Returns the file representing the plugin involved.
+	 */
+	public File getFile()
+	{
+		return file;
 	} //}}}
 
 	//{{{ getPluginVersion() method
@@ -137,6 +183,8 @@ public class PluginUpdate extends EBMessage
 	} //}}}
 
 	//{{{ Private members
+	private PluginJAR jar = null;
+	private File file = null;
 	private Object what;
 	private boolean exit;
 	private String version;
diff --git a/org/gjt/sp/jedit/options/AbbrevsOptionPane.java b/org/gjt/sp/jedit/options/AbbrevsOptionPane.java
index fd56c6c..319cb36 100644
--- a/org/gjt/sp/jedit/options/AbbrevsOptionPane.java
+++ b/org/gjt/sp/jedit/options/AbbrevsOptionPane.java
@@ -41,7 +41,7 @@ import org.gjt.sp.util.StandardUtilities;
 /**
  * Abbrev editor.
  * @author Slava Pestov
- * @version $Id: AbbrevsOptionPane.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: AbbrevsOptionPane.java 23221 2013-09-29 20:03:32Z shlomy $
  */
 public class AbbrevsOptionPane extends AbstractOptionPane
 {
@@ -385,14 +385,10 @@ public class AbbrevsOptionPane extends AbstractOptionPane
 		public Hashtable<String,String> toHashtable()
 		{
 			Hashtable<String,String> hash = new Hashtable<String,String>();
-			for(int i = 0; i < abbrevs.size(); i++)
+			for (Abbrev abbrev : abbrevs)
 			{
-				Abbrev abbrev = abbrevs.get(i);
-				if(abbrev.abbrev.length() > 0
-				   && abbrev.expand.length() > 0)
-				{
-					hash.put(abbrev.abbrev,abbrev.expand);
-				}
+				if (abbrev.abbrev.length() > 0 && abbrev.expand.length() > 0)
+					hash.put(abbrev.abbrev, abbrev.expand);
 			}
 			return hash;
 		} //}}}
diff --git a/org/gjt/sp/jedit/options/EditingOptionPane.java b/org/gjt/sp/jedit/options/EditingOptionPane.java
index cf78e35..51aa372 100644
--- a/org/gjt/sp/jedit/options/EditingOptionPane.java
+++ b/org/gjt/sp/jedit/options/EditingOptionPane.java
@@ -27,6 +27,7 @@ import javax.swing.*;
 
 import java.awt.event.*;
 import java.util.Arrays;
+import java.util.Objects;
 
 import org.gjt.sp.jedit.*;
 import org.gjt.sp.jedit.buffer.FoldHandler;
@@ -35,7 +36,7 @@ import org.gjt.sp.util.StandardUtilities;
 
 /**
  * @author Slava Pestov
- * @version $Id: EditingOptionPane.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: EditingOptionPane.java 23381 2013-12-09 12:43:14Z kpouer $
  */
 public class EditingOptionPane extends AbstractOptionPane
 {
@@ -207,9 +208,9 @@ public class EditingOptionPane extends AbstractOptionPane
 
 		global.save();
 
-		for(int i = 0; i < modeProps.length; i++)
+		for (ModeProperties modeProp : modeProps)
 		{
-			modeProps[i].save();
+			modeProp.save();
 		}
 
 		if (fullSyntaxLargeFileMode.isSelected())
@@ -489,10 +490,8 @@ public class EditingOptionPane extends AbstractOptionPane
 					jEdit.resetProperty(prefix + "autoIndent");
 					jEdit.resetProperty(prefix + "deepIndent");
 
-					if(!(StandardUtilities.objectsEqual(oldFilenameGlob,
-						mode.getProperty("filenameGlob"))
-						&& StandardUtilities.objectsEqual(oldFirstlineGlob,
-						mode.getProperty("firstlineGlob"))))
+					if(!(Objects.equals(oldFilenameGlob, mode.getProperty("filenameGlob"))
+						&& Objects.equals(oldFirstlineGlob, mode.getProperty("firstlineGlob"))))
 					{
 						mode.init();
 					}
@@ -504,10 +503,8 @@ public class EditingOptionPane extends AbstractOptionPane
 					jEdit.setProperty(prefix + "filenameGlob",filenameGlob);
 					jEdit.setProperty(prefix + "firstlineGlob",firstlineGlob);
 
-					if(!(StandardUtilities.objectsEqual(oldFilenameGlob,
-						filenameGlob)
-						&& StandardUtilities.objectsEqual(oldFirstlineGlob,
-						firstlineGlob)))
+					if(!(Objects.equals(oldFilenameGlob, filenameGlob) &&
+						 Objects.equals(oldFirstlineGlob, firstlineGlob)))
 					{
 						mode.init();
 					}
diff --git a/org/gjt/sp/jedit/options/IconTheme.java b/org/gjt/sp/jedit/options/IconTheme.java
index 82ec6fe..c030562 100644
--- a/org/gjt/sp/jedit/options/IconTheme.java
+++ b/org/gjt/sp/jedit/options/IconTheme.java
@@ -3,7 +3,7 @@ package org.gjt.sp.jedit.options;
 import org.gjt.sp.jedit.GUIUtilities;
 import org.gjt.sp.jedit.jEdit;
 
-public class IconTheme extends Object
+public class IconTheme
 {
 	static final String[] builtIn  = new String[] { "tango", "classic" };
 	
diff --git a/org/gjt/sp/jedit/options/IntegerInputVerifier.java b/org/gjt/sp/jedit/options/IntegerInputVerifier.java
index 0693bce..29157cb 100644
--- a/org/gjt/sp/jedit/options/IntegerInputVerifier.java
+++ b/org/gjt/sp/jedit/options/IntegerInputVerifier.java
@@ -22,5 +22,5 @@ class IntegerInputVerifier extends InputVerifier
         }
         return (i >= 0);
     }
-};
+}
 
diff --git a/org/gjt/sp/jedit/options/PluginOptions.java b/org/gjt/sp/jedit/options/PluginOptions.java
index bf6c7b4..25f8959 100644
--- a/org/gjt/sp/jedit/options/PluginOptions.java
+++ b/org/gjt/sp/jedit/options/PluginOptions.java
@@ -71,33 +71,24 @@ public class PluginOptions extends OptionsDialog
 
 		// Query plugins for option panes
 		EditPlugin[] plugins = jEdit.getPlugins();
-		for(int i = 0; i < plugins.length; i++)
+		for (EditPlugin ep : plugins)
 		{
-			EditPlugin ep = plugins[i];
-			if(ep instanceof EditPlugin.Broken)
+			if (ep instanceof EditPlugin.Broken)
 				continue;
 
 			String className = ep.getClassName();
 			if (jEdit.getProperty("plugin." + className + ".activate") != null)
 			{
-				String optionPane = jEdit.getProperty(
-					"plugin." + className + ".option-pane");
-				if(optionPane != null)
+				String optionPane = jEdit.getProperty("plugin." + className + ".option-pane");
+				if (optionPane != null)
 					pluginsGroup.addOptionPane(optionPane);
 				else
 				{
-					String options = jEdit.getProperty(
-						"plugin." + className
-						+ ".option-group");
-					if(options != null)
+					String options = jEdit.getProperty("plugin." + className + ".option-group");
+					if (options != null)
 					{
-						pluginsGroup.addOptionGroup(
-							new OptionGroup(
-							"plugin." + className,
-							jEdit.getProperty("plugin."
-							+ className + ".name"),
-							options)
-						);
+						pluginsGroup.addOptionGroup(new OptionGroup("plugin." + className,
+							jEdit.getProperty("plugin." + className + ".name"), options));
 					}
 				}
 			}
diff --git a/org/gjt/sp/jedit/options/ShortcutsOptionPane.java b/org/gjt/sp/jedit/options/ShortcutsOptionPane.java
index 656b42c..53bc7f7 100644
--- a/org/gjt/sp/jedit/options/ShortcutsOptionPane.java
+++ b/org/gjt/sp/jedit/options/ShortcutsOptionPane.java
@@ -49,7 +49,7 @@ import java.util.List;
 /**
  * Key binding editor.
  * @author Slava Pestov
- * @version $Id: ShortcutsOptionPane.java 23082 2013-07-27 16:01:18Z ezust $
+ * @version $Id: ShortcutsOptionPane.java 23224 2013-09-30 20:51:42Z shlomy $
  */
 @SuppressWarnings("serial")
 public class ShortcutsOptionPane extends AbstractOptionPane
@@ -64,7 +64,7 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 	@Override
 	protected void _init()
 	{
-		allBindings = new Vector<KeyBinding>();
+		allBindings = new Vector<>();
 
 		setLayout(new BorderLayout(12, 12));
 
@@ -83,8 +83,8 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 
 		ActionListener actionHandler = new ActionHandler();
 
-		ComboBoxModel model = new KeymapsModel();
-		keymaps = new JComboBox(model);
+		ComboBoxModel<String> model = new KeymapsModel();
+		keymaps = new JComboBox<>(model);
 		keymaps.setRenderer(new KeymapCellRenderer());
 		keymaps.setSelectedItem(keymapName);
 		duplicateKeymap.addActionListener(actionHandler);
@@ -93,19 +93,17 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 		keymaps.addActionListener(actionHandler);
 		keymaps.setSelectedItem(selectedKeymap);
 
-		Box keymapBox = Box.createHorizontalBox();
+		JPanel keymapBox = new JPanel(new FlowLayout(FlowLayout.LEADING));
 		keymapBox.add(new JLabel(jEdit.getProperty(
 			"options.shortcuts.keymap.label")));
-		keymapBox.add(Box.createHorizontalStrut(6));
 		keymapBox.add(keymaps);
 		keymapBox.add(Box.createHorizontalStrut(6));
 		keymapBox.add(duplicateKeymap);
 		keymapBox.add(resetKeymap);
 		keymapBox.add(deleteKeymap);
-		keymapBox.add(Box.createHorizontalGlue());
 
 		// combobox to choose action set
-		selectModel = new JComboBox(models);
+		selectModel = new JComboBox<>(models);
 		selectModel.addActionListener(actionHandler);
 		selectModel.setToolTipText(jEdit.getProperty("options.shortcuts.select.tooltip"));
 		Box north = Box.createHorizontalBox();
@@ -201,11 +199,11 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 	private JButton duplicateKeymap;
 	private JButton resetKeymap;
 	private JButton deleteKeymap;
-	private JComboBox keymaps;
+	private JComboBox<String> keymaps;
 	private JTable keyTable;
 	private Vector<ShortcutsModel> models;
 	private FilteredTableModel<ShortcutsModel> filteredModel;
-	private JComboBox selectModel;
+	private JComboBox<ShortcutsModel> selectModel;
 	private List<KeyBinding> allBindings;
 	private JTextField filterTF;
 
@@ -233,7 +231,7 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 				return name.contains(filter);
 			}
 		};
-		models = new Vector<ShortcutsModel>();
+		models = new Vector<>();
 		reloadModels();
 	} //}}}
 
@@ -242,22 +240,20 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 	{
 		models.clear();
 		allBindings.clear();
-		List<KeyBinding[]> allBindings = new ArrayList<KeyBinding[]>();
-		Collection<String> knownBindings = new HashSet<String>();
+		List<KeyBinding[]> allBindings = new ArrayList<>();
+		Collection<String> knownBindings = new HashSet<>();
 		ActionSet[] actionSets = jEdit.getActionSets();
-		for(int i = 0; i < actionSets.length; i++)
+		for (ActionSet actionSet : actionSets)
 		{
-			ActionSet actionSet = actionSets[i];
-			if(actionSet.getActionCount() != 0)
+			if (actionSet.getActionCount() != 0)
 			{
 				String modelLabel = actionSet.getLabel();
-				if(modelLabel == null)
+				if (modelLabel == null)
 				{
-					Log.log(Log.ERROR,this,"Empty action set: "
-						+ actionSet.getPluginJAR());
+					Log.log(Log.ERROR, this, "Empty action set: " + actionSet.getPluginJAR());
 				}
-				ShortcutsModel model = createModel(actionSet.getLabel(), modelLabel,
-						actionSet.getActionNames());
+				ShortcutsModel model =
+					createModel(actionSet.getLabel(), modelLabel, actionSet.getActionNames());
 				models.add(model);
 				List<KeyBinding[]> bindings = model.getBindings();
 				for (KeyBinding[] binding : bindings)
@@ -298,19 +294,18 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 	//{{{ createModel() method
 	private ShortcutsModel createModel(String actionSet, String modelLabel, String[] actions)
 	{
-		List<GrabKeyDialog.KeyBinding[]> bindings = new ArrayList<GrabKeyDialog.KeyBinding[]>(actions.length);
+		List<KeyBinding[]> bindings = new ArrayList<>(actions.length);
 
-		for(int i = 0; i < actions.length; i++)
+		for (String name : actions)
 		{
-			String name = actions[i];
 			EditAction ea = jEdit.getAction(name);
 			String label = ea.getLabel();
 			// Skip certain actions this way
-			if(label == null)
+			if (label == null)
 				continue;
 
 			label = GUIUtilities.prettifyMenuLabel(label);
-			addBindings(actionSet, name,label,bindings);
+			addBindings(actionSet, name, label, bindings);
 		}
 
 		return new ShortcutsModel(modelLabel,bindings);
@@ -319,7 +314,7 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 	//{{{ addBindings() method
 	private void addBindings(String actionSet, String name, String label, Collection<KeyBinding[]> bindings)
 	{
-		GrabKeyDialog.KeyBinding[] b = new GrabKeyDialog.KeyBinding[2];
+		KeyBinding[] b = new KeyBinding[2];
 
 		b[0] = createBinding(actionSet, name,label,
 			selectedKeymap.getShortcut(name + ".shortcut"));
@@ -330,13 +325,12 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 	} //}}}
 
 	//{{{ createBinding() method
-	private GrabKeyDialog.KeyBinding createBinding(String actionSet, String name, String label, String shortcut)
+	private KeyBinding createBinding(String actionSet, String name, String label, String shortcut)
 	{
-		if(shortcut != null && shortcut.length() == 0)
+		if(shortcut != null && shortcut.isEmpty())
 			shortcut = null;
 
-		GrabKeyDialog.KeyBinding binding
-			= new GrabKeyDialog.KeyBinding(name,label,shortcut,false);
+		KeyBinding binding = new KeyBinding(name,label,shortcut,false);
 
 		binding.actionSet = actionSet;
 		allBindings.add(binding);
@@ -432,7 +426,7 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 										     "options.shortcuts.duplicatekeymap.dialog.label"),
 									     jEdit.getProperty(
 										     "options.shortcuts.duplicatekeymap.dialog.title"),
-									     JOptionPane.OK_CANCEL_OPTION);
+									     JOptionPane.QUESTION_MESSAGE);
 				if (newName == null)
 				{
 					return;
@@ -440,16 +434,14 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 				newName = newName.replace(' ', '_');
 				KeymapManager manager = jEdit.getKeymapManager();
 				Collection<String> keymapNames = manager.getKeymapNames();
-				while (newName != null)
+				while (keymapNames.contains(newName))
 				{
-					if (!keymapNames.contains(newName))
-						break;
 					newName = JOptionPane.showInputDialog(ShortcutsOptionPane.this,
 										     jEdit.getProperty(
 											     "options.shortcuts.duplicatekeymap.keymapalreadyexists.label"),
 										     jEdit.getProperty(
 											     "options.shortcuts.duplicatekeymap.dialog.title"),
-										     JOptionPane.OK_CANCEL_OPTION);
+										     JOptionPane.QUESTION_MESSAGE);
 					if (newName == null)
 					{
 						return;
@@ -504,17 +496,17 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 	private class ShortcutsModel extends AbstractTableModel
 	{
 		public static final String ALL = "All";
-		private final List<GrabKeyDialog.KeyBinding[]> bindings;
+		private final List<KeyBinding[]> bindings;
 		private final String name;
 
-		ShortcutsModel(String name, List<GrabKeyDialog.KeyBinding[]> bindings)
+		ShortcutsModel(String name, List<KeyBinding[]> bindings)
 		{
 			this.name = name;
 			this.bindings = bindings;
 			sort(0);
 		}
 
-		public List<GrabKeyDialog.KeyBinding[]> getBindings()
+		public List<KeyBinding[]> getBindings()
 		{
 			return bindings;
 		}
@@ -543,16 +535,18 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 		{
 			// The only place this gets used is in JTable's own display code, so
 			// we translate the shortcut to platform-specific form for display here.
+			KeyBinding bindingAt = getBindingAt(row, 0);
+			setToolTipText(bindingAt.label);
 			switch(col)
 			{
 			case 0:
-				return getBindingAt(row,0).label;
+				return bindingAt.label;
 			case 1:
-				return GUIUtilities.getPlatformShortcutLabel(getBindingAt(row,0).shortcut);
+				return GUIUtilities.getPlatformShortcutLabel(bindingAt.shortcut);
 			case 2:
 				return GUIUtilities.getPlatformShortcutLabel(getBindingAt(row,1).shortcut);
 			case 3:
-				return getBindingAt(row, 0).actionSet;
+				return bindingAt.actionSet;
 			default:
 				return null;
 			}
@@ -591,7 +585,7 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 
 		public void save()
 		{
-			for (GrabKeyDialog.KeyBinding[] binding : bindings)
+			for (KeyBinding[] binding : bindings)
 			{
 				selectedKeymap.setShortcut(
 					binding[0].name + ".shortcut",
@@ -602,9 +596,9 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 			}
 		}
 
-		public GrabKeyDialog.KeyBinding getBindingAt(int row, int nr)
+		public KeyBinding getBindingAt(int row, int nr)
 		{
-			GrabKeyDialog.KeyBinding[] binding = bindings.get(row);
+			KeyBinding[] binding = bindings.get(row);
 			return binding[nr];
 		}
 
@@ -614,7 +608,7 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 			return name;
 		}
 
-		private class KeyCompare implements Comparator<GrabKeyDialog.KeyBinding[]>
+		private class KeyCompare implements Comparator<KeyBinding[]>
 		{
 			private final int col;
 
@@ -624,7 +618,7 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 			}
 
 			@Override
-			public int compare(GrabKeyDialog.KeyBinding[] k1, GrabKeyDialog.KeyBinding[] k2)
+			public int compare(KeyBinding[] k1, KeyBinding[] k2)
 			{
 				String label1 = k1[0].label.toLowerCase();
 				String label2 = k2[0].label.toLowerCase();
@@ -660,7 +654,7 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 	} //}}}
 
 	//{{{ KeymapsModel class
-	private static class KeymapsModel extends AbstractListModel implements ComboBoxModel
+	private static class KeymapsModel extends AbstractListModel<String> implements ComboBoxModel<String>
 	{
 		private String[] keymaps;
 
@@ -692,7 +686,7 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 
 		//{{{ getElementAt() method
 		@Override
-		public Object getElementAt(int index)
+		public String getElementAt(int index)
 		{
 			return keymaps[index];
 		} //}}}
@@ -730,7 +724,7 @@ public class ShortcutsOptionPane extends AbstractOptionPane
 	private static class KeymapCellRenderer extends DefaultListCellRenderer
 	{
 		@Override
-		public Component getListCellRendererComponent(JList list, Object value, int index,
+		public Component getListCellRendererComponent(JList<?> list, Object value, int index,
 							      boolean isSelected, boolean cellHasFocus)
 		{
 			super.getListCellRendererComponent(list, value, index, isSelected,
diff --git a/org/gjt/sp/jedit/options/SyntaxHiliteOptionPane.java b/org/gjt/sp/jedit/options/SyntaxHiliteOptionPane.java
index 5f51eb8..77b8136 100644
--- a/org/gjt/sp/jedit/options/SyntaxHiliteOptionPane.java
+++ b/org/gjt/sp/jedit/options/SyntaxHiliteOptionPane.java
@@ -42,7 +42,7 @@ import org.gjt.sp.util.StandardUtilities;
 /**
  * Style option pane.
  * @author Slava Pestov
- * @version $Id: SyntaxHiliteOptionPane.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: SyntaxHiliteOptionPane.java 23222 2013-09-29 20:43:34Z shlomy $
  */
 public class SyntaxHiliteOptionPane extends AbstractOptionPane
 {
@@ -217,12 +217,10 @@ public class SyntaxHiliteOptionPane extends AbstractOptionPane
 		//{{{ save() method
 		public void save()
 		{
-			for(int i = 0; i < styleChoices.size(); i++)
+			for (StyleChoice ch : styleChoices)
 			{
-				StyleChoice ch = styleChoices
-					.get(i);
 				jEdit.setProperty(ch.property,
-				                  GUIUtilities.getStyleString(ch.style));
+					GUIUtilities.getStyleString(ch.style));
 			}
 		} //}}}
 
diff --git a/org/gjt/sp/jedit/options/TextAreaOptionPane.java b/org/gjt/sp/jedit/options/TextAreaOptionPane.java
index 03da8c9..7fb0277 100644
--- a/org/gjt/sp/jedit/options/TextAreaOptionPane.java
+++ b/org/gjt/sp/jedit/options/TextAreaOptionPane.java
@@ -40,7 +40,7 @@ import org.gjt.sp.jedit.gui.RolloverButton;
 
 /**
  * @author Slava Pestov
- * @version $Id: TextAreaOptionPane.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: TextAreaOptionPane.java 23058 2013-07-10 01:34:01Z daleanson $
  */
 public class TextAreaOptionPane extends AbstractOptionPane
 {
@@ -241,6 +241,11 @@ public class TextAreaOptionPane extends AbstractOptionPane
 			"options.textarea.completeFromAllBuffers"));
 		completeFromAllBuffers.setSelected(jEdit.getBooleanProperty("completeFromAllBuffers"));
 		addComponent(completeFromAllBuffers);
+		
+		insertCompletionWithDigit = new JCheckBox(jEdit.getProperty(
+			"options.textarea.insertCompletionWithDigit"));
+		insertCompletionWithDigit.setSelected(jEdit.getBooleanProperty("insertCompletionWithDigit"));
+		addComponent(insertCompletionWithDigit);
 	} //}}}
 
 	//{{{ _save() method
@@ -292,6 +297,7 @@ public class TextAreaOptionPane extends AbstractOptionPane
 		jEdit.setBooleanProperty("view.fracFontMetrics",fracFontMetrics.isSelected());
 		jEdit.setBooleanProperty("stripTrailingEOL", stripTrailingEOL.isSelected());
 		jEdit.setBooleanProperty("completeFromAllBuffers", completeFromAllBuffers.isSelected());
+		jEdit.setBooleanProperty("insertCompletionWithDigit", insertCompletionWithDigit.isSelected());
 		jEdit.setIntegerProperty("options.textarea.lineSpacing",
 					 Integer.valueOf(lineSpacing.getText()));
 	} //}}}
@@ -325,6 +331,7 @@ public class TextAreaOptionPane extends AbstractOptionPane
 	private JCheckBox fracFontMetrics;
 	private JCheckBox stripTrailingEOL;
 	private JCheckBox completeFromAllBuffers;
+	private JCheckBox insertCompletionWithDigit;
 	private JTextField lineSpacing;
 	//}}}
 
diff --git a/org/gjt/sp/jedit/options/ToolBarOptionPane.java b/org/gjt/sp/jedit/options/ToolBarOptionPane.java
index 9f2e192..b876103 100644
--- a/org/gjt/sp/jedit/options/ToolBarOptionPane.java
+++ b/org/gjt/sp/jedit/options/ToolBarOptionPane.java
@@ -42,7 +42,7 @@ import org.gjt.sp.util.StandardUtilities;
 /**
  * Tool bar editor.
  * @author Slava Pestov
- * @version $Id: ToolBarOptionPane.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: ToolBarOptionPane.java 23222 2013-09-29 20:43:34Z shlomy $
  */
 public class ToolBarOptionPane extends AbstractOptionPane
 {
@@ -473,16 +473,13 @@ class ToolBarEditDialog extends EnhancedDialog
 		String selectedActionSet = jEdit.getProperty("options.toolbar.selectedActionSet");
 		ActionSet selectedItem = null;
 		Vector<ActionSet> vec = new Vector<ActionSet>(actionsList.length);
-		for(int i = 0; i < actionsList.length; i++)
+		for (ActionSet actionSet : actionsList)
 		{
-			ActionSet actionSet = actionsList[i];
-			if(actionSet.getActionCount() != 0)
+			if (actionSet.getActionCount() != 0)
 			{
 				vec.add(actionSet);
 				if (actionSet.getLabel().equals(selectedActionSet))
-				{
 					selectedItem = actionSet;
-				}
 			}
 		}
 		Collections.sort(vec, new ActionSetCompare());
@@ -705,15 +702,14 @@ class ToolBarEditDialog extends EnhancedDialog
 		EditAction[] actions = actionSet.getActions();
 		Vector<ToolBarOptionPane.Button> listModel = new Vector<ToolBarOptionPane.Button>(actions.length);
 
-		for(int i = 0; i < actions.length; i++)
+		for (EditAction action : actions)
 		{
-			EditAction action = actions[i];
 			String label = action.getLabel();
-			if(label == null)
+			if (label == null)
 				continue;
 
-			listModel.add(new ToolBarOptionPane.Button(
-				action.getName(),null,null,label));
+			listModel.add(new ToolBarOptionPane.Button(action.getName(),
+				null, null, label));
 		}
 
 		Collections.sort(listModel,new ToolBarOptionPane.ButtonCompare());
diff --git a/org/gjt/sp/jedit/pluginmgr/InstallPanel.java b/org/gjt/sp/jedit/pluginmgr/InstallPanel.java
index b43f5dd..5586016 100644
--- a/org/gjt/sp/jedit/pluginmgr/InstallPanel.java
+++ b/org/gjt/sp/jedit/pluginmgr/InstallPanel.java
@@ -3,7 +3,8 @@
  * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
- * Copyright (C) 2002 Kris Kopicki
+ * Copyright (C) 2002-2013 Kris Kopicki, Slava Pestov, Dale Anson,
+ *      Matthieu Casanova, Alan Ezust, Björn "Vampire" Kautler
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -30,6 +31,7 @@ import org.gjt.sp.jedit.io.VFS;
 import org.gjt.sp.jedit.io.VFSManager;
 import org.gjt.sp.util.Log;
 import org.gjt.sp.util.StandardUtilities;
+import org.gjt.sp.util.StringList;
 import org.gjt.sp.util.ThreadUtilities;
 import org.gjt.sp.util.XMLUtilities;
 import org.xml.sax.Attributes;
@@ -52,6 +54,7 @@ import java.awt.*;
 import java.awt.event.*;
 import java.io.File;
 import java.io.InputStream;
+import java.text.MessageFormat;
 import java.text.NumberFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
@@ -60,7 +63,7 @@ import java.util.List;
 //}}}
 
 /**
- * @version $Id: InstallPanel.java 22967 2013-05-06 09:15:44Z kpouer $
+ * @version $Id: InstallPanel.java 23324 2013-11-08 19:10:58Z kerik-sf $
  */
 class InstallPanel extends JPanel implements EBComponent
 {
@@ -521,7 +524,7 @@ class InstallPanel extends JPanel implements EBComponent
 				else
 				{
 					Entry entry = (Entry)filteredEntries.get(i);
-					entry.parents = new LinkedList<Entry>();
+					entry.dependents = new LinkedList<Entry>();
 					entry.install = false;
 				}
 			}
@@ -535,28 +538,40 @@ class InstallPanel extends JPanel implements EBComponent
 			sort(type);
 		} //}}}
 
-		//{{{ deselectParents() method
-		private void deselectParents(Entry entry)
+		//{{{ deselectDependents() method
+		/**
+		 * deselect all plugins depending upon entry after a warning.
+		 * If user cancels, reinstate install field of entry
+		 * @param entry	the entry that would be no more installed
+		 * @return	confirmed that deselection may proceed
+		 */
+		private boolean deselectDependents(Entry entry)
 		{
-			Entry[] parents = entry.getParents();
+			Entry[] dependents = entry.getTransitiveDependents();
 
-			if (parents.length == 0)
-				return;
+			if (dependents.length == 0)
+				return true;
 
 			String[] args = { entry.name };
 			int result = GUIUtilities.listConfirm(
 				window,"plugin-manager.dependency",
-				args,parents);
+				args,dependents);
 			if (result != JOptionPane.OK_OPTION)
 			{
 				entry.install = true;
-				return;
+				return false;
 			}
 
-			for(int i = 0; i < parents.length; i++)
-				 parents[i].install = false;
-
-			fireTableRowsUpdated(0,getRowCount() - 1);
+			for(Entry dependent: dependents)
+			{
+				 dependent.install = false;
+				 dependent.checked = false;
+				 // must setInstall() to remove the
+				 // plugin from its dependencies 'dependents' list
+				 // so that they can be unchecked if no longer required
+				 updateDeps(dependent);
+			}
+			return true;
 		} //}}}
 
 		//{{{ setValueAt() method
@@ -573,58 +588,102 @@ class InstallPanel extends JPanel implements EBComponent
 			boolean before = entry.install;
 			entry.install = Boolean.TRUE.equals(aValue);
 			if (before == entry.install) return;
-			if (!entry.install)
-				deselectParents(entry);
+
+			// deselect after a warning if entry is required
+			// by some other selected plugin.
+			// If the user cancelled, don't proceed
+			if (!entry.install && !deselectDependents(entry))
+			{
+				return;
+			}
+
+			// checked is set after deselectDependents to prevent
+			// override when the user cancelled deselectDependents
+			entry.checked = entry.install;
+
+			updateDeps(entry);
+
+			/* prune entries to install to keep only the entries
+			 * really checked by the user.
+			 * Removes dependencies no longer required and such */
+
+			List<Entry> selected = new ArrayList<Entry>(entries.size());
+			for(Object en: entries)
+			{
+				if(en instanceof Entry)
+				{
+					Entry temp = (Entry)en;
+					if(temp.install)selected.add(temp);
+				}
+			}
+
+			List<Entry> toRemove = new ArrayList<Entry>(selected.size());
+			boolean changed;
+			do{
+				changed = false;
+				for(Entry temp: selected)
+				{
+					temp.dependents.removeAll(toRemove);
+					if(!temp.checked && temp.dependents.isEmpty())
+					{
+						toRemove.add(temp);
+						temp.install = false;
+						changed = true;
+					}
+				}
+				selected.removeAll(toRemove);
+			}while(changed);
+
+			updateFilteredEntries();
+			// make the row selected after updated filtering
+			for(int i=0; i< filteredEntries.size(); i++)
+			{
+				if(entry == filteredEntries.get(i))
+				{
+					table.setRowSelectionInterval(i, i);
+					break;
+				}
+			}
+		} //}}}
+
+		//{{{ updateDeps() method
+		/***
+		 * recursively add dependencies to install,
+		 * or remove entry from its dependencies' dependents list
+		 * @param entry	entry whose install field has been set
+		 */
+		private void updateDeps(Entry entry)
+		{
 
 			List<PluginList.Dependency> deps = entry.plugin.getCompatibleBranch().deps;
 
-			for (int i = 0; i < deps.size(); i++)
+			for (PluginList.Dependency dep: deps)
 			{
-				PluginList.Dependency dep = deps.get(i);
 				if ("plugin".equals(dep.what))
 				{
-					boolean found = false;
-					for (int j = 0; j < filteredEntries.size(); j++)
+					for (Object en: entries)
 					{
-						Entry temp = (Entry)filteredEntries.get(j);
+						Entry temp = (Entry)en;
 						if (temp.plugin == dep.plugin)
 						{
-							found = true;
 							if (entry.install)
 							{
-								temp.parents.add(entry);
-								setValueAt(Boolean.TRUE,j,0);
-							}
-							else
-								temp.parents.remove(entry);
-
-							break;
-						}
-					}
-					if (!found)
-					{
-						// the dependency was not found in the filtered list so we search in
-						// global list.
-						for (int a = 0;a<entries.size();a++)
-						{
-							Entry temp = (Entry) entries.get(a);
-							if (temp.plugin == dep.plugin)
-							{
-								if (entry.install)
+								temp.dependents.add(entry);
+								if(!temp.install)
 								{
-									temp.parents.add(entry);
 									temp.install = true;
+									updateDeps(temp);
 								}
-								else
-									temp.parents.remove(entry);
-								break;
 							}
+							else
+							{
+								temp.dependents.remove(entry);
+							}
+							break;
 						}
 					}
 				}
 			}
-			updateFilteredEntries();
-			table.setRowSelectionInterval(row, row);
 		} //}}}
 
 		//{{{ sort() method
@@ -676,9 +735,8 @@ class InstallPanel extends JPanel implements EBComponent
 
 			entries.clear();
 			
-			for(int i = 0; i < pluginList.pluginSets.size(); i++)
+			for(PluginList.PluginSet set : pluginList.pluginSets)
 			{
-				PluginList.PluginSet set = pluginList.pluginSets.get(i);
 				for(int j = 0; j < set.plugins.size(); j++)
 				{
 					PluginList.Plugin plugin = pluginList.pluginHash.get(set.plugins.get(j));
@@ -722,9 +780,9 @@ class InstallPanel extends JPanel implements EBComponent
 				}
 			}
 			int[] rows = table.getSelectedRows();
-			for (int i=0 ; i<rows.length ; i++)
+			for (int row: rows)
 			{
-				savedSelection.add(filteredEntries.get(rows[i]).toString());
+				savedSelection.add(filteredEntries.get(row).toString());
 			}
 		} //}}}
 
@@ -782,13 +840,14 @@ class InstallPanel extends JPanel implements EBComponent
 	//{{{ Entry class
 	private static class Entry
 	{
-		String name, installedVersion, version, author, date, description, set;
+		String name, installedVersion, version, author, date, description, set, dependencies;
 
 		long timestamp;
 		int size;
+		boolean checked;
 		boolean install;
 		PluginList.Plugin plugin;
-		List<Entry> parents = new LinkedList<Entry>();
+		List<Entry> dependents = new LinkedList<Entry>();
 
 		Entry(PluginList.Plugin plugin, String set)
 		{
@@ -803,8 +862,10 @@ class InstallPanel extends JPanel implements EBComponent
 			this.size = size;
 			this.date = branch.date;
 			this.description = plugin.description;
+			this.dependencies = branch.depsToString();
 			this.set = set;
 			this.install = false;
+			this.checked = false;
 			this.plugin = plugin;
 			SimpleDateFormat format = new SimpleDateFormat("d MMMM yyyy", Locale.ENGLISH);
 			try
@@ -817,22 +878,22 @@ class InstallPanel extends JPanel implements EBComponent
 			}
 		}
 
-		private void getParents(List<Entry> list)
+		private void getTransitiveDependents(List<Entry> list)
 		{
-			for (Entry entry : parents)
+			for (Entry entry : dependents)
 			{
 				if (entry.install && !list.contains(entry))
 				{
 					list.add(entry);
-					entry.getParents(list);
+					entry.getTransitiveDependents(list);
 				}
 			}
 		}
 
-		Entry[] getParents()
+		Entry[] getTransitiveDependents()
 		{
 			List<Entry> list = new ArrayList<Entry>();
-			getParents(list);
+			getTransitiveDependents(list);
 			Entry[] array = list.toArray(new Entry[list.size()]);
 			Arrays.sort(array,new StandardUtilities.StringCompare<Entry>(true));
 			return array;
@@ -851,7 +912,6 @@ class InstallPanel extends JPanel implements EBComponent
 	 */
 	private class PluginInfoBox extends JEditorPane implements ListSelectionListener
 	{
-		private final String[] params;
 		PluginInfoBox()
 		{
 			setBackground(jEdit.getColorProperty("view.bgColor"));
@@ -859,7 +919,6 @@ class InstallPanel extends JPanel implements EBComponent
 			putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, true);
 			setContentType("text/html");
 			setEditable(false);
-			params = new String[3];
 			table.getSelectionModel().addListSelectionListener(this);
 		}
 
@@ -872,11 +931,25 @@ class InstallPanel extends JPanel implements EBComponent
 			{
 				Entry entry = (Entry) pluginModel.filteredEntries
 					.get(table.getSelectedRow());
-				params[0] = entry.author;
-				params[1] = entry.date;
-				params[2] = entry.description;
-				text = jEdit.getProperty("install-plugins.info", params);
-				text = text.replace("\n", "<br>");
+				String pattern = "<b>{0}</b>: {1}<br><b>{2}</b>: {3}<br>{4}<br><br><b>{5}</b>:<br>{6}";
+				List<String> params = new ArrayList<String>();
+				params.add(jEdit.getProperty("install-plugins.info.author", "Author"));
+				params.add(entry.author);
+				params.add(jEdit.getProperty("install-plugins.info.released", "Released"));
+				params.add(entry.date);
+				params.add(entry.description);
+				if (entry.dependencies == null || entry.dependencies.isEmpty())
+				{
+					pattern = "<b>{0}</b>: {1}<br><b>{2}</b>: {3} {4}";
+				} 
+				else
+				{
+					params.add(jEdit.getProperty("install-plugins.info.depends", "Depends on"));
+					StringList sl = StringList.split(entry.dependencies, "\n");
+					params.add(sl.join(", "));
+					// params.add(entry.dependencies.replaceAll("\n", ", "));
+				}
+				text = MessageFormat.format(pattern, params.toArray(new String[0]));
 			}
 			setText(text);
 			setCaretPosition(0);
diff --git a/org/gjt/sp/jedit/pluginmgr/ManagePanel.java b/org/gjt/sp/jedit/pluginmgr/ManagePanel.java
index 9adb84e..e85e450 100644
--- a/org/gjt/sp/jedit/pluginmgr/ManagePanel.java
+++ b/org/gjt/sp/jedit/pluginmgr/ManagePanel.java
@@ -265,7 +265,14 @@ public class ManagePanel extends JPanel
 		PluginJAR.PluginCacheEntry pluginCacheEntry = PluginJAR.getPluginCache(pluginJAR);
 		if (pluginCacheEntry == null)
 		{
-			pluginCacheEntry = pluginJAR.generateCache();
+			try
+			{
+				pluginCacheEntry = pluginJAR.generateCache();
+			}
+			finally
+			{
+				IOUtilities.closeQuietly(pluginJAR.getZipFile());
+			}
 		}
 		if(pluginCacheEntry == null)
 		{
@@ -301,7 +308,7 @@ public class ManagePanel extends JPanel
 	//{{{ Inner classes
 
 	//{{{ Entry class
-	static class Entry
+	class Entry
 	{
 		static final String LOADED = "loaded";
 		static final String NOT_LOADED = "not-loaded";
@@ -317,6 +324,9 @@ public class ManagePanel extends JPanel
 		String clazz, name, version, author, docs;
 		/** The description property of the plugin. */
 		String description;
+		/** The dependencies of the plugin. */
+		Set<String> depends;
+		
 		EditPlugin plugin;
 		/**
 		 * The jars referenced in the props file of the plugin.
@@ -366,7 +376,6 @@ public class ManagePanel extends JPanel
 				docs = jEdit.getProperty("plugin."+clazz+".docs");
 				description = jEdit.getProperty("plugin."+clazz+".description");
 				String jarsProp = jEdit.getProperty("plugin."+clazz+".jars");
-
 				if(jarsProp != null)
 				{
 					String directory = MiscUtilities.getParentOfPath(this.jar);
@@ -398,6 +407,30 @@ public class ManagePanel extends JPanel
 				status = LOADED;
 			}
 		}
+		
+		/**
+		 * @return A list of the names of the dependencies, e.g. ErrorList or ProjectViewer.
+		 */
+		public Set<String> getDependencies() 
+		{
+			if (plugin == null)
+				return null;
+			Set<String> depends = null;
+			PluginJAR jar = plugin.getPluginJAR();
+			String cn = plugin.getClassName();
+			Set<String> requiredJars = jar.getDependencies(cn);
+			if (requiredJars != null && !requiredJars.isEmpty())
+			{
+				depends = new HashSet<String>();
+				for (String dep : requiredJars)
+				{
+					Entry e = pluginModel.getEntry(dep);
+					if (e != null)
+						depends.add(e.name);
+				}
+			}
+			return depends;
+		}
 	} //}}}
 
 	//{{{ PluginTableModel class
@@ -459,6 +492,19 @@ public class ManagePanel extends JPanel
 			return entries.get(rowIndex);
 		} //}}}
 
+		//{{{ getEntry() method
+		public Entry getEntry(String classname)
+		{
+			if (classname == null || classname.isEmpty())
+				return null;
+			for (Entry entry : entries)
+			{
+				if (classname.equals(entry.clazz))
+					return entry;
+			}
+			return null;
+		} //}}}
+
 		//{{{ getRowCount() method
 		@Override
 		public int getRowCount()
@@ -549,7 +595,7 @@ public class ManagePanel extends JPanel
 				}
 				else
 				{
-					if(value.equals(Boolean.TRUE))
+					if(value.equals(Boolean.TRUE)) 
 						return;
 
 					unloadPluginJARWithDialog(jar);
@@ -630,28 +676,44 @@ public class ManagePanel extends JPanel
 		{
 			// unloaded = new HashSet<String>();
 			unloaded = new ConcurrentHashMap<String, Object>();
-			String[] dependents = jar.getDependentPlugins();
+			String[] dependents = jar.getAllDependentPlugins();
 			if(dependents.length == 0)
+			{
 				unloadPluginJAR(jar);
+			}
 			else
 			{
 				List<String> closureSet = new LinkedList<String>();
+				dependents = jar.getDependentPlugins();
 				PluginJAR.transitiveClosure(dependents, closureSet);
-				List<String> listModel = new ArrayList<String>();
-				listModel.addAll(closureSet);
-				Collections.sort(listModel, new StandardUtilities.StringCompare<String>(true));
-
-				int button = GUIUtilities.listConfirm(window,"plugin-manager.dependency",
-					new String[] { jar.getFile().getName() }, listModel.toArray());
-				if(button == JOptionPane.YES_OPTION)
+				List<String> listModel = new ArrayList<String>(new HashSet<String>(closureSet));	// remove dupes
+				boolean confirm = true;
+				if (!listModel.isEmpty())
+				{
+					// show confirmation dialog listing dependencies to be unloaded
+					Collections.sort(listModel, new StandardUtilities.StringCompare<String>(true));
+					int button = GUIUtilities.listConfirm(window,"plugin-manager.dependency",
+						new String[] { jar.getFile().getName() }, listModel.toArray());
+					confirm = button == JOptionPane.YES_OPTION;
+				}
+				if (confirm)
+				{
+					String[] optionals = jar.getOptionallyDependentPlugins();
 					unloadPluginJAR(jar);
+					// reload the optionally dependent plugins since they can run 
+					// without this plugin
+					for (String opt : optionals) 
+					{
+						PluginJAR.load(opt, true);	
+					}
+				}
 			}
 		} //}}}
 
 		//{{{ unloadPluginJAR() method
 		private void unloadPluginJAR(PluginJAR jar)
 		{
-			String[] dependents = jar.getDependentPlugins();
+			String[] dependents = jar.getAllDependentPlugins();
 			for (String dependent : dependents)
 			{
 				if (!unloaded.containsKey(dependent))
@@ -679,10 +741,8 @@ public class ManagePanel extends JPanel
 			if (table != null)
 			{
 				int[] rows = table.getSelectedRows();
-				for (int i=0 ; i<rows.length ; i++)
-				{
-					savedSelection.add(entries.get(rows[i]).jar);
-				}
+				for (int row : rows)
+					savedSelection.add(entries.get(row).jar);
 			}
 		} //}}}
 
@@ -1105,11 +1165,8 @@ public class ManagePanel extends JPanel
 				return;
 
 			Roster roster = new Roster();
-			for (int i = 0; i < mustRemove.size(); i++)
-			{
-				String entry = mustRemove.get(i);
+			for (String entry : mustRemove)
 				roster.addRemove(jarlibs.get(entry));
-			}
 
 			roster.performOperationsInAWTThread(window);
 			pluginModel.update();
@@ -1329,10 +1386,11 @@ public class ManagePanel extends JPanel
 				break;
 			case EDIT_PLUGIN:
 				int[] rows = table.getSelectedRows();
-				for (int i = 0; i < rows.length; i++)
+				for (int row : rows)
 				{
-					Object st = pluginModel.getValueAt(rows[i], 0);
-					pluginModel.setValueAt(st.equals(Boolean.FALSE), rows[i], 0);
+					Object st = pluginModel.getValueAt(row, 0);
+					pluginModel.setValueAt(
+						st.equals(Boolean.FALSE), row, 0);
 				}
 				break;
 			case CLOSE_PLUGIN_MANAGER:
diff --git a/org/gjt/sp/jedit/pluginmgr/PluginDetailPanel.java b/org/gjt/sp/jedit/pluginmgr/PluginDetailPanel.java
index 3039596..bd94975 100644
--- a/org/gjt/sp/jedit/pluginmgr/PluginDetailPanel.java
+++ b/org/gjt/sp/jedit/pluginmgr/PluginDetailPanel.java
@@ -3,7 +3,7 @@
  * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
- * Copyright (C) 2008 Matthieu Casanova
+ * Copyright (C) 2008-2013 Matthieu Casanova, Dale Anson, Alan Ezust 
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -24,6 +24,12 @@ package org.gjt.sp.jedit.pluginmgr;
 
 //{{{ Imports
 import java.awt.BorderLayout;
+import java.io.File;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
 
 import javax.swing.JEditorPane;
 import javax.swing.JLabel;
@@ -31,6 +37,7 @@ import javax.swing.JPanel;
 import javax.swing.JScrollPane;
 
 import org.gjt.sp.jedit.jEdit;
+import org.gjt.sp.jedit.PluginJAR;
 import org.gjt.sp.jedit.pluginmgr.ManagePanel.Entry;
 //}}}
 
@@ -80,22 +87,56 @@ class PluginDetailPanel extends JPanel
 				// <br> instead of <br/> because Sun's Java 5 HTML parser can't digest them.
 				// No problem on Sun's Java 6 JVM.
 				if (entry.version != null)
-					builder.append("<b>Version</b>: ").append(entry.version).append("<br>");
+					builder.append("<b>").append(jEdit.getProperty("install-plugins.info.version", "Version")).append("</b>: ").append(entry.version).append("<br>");
 				if (entry.author != null)
-					builder.append("<b>Author</b>: ").append(entry.author).append("<br>");
+					builder.append("<b>").append(jEdit.getProperty("install-plugins.info.author", "Author")).append("</b>: ").append(entry.author).append("<br>");
 				if (entry.description != null)
 				{
 					builder.append("<br>").append(entry.description);
 				}
+				builder.append(getDepends(entry));
 				pluginDetail.setText(builder.toString());
 			}
 			else
 			{
 				title.setText("<html><b>"+entry.jar+"</b></html>");
-				pluginDetail.setText(null);
+				
+				PluginJAR pluginJar = new PluginJAR(new File(entry.jar));
+				pluginJar.init();
+				entry.plugin = pluginJar.getPlugin();
+				String clazz = pluginJar.getPlugin().getClassName();
+				
+				StringBuilder sb = new StringBuilder(256);
+				sb.append("<b>").append(jEdit.getProperty("install-plugin.info.version", "Version")).append("</b>: ").append(jEdit.getProperty("plugin."+clazz+".version", ""));
+				sb.append("<br><b>").append(jEdit.getProperty("install-plugin.info.author", "Author")).append("</b>: ").append( jEdit.getProperty("plugin."+clazz+".author", ""));
+				sb.append("<br>").append(jEdit.getProperty("plugin."+clazz+".description", ""));
+				sb.append(getDepends(entry));
+				pluginDetail.setText(sb.toString());
+				
+				pluginJar.uninit(false);
 			}
 			this.entry = entry;
 		}
 	} //}}}
-
+	
+	//{{{ getDepends() method
+	private String getDepends(Entry entry) 
+	{
+		StringBuilder builder = new StringBuilder();
+		Set<String> dependencies = entry.getDependencies();
+		if (dependencies != null && !dependencies.isEmpty()) 
+		{
+			builder.append("<br><br><b>").append(jEdit.getProperty("install-plugins.info.depends", "Depends on")).append("</b>:");
+			List<String> depends = new ArrayList(dependencies);
+			Collections.sort(depends);
+			int i = 0;
+			for (String dep : depends) 
+			{
+				if (i > 0) builder.append(",");
+				builder.append(" ").append(dep);
+				++i;				
+			}
+		}
+		return builder.toString();
+	} //}}}
 }
diff --git a/org/gjt/sp/jedit/pluginmgr/PluginList.java b/org/gjt/sp/jedit/pluginmgr/PluginList.java
index 9c69757..5ac404f 100644
--- a/org/gjt/sp/jedit/pluginmgr/PluginList.java
+++ b/org/gjt/sp/jedit/pluginmgr/PluginList.java
@@ -40,7 +40,7 @@ import org.gjt.sp.jedit.*;
 /**
  * Plugin list downloaded from server.
  * @since jEdit 3.2pre2
- * @version $Id: PluginList.java 22357 2012-10-13 04:58:01Z ezust $
+ * @version $Id: PluginList.java 23224 2013-09-30 20:51:42Z shlomy $
  */
 class PluginList
 {
@@ -249,17 +249,15 @@ class PluginList
 	{
 		// after the entire list is loaded, fill out plugin field
 		// in dependencies
-		for(int i = 0; i < plugins.size(); i++)
+		for (Plugin plugin : plugins)
 		{
-			Plugin plugin = plugins.get(i);
-			for(int j = 0; j < plugin.branches.size(); j++)
+			for (int j = 0; j < plugin.branches.size(); j++)
 			{
 				Branch branch = plugin.branches.get(j);
-				for(int k = 0; k < branch.deps.size(); k++)
+				for (int k = 0; k < branch.deps.size(); k++)
 				{
 					Dependency dep = branch.deps.get(k);
-					if(dep.what.equals("plugin"))
-						dep.plugin = pluginHash.get(dep.pluginName);
+					if (dep.what.equals("plugin")) dep.plugin = pluginHash.get(dep.pluginName);
 				}
 			}
 		}
@@ -268,9 +266,9 @@ class PluginList
 	//{{{ dump() method
 	void dump()
 	{
-		for(int i = 0; i < plugins.size(); i++)
+		for (Plugin plugin : plugins)
 		{
-			System.err.println(plugins.get(i));
+			System.err.println(plugin);
 			System.err.println();
 		}
 	} //}}}
@@ -392,10 +390,9 @@ class PluginList
 		 */
 		Branch getCompatibleBranch()
 		{
-			for(int i = 0; i < branches.size(); i++)
+			for (Branch branch : branches)
 			{
-				Branch branch = branches.get(i);
-				if(branch.canSatisfyDependencies())
+				if (branch.canSatisfyDependencies())
 					return branch;
 			}
 
@@ -458,10 +455,9 @@ class PluginList
 
 		boolean canSatisfyDependencies()
 		{
-			for(int i = 0; i < deps.size(); i++)
+			for (Dependency dep : deps)
 			{
-				Dependency dep = deps.get(i);
-				if(!dep.canSatisfy())
+				if (!dep.canSatisfy())
 					return false;
 			}
 
@@ -471,11 +467,21 @@ class PluginList
 		void satisfyDependencies(Roster roster, String installDirectory,
 			boolean downloadSource)
 		{
-			for(int i = 0; i < deps.size(); i++)
+			for (Dependency dep : deps)
+				dep.satisfy(roster, installDirectory, downloadSource);
+		}
+		
+		public String depsToString() 
+		{
+			StringBuilder sb = new StringBuilder();
+			for (Dependency dep : deps) 
 			{
-				Dependency dep = deps.get(i);
-				dep.satisfy(roster,installDirectory,downloadSource);
+				if ("plugin".equals(dep.what) && dep.pluginName != null) 
+				{
+					sb.append(dep.pluginName).append('\n');
+				}
 			}
+			return sb.toString();
 		}
 
 		public String toString()
diff --git a/org/gjt/sp/jedit/pluginmgr/PluginManager.java b/org/gjt/sp/jedit/pluginmgr/PluginManager.java
index 09935eb..7d9f383 100644
--- a/org/gjt/sp/jedit/pluginmgr/PluginManager.java
+++ b/org/gjt/sp/jedit/pluginmgr/PluginManager.java
@@ -3,8 +3,8 @@
  * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
- * Copyright (C) 2002-2012 Slava Pestov, Matthieu Casanova, Kris Kopicki,
- * 				Shlomy Reinstein, Alan Ezust
+ * Copyright (C) 2002-2013 Slava Pestov, Matthieu Casanova, Kris Kopicki,
+ * 				Shlomy Reinstein, Alan Ezust, Björn "Vampire" Kautler
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -43,7 +43,7 @@ import org.gjt.sp.util.ThreadUtilities;
 //}}}
 
 /**
- * @version $Id: PluginManager.java 22967 2013-05-06 09:15:44Z kpouer $
+ * @version $Id: PluginManager.java 23099 2013-07-29 18:08:50Z ezust $
  */
 public class PluginManager extends JFrame
 {
diff --git a/org/gjt/sp/jedit/pluginmgr/Roster.java b/org/gjt/sp/jedit/pluginmgr/Roster.java
index ccc10be..4155666 100644
--- a/org/gjt/sp/jedit/pluginmgr/Roster.java
+++ b/org/gjt/sp/jedit/pluginmgr/Roster.java
@@ -30,6 +30,7 @@ import java.net.*;
 import java.util.zip.*;
 import java.util.*;
 import org.gjt.sp.jedit.*;
+import org.gjt.sp.jedit.msg.PluginUpdate;
 import org.gjt.sp.util.Log;
 import org.gjt.sp.util.IOUtilities;
 
@@ -37,7 +38,7 @@ import static org.gjt.sp.jedit.io.FileVFS.recursiveDelete;
 //}}}
 
 /**
- * @author $Id: Roster.java 22357 2012-10-13 04:58:01Z ezust $
+ * @author $Id: Roster.java 23222 2013-09-29 20:43:34Z shlomy $
  */
 class Roster
 {
@@ -86,13 +87,12 @@ class Roster
 	//{{{ performOperationsInWorkThread() method
 	void performOperationsInWorkThread(PluginManagerProgress progress)
 	{
-		for(int i = 0; i < operations.size(); i++)
+		for (Operation op : operations)
 		{
-			Operation op = operations.get(i);
 			op.runInWorkThread(progress);
 			progress.done();
 
-			if(Thread.interrupted())
+			if (Thread.interrupted())
 				return;
 		}
 	} //}}}
@@ -100,40 +100,31 @@ class Roster
 	//{{{ performOperationsInAWTThread() method
 	void performOperationsInAWTThread(Component comp)
 	{
-		for(int i = 0; i < operations.size(); i++)
-		{
-			Operation op = operations.get(i);
+		for (Operation op : operations)
 			op.runInAWTThread(comp);
-		}
 
 		// add the JARs before checking deps since dep check might
 		// require all JARs to be present
-		for(int i = 0; i < toLoad.size(); i++)
+		for (String pluginName : toLoad)
 		{
-			String pluginName = toLoad.get(i);
-			if(jEdit.getPluginJAR(pluginName) != null)
-			{
-				Log.log(Log.WARNING,this,"Already loaded: "
-					+ pluginName);
-			}
+			if (jEdit.getPluginJAR(pluginName) != null)
+				Log.log(Log.WARNING, this, "Already loaded: " + pluginName);
 			else
 				jEdit.addPluginJAR(pluginName);
 		}
 
-		for(int i = 0; i < toLoad.size(); i++)
+		for (String pluginName : toLoad)
 		{
-			String pluginName = toLoad.get(i);
 			PluginJAR plugin = jEdit.getPluginJAR(pluginName);
-			if(plugin != null)
+			if (plugin != null)
 				plugin.checkDependencies();
 		}
 
 		// now activate the plugins
-		for(int i = 0; i < toLoad.size(); i++)
+		for (String pluginName : toLoad)
 		{
-			String pluginName = toLoad.get(i);
 			PluginJAR plugin = jEdit.getPluginJAR(pluginName);
-			if(plugin != null)
+			if (plugin != null)
 				plugin.activatePluginIfNecessary();
 		}
 	} //}}}
@@ -147,9 +138,9 @@ class Roster
 	//{{{ addOperation() method
 	private void addOperation(Operation op)
 	{
-		for(int i = 0; i < operations.size(); i++)
+		for (Operation operation : operations)
 		{
-			if(operations.get(i).equals(op))
+			if (operation.equals(op))
 				return;
 		}
 
@@ -219,6 +210,10 @@ class Roster
 			Log.log(Log.NOTICE,this,"Deleting " + jarFile);
 
 			boolean ok = jarFile.delete();
+			if (ok) 
+			{
+				EditBus.send(new PluginUpdate(jarFile, PluginUpdate.REMOVED, false));	
+			}
 
 			if(srcFile.exists())
 			{
diff --git a/org/gjt/sp/jedit/print/BufferPrintable.java b/org/gjt/sp/jedit/print/BufferPrintable.java
index 72a90a0..aa298df 100644
--- a/org/gjt/sp/jedit/print/BufferPrintable.java
+++ b/org/gjt/sp/jedit/print/BufferPrintable.java
@@ -40,7 +40,7 @@ import org.gjt.sp.util.*;
 //}}}
 
 /**
- * @version $Id: BufferPrintable.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: BufferPrintable.java 23221 2013-09-29 20:03:32Z shlomy $
  */
 class BufferPrintable implements Printable
 {
@@ -114,10 +114,6 @@ class BufferPrintable implements Printable
 				}
 			});
 		}
-		finally
-		{
-			//buffer.readUnlock();
-		}
 	} //}}}
 
 	//{{{ print() method
@@ -319,19 +315,17 @@ print_loop:	for(;;)
 					(float)pageX,(float)(pageY + y + lm.getHeight()));
 			}
 
-			for(int i = 0; i < lineList.size(); i++)
+			for (Chunk chunk : lineList)
 			{
 				y += lm.getHeight();
-				Chunk chunks = lineList.get(i);
-				if(chunks != null && actuallyPaint)
+				Chunk chunks = chunk;
+				if (chunks != null && actuallyPaint)
 				{
 					FontMetrics metrics = gfx.getFontMetrics();
-					Chunk.paintChunkBackgrounds(chunks,gfx,
-						(float)(pageX + lineNumberWidth),
-						(float)(pageY + y), metrics.getHeight());
-					Chunk.paintChunkList(chunks,gfx,
-						(float)(pageX + lineNumberWidth),
-						(float)(pageY + y),glyphVector);
+					Chunk.paintChunkBackgrounds(chunks, gfx, (float) (pageX + lineNumberWidth),
+								    (float) (pageY + y), metrics.getHeight());
+					Chunk.paintChunkList(chunks, gfx, (float) (pageX + lineNumberWidth),
+							     (float) (pageY + y), glyphVector);
 				}
 			}
 
diff --git a/org/gjt/sp/jedit/print/BufferPrinter1_4.java b/org/gjt/sp/jedit/print/BufferPrinter1_4.java
index ad54d95..c5d60e7 100644
--- a/org/gjt/sp/jedit/print/BufferPrinter1_4.java
+++ b/org/gjt/sp/jedit/print/BufferPrinter1_4.java
@@ -67,7 +67,8 @@ public class BufferPrinter1_4
 				{
 					try
 					{
-						obIn.close();
+						if (obIn != null)
+							obIn.close();
 					} catch (IOException e) {}
 				}
 				//for backwards compatibility, the color variable is stored also as a property
diff --git a/org/gjt/sp/jedit/proto/jeditresource/PluginResURLConnection.java b/org/gjt/sp/jedit/proto/jeditresource/PluginResURLConnection.java
index 5f5d98b..646b2e1 100644
--- a/org/gjt/sp/jedit/proto/jeditresource/PluginResURLConnection.java
+++ b/org/gjt/sp/jedit/proto/jeditresource/PluginResURLConnection.java
@@ -25,15 +25,17 @@ package org.gjt.sp.jedit.proto.jeditresource;
 //{{{ Imports
 import java.io.File;
 import java.io.FileInputStream;
+import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
 import java.net.URLConnection;
 
+import javax.annotation.Nonnull;
+
 import org.gjt.sp.jedit.MiscUtilities;
 import org.gjt.sp.jedit.PluginJAR;
 import org.gjt.sp.jedit.jEdit;
-
 import org.gjt.sp.util.Log;
 //}}}
 
@@ -71,7 +73,11 @@ public class PluginResURLConnection extends URLConnection
 	}//}}}
 
 	//{{{ connect()
-	public void connect() throws IOException
+	/**
+	 * @throws	IOException	on error
+	 * @throws	FileNotFoundException if resource is not found 
+	 */
+	public void connect() throws IOException, FileNotFoundException
 	{
 		if(!connected)
 		{
@@ -83,11 +89,10 @@ public class PluginResURLConnection extends URLConnection
 			{
 				boolean pluginFoundInPluginJARs = false;
 				PluginJAR[] plugins = jEdit.getPluginJARs();
-				for(int i = 0; i < plugins.length; i++)
+				for (PluginJAR jar : plugins)
 				{
-					PluginJAR jar = plugins[i];
-					String jarName =MiscUtilities.getFileName(jar.getPath()).toLowerCase(); 
-					if(plugin.equalsIgnoreCase(jarName))
+					String jarName = MiscUtilities.getFileName(jar.getPath()).toLowerCase();
+					if (plugin.equalsIgnoreCase(jarName))
 					{
 						pluginFoundInPluginJARs = true;
 						in = jar.getClassLoader().getResourceAsStream(resource);
@@ -107,15 +112,31 @@ public class PluginResURLConnection extends URLConnection
 				File f = new File(jEdit.getJEditHome(), resource);
 				if (f.exists()) 
 					in = new FileInputStream(f);
-			if (in == null) throw new IOException("Resource not found: " + plugin + "!" + resource);
 			}
 			connected = true;
 		}
+		if(in == null)
+		{
+			if(plugin != null)
+			{
+				throw new FileNotFoundException("Resource not found: " + plugin + "!" + resource);
+			}
+			else
+			{
+				throw new FileNotFoundException("Resource not found: " + getURL());
+			}
+		}
 	}//}}}
 
 	//{{{ getInputStream()
+	/**
+	 * @return	input stream to read the resource's contents. never null
+	 * @throws	IOException	on error
+	 * @throws	FileNotFoundException if resource is not found 
+	 */
+	@Nonnull
 	public InputStream getInputStream()
-		throws IOException
+		throws IOException, FileNotFoundException
 	{
 		connect();
 		return in;
diff --git a/org/gjt/sp/jedit/search/AllBufferSet.java b/org/gjt/sp/jedit/search/AllBufferSet.java
index 268a5ac..348a638 100644
--- a/org/gjt/sp/jedit/search/AllBufferSet.java
+++ b/org/gjt/sp/jedit/search/AllBufferSet.java
@@ -35,7 +35,7 @@ import org.gjt.sp.util.StandardUtilities;
 /**
  * A file set for searching all open buffers in a view.
  * @author Slava Pestov
- * @version $Id: AllBufferSet.java 22151 2012-09-04 04:01:41Z ezust $
+ * @version $Id: AllBufferSet.java 23221 2013-09-29 20:03:32Z shlomy $
  */
 public class AllBufferSet extends BufferListSet
 {
@@ -105,10 +105,9 @@ public class AllBufferSet extends BufferListSet
 			return null;
 		}
 
-		for(int i = 0; i < buffers.length; i++)
+		for (Buffer buffer : buffers)
 		{
-			Buffer buffer = buffers[i];
-			if(filter.matcher(buffer.getName()).matches())
+			if (filter.matcher(buffer.getName()).matches())
 				returnValue.add(buffer.getPath());
 		}
 
diff --git a/org/gjt/sp/jedit/search/BoyerMooreSearchMatcher.java b/org/gjt/sp/jedit/search/BoyerMooreSearchMatcher.java
index f95d528..1c23de1 100644
--- a/org/gjt/sp/jedit/search/BoyerMooreSearchMatcher.java
+++ b/org/gjt/sp/jedit/search/BoyerMooreSearchMatcher.java
@@ -27,7 +27,7 @@ package org.gjt.sp.jedit.search;
 
 /**
  * Implements literal search using the Boyer-Moore algorithm.
- * @version $Id: BoyerMooreSearchMatcher.java 22941 2013-04-22 11:06:59Z thomasmey $
+ * @version $Id: BoyerMooreSearchMatcher.java 23332 2013-11-13 14:24:31Z kpouer $
  */
 public class BoyerMooreSearchMatcher extends SearchMatcher
 {
@@ -87,10 +87,10 @@ public class BoyerMooreSearchMatcher extends SearchMatcher
 			int _end = returnValue.end;
 			if (wholeWord)
 			{
-				CharSequence subText = text;
+				CharSequence subText;
 				while (!isWholeWord(text, returnValue.start, returnValue.end))
 				{
-					subText = subText.subSequence(returnValue.end, text.length());
+					subText = text.subSequence(returnValue.end, text.length());
 					Match match = nextMatch(subText, start, end, firstTime, reverse);
 					// match == returnValue or null
 					if (match == null)
diff --git a/org/gjt/sp/jedit/search/BufferListSet.java b/org/gjt/sp/jedit/search/BufferListSet.java
index daabfac..ae4463c 100644
--- a/org/gjt/sp/jedit/search/BufferListSet.java
+++ b/org/gjt/sp/jedit/search/BufferListSet.java
@@ -32,7 +32,7 @@ import org.gjt.sp.util.StandardUtilities;
 /**
  * A file set for searching a user-specified list of buffers.
  * @author Slava Pestov
- * @version $Id: BufferListSet.java 22454 2012-11-10 11:15:08Z thomasmey $
+ * @version $Id: BufferListSet.java 23221 2013-09-29 20:03:32Z shlomy $
  */
 public abstract class BufferListSet implements SearchFileSet
 {
@@ -110,7 +110,8 @@ public abstract class BufferListSet implements SearchFileSet
 	} //}}}
 
 	//{{{ getPrevOrNextFile method()
-	private enum Direction {PREV, NEXT};
+	private enum Direction {PREV, NEXT}
+
 	private String getPrevOrNextFile(View view, String path, Direction direction)
 	{
 		if(files == null)
@@ -126,10 +127,10 @@ public abstract class BufferListSet implements SearchFileSet
 			boolean ignoreCase = ((vfs.getCapabilities()
 				& VFS.CASE_INSENSITIVE_CAP) != 0);
 
-			for(int i = 0; i < files.length; i++)
+			for (String file : files)
 			{
-				if(StandardUtilities.compareStrings(
-					files[i],path,ignoreCase) == 0)
+				if (StandardUtilities.compareStrings(
+					file, path, ignoreCase) == 0)
 				{
 					return path;
 				}
diff --git a/org/gjt/sp/jedit/search/HyperSearchOperationNode.java b/org/gjt/sp/jedit/search/HyperSearchOperationNode.java
index 2447bb1..09d2f28 100644
--- a/org/gjt/sp/jedit/search/HyperSearchOperationNode.java
+++ b/org/gjt/sp/jedit/search/HyperSearchOperationNode.java
@@ -39,7 +39,7 @@ import javax.swing.tree.TreePath;
 
 /**
  * @author Slava Pestov
- * @version $Id: HyperSearchOperationNode.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: HyperSearchOperationNode.java 23221 2013-09-29 20:03:32Z shlomy $
  */
 public class HyperSearchOperationNode
 {
@@ -78,11 +78,10 @@ public class HyperSearchOperationNode
 	//{{{ restoreFlatNodes() method
 	public void restoreFlatNodes(JTree resultTree, DefaultMutableTreeNode operNode)
 	{
-		for (int i = 0; i < resultNodes.size(); i++)
+		for (DefaultMutableTreeNode element : resultNodes)
 		{
-			DefaultMutableTreeNode element = resultNodes.get(i);
 			if (element.getUserObject() instanceof HyperSearchFileNode)
-				((HyperSearchFileNode)element.getUserObject()).showFullPath = true;
+				((HyperSearchFileNode) element.getUserObject()).showFullPath = true;
 
 			operNode.insert(element, operNode.getChildCount());
 		}
@@ -141,13 +140,12 @@ public class HyperSearchOperationNode
 		String[] topPathTmp = null;
 		int topPathNdx = -1;
 
-		for (int i = 0;i < resultNodes.size();i++)
+		for (DefaultMutableTreeNode fileTreeNode : resultNodes)
 		{
-			DefaultMutableTreeNode fileTreeNode = resultNodes.get(i);
 			Object obj = fileTreeNode.getUserObject();
 			if (!(obj instanceof HyperSearchFileNode))
 				continue;
-			HyperSearchFileNode fileNode = (HyperSearchFileNode)obj;
+			HyperSearchFileNode fileNode = (HyperSearchFileNode) obj;
 
 			int pos = fileNode.path.lastIndexOf(fileSep);
 			String pathName = fileNode.path.substring(0, pos);
@@ -160,11 +158,11 @@ public class HyperSearchOperationNode
 			else if (paths.length < topPathNdx)
 			{
 				topPathNdx = paths.length;
-				topPathTmp = paths;				
+				topPathTmp = paths;
 			}
 			else
 			{
-				for (int ndx =0 ; ndx < topPathNdx; ndx++)
+				for (int ndx = 0; ndx < topPathNdx; ndx++)
 				{
 					if (!paths[ndx].equals(topPathTmp[ndx]))
 					{
@@ -187,20 +185,19 @@ public class HyperSearchOperationNode
 		DefaultMutableTreeNode folderTreeNode = new DefaultMutableTreeNode(folderNode);
 		operNode.insert(folderTreeNode, operNode.getChildCount());
 		treeNodes.put(topPathPath, folderTreeNode);
-		
-		for (int i = 0;i < resultNodes.size();i++)
+
+		for (DefaultMutableTreeNode fileTreeNode : resultNodes)
 		{
-			DefaultMutableTreeNode fileTreeNode = resultNodes.get(i);
 			Object obj = fileTreeNode.getUserObject();
 			if (!(obj instanceof HyperSearchFileNode))
 				continue;
-			HyperSearchFileNode fileNode = (HyperSearchFileNode)obj;
+			HyperSearchFileNode fileNode = (HyperSearchFileNode) obj;
 
 			fileNode.showFullPath = false;
 			int pos = fileNode.path.lastIndexOf(fileSep);
 			String pathName = fileNode.path.substring(0, pos);
 			String[] paths = pathName.split(fileSepRegex);
-			
+
 			DefaultMutableTreeNode insNode = folderTreeNode;
 			String partialPath = topPathPath;
 			for (int ndx = topPathNdx; ndx < paths.length; ndx++)
@@ -209,7 +206,7 @@ public class HyperSearchOperationNode
 				DefaultMutableTreeNode tmpNode = treeNodes.get(partialPath);
 				if (tmpNode == null)
 				{
-					HyperSearchFolderNode tmpFolderNode = 
+					HyperSearchFolderNode tmpFolderNode =
 						new HyperSearchFolderNode(new File(partialPath), false);
 					tmpNode = new DefaultMutableTreeNode(tmpFolderNode);
 					insNode.insert(tmpNode, insNode.getChildCount());
diff --git a/org/gjt/sp/jedit/search/HyperSearchRequest.java b/org/gjt/sp/jedit/search/HyperSearchRequest.java
index 69cb1db..a38fc7c 100644
--- a/org/gjt/sp/jedit/search/HyperSearchRequest.java
+++ b/org/gjt/sp/jedit/search/HyperSearchRequest.java
@@ -38,7 +38,7 @@ import org.gjt.sp.util.*;
 /**
  * HyperSearch results window.
  * @author Slava Pestov
- * @version $Id: HyperSearchRequest.java 22949 2013-04-23 18:53:15Z thomasmey $
+ * @version $Id: HyperSearchRequest.java 23224 2013-09-30 20:51:42Z shlomy $
  */
 class HyperSearchRequest extends Task
 {
@@ -193,23 +193,19 @@ class HyperSearchRequest extends Task
 		{
 			buffer.readLock();
 
-			for(int i = 0; i < selection.length; i++)
+			for (Selection s : selection)
 			{
-				Selection s = selection[i];
-				if(s instanceof Selection.Rect)
+				if (s instanceof Selection.Rect)
 				{
-					for(int j = s.getStartLine();
-						j <= s.getEndLine(); j++)
+					for (int j = s.getStartLine(); j <= s.getEndLine(); j++)
 					{
-						resultCount += doHyperSearch(buffer,
-							s.getStart(buffer,j),
-							s.getEnd(buffer,j));
+						resultCount += doHyperSearch(buffer, s.getStart(buffer, j),
+									     s.getEnd(buffer, j));
 					}
 				}
 				else
 				{
-					resultCount += doHyperSearch(buffer,
-						s.getStart(),s.getEnd());
+					resultCount += doHyperSearch(buffer, s.getStart(), s.getEnd());
 				}
 			}
 		}
diff --git a/org/gjt/sp/jedit/search/SearchAndReplace.java b/org/gjt/sp/jedit/search/SearchAndReplace.java
index 27b15e6..80d5bc3 100644
--- a/org/gjt/sp/jedit/search/SearchAndReplace.java
+++ b/org/gjt/sp/jedit/search/SearchAndReplace.java
@@ -63,7 +63,7 @@ import org.gjt.sp.util.*;
  *
  * @author Slava Pestov
  * @author John Gellene (API documentation)
- * @version $Id: SearchAndReplace.java 22949 2013-04-23 18:53:15Z thomasmey $
+ * @version $Id: SearchAndReplace.java 23222 2013-09-29 20:43:34Z shlomy $
  */
 public class SearchAndReplace
 {
@@ -743,12 +743,11 @@ loop:		for(;;)
 
 			int retVal = 0;
 
-			for(int i = 0; i < selection.length; i++)
+			for (Selection aSelection : selection)
 			{
-				s = selection[i];
-
-				retVal += replaceInSelection(view,textArea,
-					buffer,matcher,smartCaseReplace,s);
+				s = aSelection;
+				retVal += replaceInSelection(view, textArea, buffer,
+					matcher, smartCaseReplace, s);
 			}
 			
 			if(reverse)
diff --git a/org/gjt/sp/jedit/search/SearchDialog.java b/org/gjt/sp/jedit/search/SearchDialog.java
index f253975..aae5a5a 100644
--- a/org/gjt/sp/jedit/search/SearchDialog.java
+++ b/org/gjt/sp/jedit/search/SearchDialog.java
@@ -43,7 +43,7 @@ import org.gjt.sp.jedit.*;
 /**
  * Search and replace dialog.
  * @author Slava Pestov
- * @version $Id: SearchDialog.java 22471 2012-11-14 15:55:39Z daleanson $
+ * @version $Id: SearchDialog.java 23391 2014-01-04 01:01:28Z ezust $
  */
 public class SearchDialog extends EnhancedDialog
 {
@@ -715,26 +715,25 @@ public class SearchDialog extends EnhancedDialog
 		JPanel grid = new JPanel(new GridLayout(5,1,0,12));
 
 		findBtn = new JButton(jEdit.getProperty("search.findBtn"));
-		findBtn.setMnemonic(jEdit.getProperty("search.findBtn.mnemonic")
-			.charAt(0));
+	    
 		getRootPane().setDefaultButton(findBtn);
 		grid.add(findBtn);
 		findBtn.addActionListener(actionHandler);
 
 		replaceBtn = new JButton(jEdit.getProperty("search.replaceBtn", "Replace"));
-		replaceBtn.setMnemonic(jEdit.getProperty("search.replaceBtn.mnemonic")
+		replaceBtn.setMnemonic(jEdit.getProperty("search.replaceBtn.mnemonic", "p")
 			.charAt(0));
 		grid.add(replaceBtn);
 		replaceBtn.addActionListener(actionHandler);
 
 		replaceAndFindBtn = new JButton(jEdit.getProperty("search.replaceAndFindBtn"));
-		replaceAndFindBtn.setMnemonic(jEdit.getProperty("search.replaceAndFindBtn.mnemonic")
+		replaceAndFindBtn.setMnemonic(jEdit.getProperty("search.replaceAndFindBtn.mnemonic", "R")
 			.charAt(0));
 		grid.add(replaceAndFindBtn);
 		replaceAndFindBtn.addActionListener(actionHandler);
 
 		replaceAllBtn = new JButton(jEdit.getProperty("search.replaceAllBtn"));
-		replaceAllBtn.setMnemonic(jEdit.getProperty("search.replaceAllBtn.mnemonic")
+		replaceAllBtn.setMnemonic(jEdit.getProperty("search.replaceAllBtn.mnemonic", "a")
 			.charAt(0));
 		grid.add(replaceAllBtn);
 		replaceAllBtn.addActionListener(actionHandler);
diff --git a/org/gjt/sp/jedit/syntax/Chunk.java b/org/gjt/sp/jedit/syntax/Chunk.java
index 6935a1e..df6b3cf 100644
--- a/org/gjt/sp/jedit/syntax/Chunk.java
+++ b/org/gjt/sp/jedit/syntax/Chunk.java
@@ -232,18 +232,21 @@ public class Chunk extends Token
 
 		String family;
 		int i = 0;
-		while ((family = props.getProperty("view.fontSubstList." + i)) != null)
-		{
-			/*
-			 * The default font is Font.DIALOG if the family
-			 * doesn't match any installed fonts. The following
-			 * check skips fonts that don't exist.
-			 */
-			Font f = new Font(family, Font.PLAIN, 12);
-			if (!"dialog".equalsIgnoreCase(f.getFamily()) ||
-				"dialog".equalsIgnoreCase(family))
-				userFonts.add(f);
-			i++;
+		if (props != null)
+		{
+			while ((family = props.getProperty("view.fontSubstList." + i)) != null)
+			{
+				/*
+				 * The default font is Font.DIALOG if the family
+				 * doesn't match any installed fonts. The following
+				 * check skips fonts that don't exist.
+				 */
+				Font f = new Font(family, Font.PLAIN, 12);
+				if (!"dialog".equalsIgnoreCase(f.getFamily()) ||
+					"dialog".equalsIgnoreCase(family))
+					userFonts.add(f);
+				i++;
+			}
 		}
 
 		preferredFonts = userFonts.toArray(new Font[userFonts.size()]);
diff --git a/org/gjt/sp/jedit/syntax/KeywordMap.java b/org/gjt/sp/jedit/syntax/KeywordMap.java
index 919018a..d54eb86 100644
--- a/org/gjt/sp/jedit/syntax/KeywordMap.java
+++ b/org/gjt/sp/jedit/syntax/KeywordMap.java
@@ -32,7 +32,7 @@ import java.util.ArrayList;
  * text substrings without the overhead of creating a new string object.
  *
  * @author Slava Pestov, Mike Dillon
- * @version $Id: KeywordMap.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: KeywordMap.java 23221 2013-09-29 20:03:32Z shlomy $
  */
 public class KeywordMap
 {
@@ -113,14 +113,14 @@ public class KeywordMap
 
 		// complete-word command needs a list of all non-alphanumeric
 		// characters used in a keyword map.
-loop:		for(int i = 0; i < keyword.length; i++)
+loop:
+		for (char ch : keyword)
 		{
-			char ch = keyword[i];
-			if(!Character.isLetterOrDigit(ch))
+			if (!Character.isLetterOrDigit(ch))
 			{
-				for(int j = 0; j < noWordSep.length(); j++)
+				for (int j = 0; j < noWordSep.length(); j++)
 				{
-					if(noWordSep.charAt(j) == ch)
+					if (noWordSep.charAt(j) == ch)
 						continue loop;
 				}
 
@@ -150,10 +150,10 @@ loop:		for(int i = 0; i < keyword.length; i++)
 	public String[] getKeywords()
 	{
 		List<String> vector = new ArrayList<String>(100);
-		for(int i = 0; i < map.length; i++)
+		for (Keyword kw : map)
 		{
-			Keyword keyword = map[i];
-			while(keyword != null)
+			Keyword keyword = kw;
+			while (keyword != null)
 			{
 				vector.add(new String(keyword.keyword));
 				keyword = keyword.next;
diff --git a/org/gjt/sp/jedit/syntax/ModeProvider.java b/org/gjt/sp/jedit/syntax/ModeProvider.java
index 15d20f9..2811d0a 100644
--- a/org/gjt/sp/jedit/syntax/ModeProvider.java
+++ b/org/gjt/sp/jedit/syntax/ModeProvider.java
@@ -22,8 +22,6 @@
 package org.gjt.sp.jedit.syntax;
 
 //{{{ Imports
-import java.io.Closeable;
-
 import org.gjt.sp.jedit.Mode;
 import org.gjt.sp.util.IOUtilities;
 import org.gjt.sp.util.Log;
@@ -53,7 +51,7 @@ public class ModeProvider
 {
 	public static ModeProvider instance = new ModeProvider();
 
-	private final LinkedHashMap<String, Mode> modes = new LinkedHashMap<String, Mode>(180);
+	private final LinkedHashMap<String, Mode> modes = new LinkedHashMap<String, Mode>(220);
 
 	//{{{ removeAll() method
 	public void removeAll()
@@ -235,7 +233,7 @@ public class ModeProvider
 		}
 		finally
 		{
-			IOUtilities.closeQuietly((Closeable)grammar);
+			IOUtilities.closeQuietly(grammar);
 		}
 	} //}}}
 
diff --git a/org/gjt/sp/jedit/syntax/TokenMarker.java b/org/gjt/sp/jedit/syntax/TokenMarker.java
index 3a788b2..30600d3 100644
--- a/org/gjt/sp/jedit/syntax/TokenMarker.java
+++ b/org/gjt/sp/jedit/syntax/TokenMarker.java
@@ -31,7 +31,6 @@ import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import org.gjt.sp.jedit.TextUtilities;
 import org.gjt.sp.util.SegmentCharSequence;
-import org.gjt.sp.util.StandardUtilities;
 //}}}
 
 /**
@@ -40,7 +39,7 @@ import org.gjt.sp.util.StandardUtilities;
  * or font style for painting that token.
  *
  * @author Slava Pestov, mike dillon
- * @version $Id: TokenMarker.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: TokenMarker.java 23381 2013-12-09 12:43:14Z kpouer $
  *
  * @see org.gjt.sp.jedit.syntax.Token
  * @see org.gjt.sp.jedit.syntax.TokenHandler
@@ -969,9 +968,9 @@ unwind:		while(context.parent != null)
 			{
 				LineContext lc = (LineContext)obj;
 				return lc.inRule == inRule && lc.rules == rules
-					&& StandardUtilities.objectsEqual(parent,lc.parent)
+					&& Objects.equals(parent,lc.parent)
 					&& charArraysEqual(spanEndSubst,lc.spanEndSubst)
-					&& StandardUtilities.objectsEqual(spanEndSubstRegex, lc.spanEndSubstRegex);
+					&& Objects.equals(spanEndSubstRegex, lc.spanEndSubstRegex);
 			}
 			else
 				return false;
diff --git a/org/gjt/sp/jedit/textarea/AntiAlias.java b/org/gjt/sp/jedit/textarea/AntiAlias.java
index 95e03fb..a2cabc7 100644
--- a/org/gjt/sp/jedit/textarea/AntiAlias.java
+++ b/org/gjt/sp/jedit/textarea/AntiAlias.java
@@ -106,7 +106,7 @@ public class AntiAlias
 
 	public String toString()
 	{
-		return comboChoices[m_val].toString();
+		return comboChoices[m_val];
 	}
 
 	public int val()
diff --git a/org/gjt/sp/jedit/textarea/ElasticTabStopBufferListener.java b/org/gjt/sp/jedit/textarea/ElasticTabStopBufferListener.java
index 44a1606..debc96c 100644
--- a/org/gjt/sp/jedit/textarea/ElasticTabStopBufferListener.java
+++ b/org/gjt/sp/jedit/textarea/ElasticTabStopBufferListener.java
@@ -493,7 +493,7 @@ public class ElasticTabStopBufferListener extends BufferAdapter
 		{
 			return;
 		}
-		if((buffer.getBooleanProperty("elasticTabstops"))&&((handledInsertion==false)||(handledDeletion==false)))
+		if((buffer.getBooleanProperty("elasticTabstops"))&&((!handledInsertion)||(!handledDeletion)))
 		{	
 			//if we reach here use brute force as a last resolve
 			fullyUpdateColumnBlocks(buffer);
diff --git a/org/gjt/sp/jedit/textarea/ExtensionManager.java b/org/gjt/sp/jedit/textarea/ExtensionManager.java
index 68ba523..f384fad 100644
--- a/org/gjt/sp/jedit/textarea/ExtensionManager.java
+++ b/org/gjt/sp/jedit/textarea/ExtensionManager.java
@@ -30,7 +30,7 @@ import org.gjt.sp.util.Log;
  * Manage the extensions for the gutter and the textarea.
  *
  * @author Slava Pestov
- * @version $Id: ExtensionManager.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: ExtensionManager.java 23221 2013-09-29 20:03:32Z shlomy $
  */
 class ExtensionManager
 {
@@ -129,11 +129,11 @@ class ExtensionManager
 	//{{{ getToolTipText() method
 	String getToolTipText(int x, int y)
 	{
-		for(int i = 0; i < extensions.size(); i++)
+		for (Entry extension : extensions)
 		{
-			TextAreaExtension ext = extensions.get(i).ext;
-			String toolTip = ext.getToolTipText(x,y);
-			if(toolTip != null)
+			TextAreaExtension ext = extension.ext;
+			String toolTip = ext.getToolTipText(x, y);
+			if (toolTip != null)
 				return toolTip;
 		}
 
diff --git a/org/gjt/sp/jedit/textarea/FirstLine.java b/org/gjt/sp/jedit/textarea/FirstLine.java
index 816282f..00b48c1 100644
--- a/org/gjt/sp/jedit/textarea/FirstLine.java
+++ b/org/gjt/sp/jedit/textarea/FirstLine.java
@@ -29,7 +29,7 @@ import org.gjt.sp.util.Log;
  * This Anchor is the first visible line of the textarea.
  *
  * @author Slava Pestov
- * @version $Id: FirstLine.java 22670 2013-01-12 12:29:48Z thomasmey $
+ * @version $Id: FirstLine.java 23224 2013-09-30 20:51:42Z shlomy $
  */
 class FirstLine extends Anchor
 {
@@ -144,7 +144,7 @@ class FirstLine extends Anchor
 	 * Method called before a content is removed from a buffer.
 	 *
 	 * @param startLine the first line of the removed content
-	 * @param offset the offset in the start line
+	 * @param startOffset the offset in the start line
 	 * @param numLines the number of removed lines
 	 */
 	void contentRemoved(int startLine, int startOffset, int numLines)
diff --git a/org/gjt/sp/jedit/textarea/Gutter.java b/org/gjt/sp/jedit/textarea/Gutter.java
index 2d831dd..749de09 100644
--- a/org/gjt/sp/jedit/textarea/Gutter.java
+++ b/org/gjt/sp/jedit/textarea/Gutter.java
@@ -50,7 +50,7 @@ import org.gjt.sp.util.Log;
  * @see TextArea
  *
  * @author Mike Dillon and Slava Pestov
- * @version $Id: Gutter.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: Gutter.java 23461 2014-04-06 18:00:29Z ezust $
  */
 public class Gutter extends JComponent implements SwingConstants
 {
@@ -950,12 +950,14 @@ public class Gutter extends JComponent implements SwingConstants
 				if (e.getX() >= FOLD_MARKER_SIZE)
 				{
 					selectionStart = textArea.getLineStartOffset(line);
+					int selectionEnd = getFoldEndOffset(line);
 					Selection s = new Selection.Range(
-						selectionStart, getFoldEndOffset(line));
+						selectionStart, selectionEnd);
 					if(textArea.isMultipleSelectionEnabled())
 						textArea.addToSelection(s);
 					else
 						textArea.setSelection(s);
+					textArea.moveCaretPosition(selectionEnd, false);
 					selectLines = true;
 					selAnchorLine = line;
 					return;
@@ -1086,11 +1088,13 @@ public class Gutter extends JComponent implements SwingConstants
 				{
 					selStart = textArea.getLineStartOffset(line);
 					selEnd = getFoldEndOffset(selAnchorLine);
+					textArea.moveCaretPosition(selStart, false);
 				}
 				else
 				{
 					selStart = textArea.getLineStartOffset(selAnchorLine);
 					selEnd = getFoldEndOffset(line);
+					textArea.moveCaretPosition(selEnd, false);
 				}
 
 				textArea.resizeSelection(selStart, selEnd, 0, false);
diff --git a/org/gjt/sp/jedit/textarea/JEditTextArea.java b/org/gjt/sp/jedit/textarea/JEditTextArea.java
index a844d30..f7fc642 100644
--- a/org/gjt/sp/jedit/textarea/JEditTextArea.java
+++ b/org/gjt/sp/jedit/textarea/JEditTextArea.java
@@ -27,16 +27,23 @@ package org.gjt.sp.jedit.textarea;
 import java.awt.AWTEvent;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
-
 import java.awt.event.MouseEvent;
+import java.util.regex.Pattern;
+
 import javax.swing.JMenuItem;
 
-import org.gjt.sp.jedit.*;
-import org.gjt.sp.jedit.options.GlobalOptions;
+import org.gjt.sp.jedit.Abbrevs;
+import org.gjt.sp.jedit.EditBus;
 import org.gjt.sp.jedit.EditBus.EBHandler;
-import org.gjt.sp.jedit.msg.PropertiesChanged;
-
+import org.gjt.sp.jedit.GUIUtilities;
+import org.gjt.sp.jedit.Macros;
+import org.gjt.sp.jedit.ServiceManager;
+import org.gjt.sp.jedit.TextUtilities;
+import org.gjt.sp.jedit.View;
+import org.gjt.sp.jedit.jEdit;
 import org.gjt.sp.jedit.msg.PositionChanging;
+import org.gjt.sp.jedit.msg.PropertiesChanged;
+import org.gjt.sp.jedit.options.GlobalOptions;
 //}}}
 
 /**
@@ -49,7 +56,7 @@ import org.gjt.sp.jedit.msg.PositionChanging;
  *
  * @author Slava Pestov
  * @author John Gellene (API documentation)
- * @version $Id: JEditTextArea.java 22469 2012-11-14 08:05:15Z ezust $
+ * @version $Id: JEditTextArea.java 23536 2014-05-10 19:08:54Z ezust $
  */
 public class JEditTextArea extends TextArea
 {
@@ -251,7 +258,8 @@ public class JEditTextArea extends TextArea
 	//{{{ showGoToLineDialog() method
 	/**
 	 * Displays the 'go to line' dialog box, and moves the caret to the
-	 * specified line number.
+	 * specified line number, or moves the caret back or forward by the offset provided.
+	 * 
 	 * @since jEdit 2.7pre2
 	 */
 	public void showGoToLineDialog()
@@ -263,9 +271,24 @@ public class JEditTextArea extends TextArea
 
 		try
 		{
-			int lineNumber = Integer.parseInt(line) - 1;
+			int lineNumber = 0;
+			if (Pattern.matches("-\\d+", line) || Pattern.matches("\\+\\d+", line))
+			{
+				int offset = Integer.parseInt(line);
+				lineNumber = caretLine + offset;
+			}
+			else
+			{
+				lineNumber = Integer.parseInt(line) - 1;
+			}
+			
 			if(lineNumber > --maxLine)
 				lineNumber = maxLine;
+
+			if(lineNumber < 0)
+				lineNumber = 0;
+			
+			
 			EditBus.send(new PositionChanging(this));
 			setCaretPosition(getLineStartOffset(lineNumber));
 		}
@@ -342,22 +365,24 @@ public class JEditTextArea extends TextArea
 		int lines = 1;
 
 		boolean word = true;
-		for(int i = 0; i < chars.length; i++)
+		for (char aChar : chars)
 		{
-			switch(chars[i])
+			switch (aChar)
 			{
-			case '\r': case '\n':
-				lines++;
-			case ' ': case '\t':
-				word = true;
-				break;
-			default:
-				if(word)
-				{
-					words++;
-					word = false;
-				}
-				break;
+				case '\r':
+				case '\n':
+					lines++;
+				case ' ':
+				case '\t':
+					word = true;
+					break;
+				default:
+					if (word)
+					{
+						words++;
+						word = false;
+					}
+					break;
 			}
 		}
 
diff --git a/org/gjt/sp/jedit/textarea/MouseHandler.java b/org/gjt/sp/jedit/textarea/MouseHandler.java
index 36966c5..51c420e 100644
--- a/org/gjt/sp/jedit/textarea/MouseHandler.java
+++ b/org/gjt/sp/jedit/textarea/MouseHandler.java
@@ -50,9 +50,10 @@ public class MouseHandler extends TextAreaMouseHandler
 	{
 		showCursor();
 
-		if (evt.getButton() == MouseEvent.NOBUTTON)
+		int btn = evt.getButton();
+		if (btn != MouseEvent.BUTTON1 && btn != MouseEvent.BUTTON2 && btn != MouseEvent.BUTTON3)
 		{
-			// Suppress presses with no button, to avoid
+			// Suppress presses with unknown button, to avoid
 			// problems due to horizontal scrolling.
 			return;
 		}
@@ -141,9 +142,10 @@ public class MouseHandler extends TextAreaMouseHandler
 	@Override
 	public void mouseReleased(MouseEvent evt)
 	{
-		if (evt.getButton() == MouseEvent.NOBUTTON)
+		int btn = evt.getButton();
+		if (btn != MouseEvent.BUTTON1 && btn != MouseEvent.BUTTON2 && btn != MouseEvent.BUTTON3)
 		{
-			// Suppress releases with no button, to avoid
+			// Suppress releases with unknown button, to avoid
 			// problems due to horizontal scrolling.
 			return;
 		}
diff --git a/org/gjt/sp/jedit/textarea/ScrollLayout.java b/org/gjt/sp/jedit/textarea/ScrollLayout.java
index d79c47d..80015c4 100644
--- a/org/gjt/sp/jedit/textarea/ScrollLayout.java
+++ b/org/gjt/sp/jedit/textarea/ScrollLayout.java
@@ -28,6 +28,20 @@ import javax.swing.border.Border;
 import javax.swing.JComponent;
 //}}}
 
+/**
+ * Similar to a javax.swing.ScrollPaneLayout, but not as restrictive on the
+ * components that can be added. This layout is essentially a 3 x 3 grid layout,
+ * with the intent that the bottom and right will hold scroll bars. When installed
+ * a TextArea, the bottom has a scroll bar, the right has a vertical box containing
+ * a scroll bar, the left has a Gutter, and the center holds a TextAreaPainter.
+ * The corners and top are not used by the TextArea.
+ *
+ * The corners are intended to be a place to put a button or other small component.
+ * The corner dimensions are constrained by the left, right, top, and bottom
+ * components, so, for example, the width of the top left corner is the width
+ * of the left component and the height of the top left corner is the height of
+ * the top component.
+ */
 public class ScrollLayout implements LayoutManager
 {
 	public static final String CENTER = "center";
@@ -35,23 +49,58 @@ public class ScrollLayout implements LayoutManager
 	public static final String LEFT = "left";
 	public static final String BOTTOM = "bottom";
 	public static final String TOP = "top";
+	public static final String TOP_LEFT = "topLeft";
+	public static final String TOP_RIGHT = "topRight";
+	public static final String BOTTOM_LEFT = "bottomLeft";
+	public static final String BOTTOM_RIGHT = "bottomRight";
 
 	//{{{ addLayoutComponent() method
+	/**
+ 	 * Adds a component to the layout using the <code>name</code> parameter to
+ 	 * position the component.
+ 	 * @param name One of CENTER, RIGHT, LEFT, BOTTOM, TOP, TOP_LEFT, TOP_RIGHT, 
+ 	 * BOTTOM_LEFT, BOTTOM_RIGHT.
+ 	 * @param comp The component to add at the given position. If <code>null</code>, the 
+ 	 * component will be removed from that position.
+ 	 */
 	public void addLayoutComponent(String name, Component comp)
 	{
-		if(name.equals(CENTER))
-			center = comp;
-		else if(name.equals(RIGHT))
-			right = comp;
-		else if(name.equals(LEFT))
-			left = comp;
-		else if(name.equals(BOTTOM))
-			bottom = comp;
-		else if(name.equals(TOP))
-			top = comp;
+		switch(name) {
+			case CENTER:
+				center = comp;
+				break;
+			case RIGHT:
+				right = comp;
+				break;
+			case LEFT:
+				left = comp;
+				break;
+			case BOTTOM:
+				bottom = comp;
+				break;
+			case TOP:
+				top = comp;
+				break;
+			case TOP_LEFT:
+				topLeft = comp;
+				break;
+			case TOP_RIGHT:
+				topRight = comp;
+				break;
+			case BOTTOM_LEFT:
+				bottomLeft = comp;
+				break;
+			case BOTTOM_RIGHT:
+				bottomRight = comp;
+				break;
+		}
 	} //}}}
 
 	//{{{ removeLayoutComponent() method
+	/**
+ 	 * Removes the specified component from the layout.
+ 	 * @param comp The component to be removed.
+ 	 */
 	public void removeLayoutComponent(Component comp)
 	{
 		if(center == comp)
@@ -64,6 +113,14 @@ public class ScrollLayout implements LayoutManager
 			bottom = null;
 		else if(top == comp)
 			top = null;
+		else if(topLeft == comp)
+			topLeft = null;
+		else if(topRight == comp)
+			topRight = null;
+		else if(bottomLeft == comp)
+			bottomLeft = null;
+		else if(bottomRight == comp)
+			bottomRight = null;
 	} //}}}
 
 	//{{{ preferredLayoutSize() method
@@ -73,26 +130,90 @@ public class ScrollLayout implements LayoutManager
 		Insets insets = getInsets(parent);
 
 		dim.width = insets.left + insets.right;
+		dim.width += getLeftPreferredWidth();
+		dim.width += getCenterPreferredWidth();
+		dim.width += getRightPreferredWidth();
+		
 		dim.height = insets.top + insets.bottom;
-
-		Dimension leftPref = left.getPreferredSize();
-		dim.width += leftPref.width;
-		Dimension centerPref = center.getPreferredSize();
-		dim.width += centerPref.width;
-		dim.height += centerPref.height;
-		Dimension rightPref = right.getPreferredSize();
-		dim.width += rightPref.width;
-		Dimension bottomPref = bottom.getPreferredSize();
-		dim.height += bottomPref.height;
-		if(top != null)
-		{
-			Dimension topPref = top.getPreferredSize();
-			dim.height += topPref.height;
-		}
+		dim.height += getTopPreferredHeight();
+		dim.height += getCenterPreferredHeight();
+		dim.height += getBottomPreferredHeight();
 
 		return dim;
 	} //}}}
-
+	
+	//{{{ preferred widths
+	// constrained by left component preferred width
+	private int getLeftPreferredWidth() 
+	{
+		if (left != null) 
+		{
+			return left.getPreferredSize().width;	
+		}
+		int tlw = topLeft == null ? 0 : topLeft.getPreferredSize().width;
+		int lw = left == null ? 0 : left.getPreferredSize().width;
+		int blw = bottomLeft == null ? 0 : bottomLeft.getPreferredSize().width;
+		return Math.max(lw, Math.max(tlw, blw));
+	}
+	
+	private int getCenterPreferredWidth()
+	{
+		int tw = top == null ? 0 : top.getPreferredSize().width;
+		int cw = center == null ? 0 : center.getPreferredSize().width;
+		int bw = bottom == null ? 0 : bottom.getPreferredSize().width;
+		return Math.max(cw, Math.max(tw, bw));
+	}
+	
+	// constrained by right component preferred width
+	private int getRightPreferredWidth()
+	{
+		if (right != null)
+		{
+			return right.getPreferredSize().width;	
+		}
+		int trw = topRight == null ? 0 : topRight.getPreferredSize().width;
+		int rw = right == null ? 0 : right.getPreferredSize().width;
+		int brw = bottomRight == null ? 0 : bottomRight.getPreferredSize().width;
+		return Math.max(rw, Math.max(trw, brw));
+	}
+	//}}}
+	
+	//{{{ preferred heights
+	// constrained by top component preferred height
+	private int getTopPreferredHeight()
+	{
+		if (top != null) 
+		{
+			return top.getPreferredSize().height;	
+		}
+		int tlh = topLeft == null ? 0 : topLeft.getPreferredSize().height;
+		int th = top == null ? 0 : top.getPreferredSize().height;
+		int trh = topRight == null ? 0 : topRight.getPreferredSize().height;
+		return Math.max(th, Math.max(tlh, trh));
+	}
+	
+	private int getCenterPreferredHeight()
+	{
+		int lh = left == null ? 0 : left.getPreferredSize().height;
+		int ch = center == null ? 0 : center.getPreferredSize().height;
+		int rh = right == null ? 0 : right.getPreferredSize().height;
+		return Math.max(ch, Math.max(lh, rh));
+	}
+	
+	// constrained by bottom component preferred height
+	private int getBottomPreferredHeight()
+	{
+		if (bottom != null)
+		{
+			return bottom.getPreferredSize().height;	
+		}
+		int blh = bottomLeft == null ? 0 : bottomLeft.getPreferredSize().height;
+		int bh = bottom == null ? 0 : bottom.getPreferredSize().height;
+		int brh = bottomRight == null ? 0 : bottomRight.getPreferredSize().height;
+		return Math.max(bh, Math.max(brh, blh));
+	}
+	//}}}
+	
 	//{{{ minimumLayoutSize() method
 	public Dimension minimumLayoutSize(Container parent)
 	{
@@ -102,20 +223,35 @@ public class ScrollLayout implements LayoutManager
 		dim.width = insets.left + insets.right;
 		dim.height = insets.top + insets.bottom;
 
-		Dimension leftPref = left.getMinimumSize();
-		dim.width += leftPref.width;
-		Dimension centerPref = center.getMinimumSize();
-		dim.width += centerPref.width; 
-		dim.height += centerPref.height;
-		Dimension rightPref = right.getMinimumSize();
-		dim.width += rightPref.width;
-		Dimension bottomPref = bottom.getMinimumSize();
-		dim.height += bottomPref.height;
-		if(top != null)
-		{
-			Dimension topPref = top.getMinimumSize();
-			dim.height += topPref.height;
-		}
+		int tlw = topLeft == null ? 0 : topLeft.getMinimumSize().width;
+		int lw = left == null ? 0 : left.getMinimumSize().width;
+		int blw = bottomLeft == null ? 0 : bottomLeft.getMinimumSize().width;
+		dim.width += Math.max(lw, Math.max(tlw, blw));
+		
+		int tw = top == null ? 0 : top.getMinimumSize().width;
+		int cw = center == null ? 0 : center.getMinimumSize().width;
+		int bw = bottom == null ? 0 : bottom.getMinimumSize().width;
+		dim.width += Math.max(cw, Math.max(tw, bw));
+		
+		int trw = topRight == null ? 0 : topRight.getMinimumSize().width;
+		int rw = right == null ? 0 : right.getMinimumSize().width;
+		int brw = bottomRight == null ? 0 : bottomRight.getMinimumSize().width;
+		dim.width += Math.max(rw, Math.max(trw, brw));
+		
+		int tlh = topLeft == null ? 0 : topLeft.getMinimumSize().height;
+		int lh = left == null ? 0 : left.getMinimumSize().height;
+		int blh = bottomLeft == null ? 0 : bottomLeft.getMinimumSize().height;
+		dim.height += Math.max(lh, Math.max(tlh, blh));
+		
+		int th = top == null ? 0 : top.getMinimumSize().height;
+		int ch = center == null ? 0 : center.getMinimumSize().height;
+		int bh = bottom == null ? 0 : bottom.getMinimumSize().height;
+		dim.height += Math.max(ch, Math.max(th, bh));
+		
+		int trh = topRight == null ? 0 : topRight.getMinimumSize().height;
+		int rh = right == null ? 0 : right.getMinimumSize().height;
+		int brh = bottomRight == null ? 0 : bottomRight.getMinimumSize().height;
+		dim.height += Math.max(rh, Math.max(trh, brh));
 		
 		return dim;
 	} //}}}
@@ -131,55 +267,88 @@ public class ScrollLayout implements LayoutManager
 		int ibottom = insets.bottom;
 		int iright = insets.right;
 
-		int rightWidth = right.getPreferredSize().width;
-		int leftWidth = left.getPreferredSize().width;
-		int topHeight;
-		if(top != null)
-		{
-			topHeight = top.getPreferredSize().height;
-		}
-		else
-		{
-			topHeight = 0;
-		}
-		int bottomHeight = bottom.getPreferredSize().height;
+
+		int leftWidth = getLeftPreferredWidth();
+		int rightWidth = getRightPreferredWidth();
+		int topHeight = getTopPreferredHeight();
+		int bottomHeight = getBottomPreferredHeight();
 		int centerWidth = Math.max(0,size.width - leftWidth
 			- rightWidth - ileft - iright);
 		int centerHeight = Math.max(0,size.height - topHeight
 			- bottomHeight - itop - ibottom);
 			
-		left.setBounds(
-			ileft,
-			itop+topHeight,
-			leftWidth,
-			centerHeight);
-
-		center.setBounds(
-			ileft + leftWidth,
-			itop+topHeight,
-			centerWidth,
-			centerHeight);
-
-		right.setBounds(
-			ileft + leftWidth + centerWidth,
-			itop+topHeight,
-			rightWidth,
-			centerHeight);
-
-		bottom.setBounds(
-			ileft,
-			itop + topHeight + centerHeight,
-			Math.max(0,size.width - bottom.getHeight()
-				- ileft - iright),
-			bottomHeight);
+		if (left != null) 
+		{
+			left.setBounds(
+				ileft,
+				itop+topHeight,
+				leftWidth,
+				centerHeight);
+		}
+		if (center != null)
+		{
+			center.setBounds(
+				ileft + leftWidth,
+				itop+topHeight,
+				centerWidth,
+				centerHeight);
+		}
+		if (right != null)
+		{
+			right.setBounds(
+				ileft + leftWidth + centerWidth,
+				itop + topHeight,
+				rightWidth,
+				centerHeight);
+		}
+		if (bottom != null)
+		{
+			bottom.setBounds(
+				ileft + leftWidth,
+				itop + topHeight + centerHeight,
+				centerWidth,
+				bottomHeight);
+		}
 		if(top != null)
 		{
 			top.setBounds(
+				ileft + leftWidth,
+				itop,
+				centerWidth,
+				topHeight);
+		}
+		if (topLeft != null)
+		{
+			topLeft.setBounds(
 				ileft,
 				itop,
-				leftWidth+centerWidth+rightWidth,
+				leftWidth,
 				topHeight);
 		}
+		if (topRight != null) 
+		{
+			topRight.setBounds(
+				ileft + leftWidth + centerWidth,
+				itop,
+				rightWidth,
+				topHeight);
+		}
+		if (bottomLeft != null)
+		{
+			bottomLeft.setBounds(
+				ileft,
+				itop + topHeight + centerHeight,
+				leftWidth,
+				bottomHeight);
+		}
+		if (bottomRight != null) 
+		{
+			bottomRight.setBounds(
+				ileft + leftWidth + centerWidth,
+				itop + topHeight + centerHeight,
+				rightWidth,
+				bottomHeight);
+		}
 	} //}}}
 
 	//{{{ Private members
@@ -188,6 +357,10 @@ public class ScrollLayout implements LayoutManager
 	private Component right;
 	private Component bottom;
 	private Component top;
+	private Component topLeft;
+	private Component topRight;
+	private Component bottomLeft;
+	private Component bottomRight;
 
 	//{{{ getInsets() method
 	private Insets getInsets(Component parent)
diff --git a/org/gjt/sp/jedit/textarea/SelectionManager.java b/org/gjt/sp/jedit/textarea/SelectionManager.java
index c1f1320..67b86b5 100644
--- a/org/gjt/sp/jedit/textarea/SelectionManager.java
+++ b/org/gjt/sp/jedit/textarea/SelectionManager.java
@@ -90,10 +90,9 @@ class SelectionManager
 	{
 		if(selection != null)
 		{
-			for(int i = 0; i < selection.length; i++)
+			for (Selection s : selection)
 			{
-				Selection s = selection[i];
-				if(s != null)
+				if (s != null)
 					addToSelection(s);
 			}
 		}
diff --git a/org/gjt/sp/jedit/textarea/StandaloneTextArea.java b/org/gjt/sp/jedit/textarea/StandaloneTextArea.java
index 9a0f8bf..0a224a5 100644
--- a/org/gjt/sp/jedit/textarea/StandaloneTextArea.java
+++ b/org/gjt/sp/jedit/textarea/StandaloneTextArea.java
@@ -97,7 +97,7 @@ import org.gjt.sp.util.SyntaxUtilities;
  * @author Slava Pestov
  * @author John Gellene (API documentation)
    @author Matthieu Casanova
- * @version $Id: StandaloneTextArea.java 22357 2012-10-13 04:58:01Z ezust $
+ * @version $Id: StandaloneTextArea.java 23297 2013-10-29 12:32:55Z kpouer $
  */
 public class StandaloneTextArea extends TextArea
 {
@@ -515,13 +515,13 @@ public class StandaloneTextArea extends TextArea
 			"folding",
 			"collapseFolds"
 		};
-		for (int i = 0; i < bufferProperties.length; i++)
+		for (String bufferProperty : bufferProperties)
 		{
-			String value = getProperty("buffer." + bufferProperties[i]);
+			String value = getProperty("buffer." + bufferProperty);
 			if (value == null)
-				buffer.unsetProperty(bufferProperties[i]);
+				buffer.unsetProperty(bufferProperty);
 			else
-				buffer.setProperty(bufferProperties[i], value);
+				buffer.setProperty(bufferProperty, value);
 		}
 		buffer.propertiesChanged();
 	} // }}}
@@ -589,7 +589,7 @@ public class StandaloneTextArea extends TextArea
 	 * The actionSet for standalone textArea.
 	 * @author Matthieu Casanova
 	 */
-	protected static class StandaloneActionSet extends JEditActionSet<JEditBeanShellAction>
+	public static class StandaloneActionSet extends JEditActionSet<JEditBeanShellAction>
 	{
 		private final IPropertyManager iPropertyManager;
 		private final TextArea textArea;
diff --git a/org/gjt/sp/jedit/textarea/TextArea.java b/org/gjt/sp/jedit/textarea/TextArea.java
index 61d70f6..f129067 100644
--- a/org/gjt/sp/jedit/textarea/TextArea.java
+++ b/org/gjt/sp/jedit/textarea/TextArea.java
@@ -39,6 +39,7 @@ import java.awt.*;
 import java.awt.im.InputMethodRequests;
 
 import javax.swing.plaf.metal.MetalLookAndFeel;
+import javax.swing.plaf.LayerUI;
 import javax.swing.text.Segment;
 import javax.swing.text.TabExpander;
 
@@ -70,9 +71,9 @@ import org.gjt.sp.util.ThreadUtilities;
  *
  * @author Slava Pestov
  * @author kpouer (rafactoring into standalone text area)
- * @version $Id: TextArea.java 22670 2013-01-12 12:29:48Z thomasmey $
+ * @version $Id: TextArea.java 23661 2014-08-17 01:12:29Z ezust $
  */
-public abstract class TextArea extends JComponent
+public abstract class TextArea extends JPanel
 {
 	//{{{ TextArea constructor
 	/**
@@ -105,12 +106,14 @@ public abstract class TextArea extends JComponent
 		add(ScrollLayout.LEFT,gutter);
 
 		// some plugins add stuff in a "right-hand" gutter
+		RequestFocusLayerUI reqFocus = new RequestFocusLayerUI();
 		verticalBox = new Box(BoxLayout.X_AXIS);
-		verticalBox.add(vertical = new JScrollBar(Adjustable.VERTICAL));
+		verticalBox.add(new JLayer(
+			vertical = new JScrollBar(Adjustable.VERTICAL), reqFocus));
 		vertical.setRequestFocusEnabled(false);
 		add(ScrollLayout.RIGHT,verticalBox);
-		add(ScrollLayout.BOTTOM,
-			horizontal = new JScrollBar(Adjustable.HORIZONTAL));
+		add(ScrollLayout.BOTTOM, new JLayer(
+			horizontal = new JScrollBar(Adjustable.HORIZONTAL), reqFocus));
 		horizontal.setRequestFocusEnabled(false);
 
 		horizontal.setValues(0,0,0,0);
@@ -2082,8 +2085,8 @@ forward_scan:	do
 				buffer.beginCompoundEdit();
 
 				Selection[] selection = getSelection();
-				for(int i = 0; i < selection.length; i++)
-					newCaret = selection[i].setText(buffer,selectedText);
+				for (Selection aSelection : selection)
+					newCaret = aSelection.setText(buffer, selectedText);
 			}
 			finally
 			{
@@ -4075,10 +4078,12 @@ loop:		for(int i = lineNo - 1; i >= 0; i--)
 				Selection[] selections = getSelection();
 				Selection selection = null;
 				int caretBack = 0;
-				for (int i = 0; i < selections.length; i++)
+				for (Selection selection1 : selections)
 				{
-					selection = selections[i];
-					caretBack = addExplicitFold(selection.start, selection.end, selection.startLine,selection.endLine);
+					selection = selection1;
+					caretBack = addExplicitFold(selection.start,
+						selection.end, selection.startLine,
+						selection.endLine);
 				}
 				// Selection cannot be null because there is at least 1 selection
 				assert selection != null;
@@ -4121,12 +4126,11 @@ loop:		for(int i = lineNo - 1; i >= 0; i--)
 
 		try
 		{
-			for(int i = 0; i < lines.length; i++)
+			for (int line : lines)
 			{
-				String text = getLineText(lines[i]);
-				buffer.insert(getLineStartOffset(lines[i])
-					+ StandardUtilities.getLeadingWhiteSpace(text),
-					comment);
+				String text = getLineText(line);
+				buffer.insert(getLineStartOffset(line) +
+					StandardUtilities.getLeadingWhiteSpace(text), comment);
 			}
 		}
 		finally
@@ -4171,26 +4175,23 @@ loop:		for(int i = lineNo - 1; i >= 0; i--)
 				setCaretPosition(oldCaret + commentStart.length());
 			}
 
-			for(int i = 0; i < selection.length; i++)
+			for (Selection s : selection)
 			{
-				Selection s = selection[i];
-				if(s instanceof Selection.Range)
+				if (s instanceof Selection.Range)
 				{
-					buffer.insert(s.start,commentStart);
-					buffer.insert(s.end,commentEnd);
+					buffer.insert(s.start, commentStart);
+					buffer.insert(s.end, commentEnd);
 				}
-				else if(s instanceof Selection.Rect)
+				else if (s instanceof Selection.Rect)
 				{
-					Selection.Rect rect = (Selection.Rect)s;
+					Selection.Rect rect = (Selection.Rect) s;
 					int start = rect.getStartColumn(buffer);
 					int end = rect.getEndColumn(buffer);
 
-					for(int j = s.startLine; j <= s.endLine; j++)
+					for (int j = s.startLine; j <= s.endLine; j++)
 					{
-						buffer.insertAtColumn(j,end,
-							commentEnd);
-						buffer.insertAtColumn(j,start,
-							commentStart);
+						buffer.insertAtColumn(j, end, commentEnd);
+						buffer.insertAtColumn(j, start, commentStart);
 					}
 				}
 			}
@@ -4226,12 +4227,10 @@ loop:		for(int i = lineNo - 1; i >= 0; i--)
 		{
 			buffer.beginCompoundEdit();
 
-			for(int i = 0; i < selection.length; i++)
+			for (Selection s : selection)
 			{
-				Selection s = selection[i];
-				setSelectedText(s,TextUtilities.format(
-					getSelectedText(s),maxLineLen,
-					buffer.getTabSize()));
+				setSelectedText(s, TextUtilities.format(getSelectedText(s), maxLineLen,
+									buffer.getTabSize()));
 			}
 
 			buffer.endCompoundEdit();
@@ -4312,11 +4311,10 @@ loop:		for(int i = lineNo - 1; i >= 0; i--)
 		}
 		else
 		{
-			for(int i = 0; i < selection.length; i++)
+			for (Selection s : selection)
 			{
-				Selection s = selection[i];
-				setSelectedText(s,TextUtilities.spacesToTabs(
-					getSelectedText(s),buffer.getTabSize()));
+				setSelectedText(s, TextUtilities.spacesToTabs(
+					getSelectedText(s), buffer.getTabSize()));
 			}
 		}
 
@@ -4347,11 +4345,10 @@ loop:		for(int i = lineNo - 1; i >= 0; i--)
 		}
 		else
 		{
-			for(int i = 0; i < selection.length; i++)
+			for (Selection s : selection)
 			{
-				Selection s = selection[i];
 				setSelectedText(s, TextUtilities.tabsToSpaces(
-					getSelectedText(s),buffer.getTabSize()));
+					getSelectedText(s), buffer.getTabSize()));
 			}
 		}
 
@@ -4389,11 +4386,8 @@ loop:		for(int i = lineNo - 1; i >= 0; i--)
 
 		buffer.beginCompoundEdit();
 
-		for(int i = 0; i < selection.length; i++)
-		{
-			Selection s = selection[i];
-			setSelectedText(s,getSelectedText(s).toUpperCase());
-		}
+		for (Selection s : selection)
+			setSelectedText(s, getSelectedText(s).toUpperCase());
 
 		buffer.endCompoundEdit();
 		if (caret != -1)
@@ -4431,11 +4425,8 @@ loop:		for(int i = lineNo - 1; i >= 0; i--)
 
 		buffer.beginCompoundEdit();
 
-		for (int i = 0; i < selection.length; i++)
-		{
-			Selection s = selection[i];
-			setSelectedText(s,getSelectedText(s).toLowerCase());
-		}
+		for (Selection s : selection)
+			setSelectedText(s, getSelectedText(s).toLowerCase());
 
 		buffer.endCompoundEdit();
 		if (caret != -1)
@@ -4458,6 +4449,12 @@ loop:		for(int i = lineNo - 1; i >= 0; i--)
 	} //}}}
 
 	//{{{ insertEnterAndIndent() method
+	/**
+	 * Inserts a line break and indents the new line. Moves the caret to
+	 * the first non-whitespace character of the new line. If the newline
+	 * character is an electric key the current line will also be
+	 * re-indented.
+	 */
 	public void insertEnterAndIndent()
 	{
 		if(!isEditable())
@@ -4469,14 +4466,28 @@ loop:		for(int i = lineNo - 1; i >= 0; i--)
 			{
 				buffer.indentLine(caretLine, true);
 			}
-			
+
 			try
 			{
 				buffer.beginCompoundEdit();
 				setSelectedText("\n");
-				
+
 				if ("full".equals(autoIndent))
-					buffer.indentLine(caretLine, true);
+				{
+					if (!buffer.indentLine(caretLine, true))
+					{
+						// If the line was already correctly indented, the
+						// caret needs to be moved explicitly.
+						if (lineContainsSpaceAndTabs(caretLine))
+						{
+							goToEndOfLine(false);
+						}
+						else
+						{
+							goToStartOfWhiteSpace(false);
+						}
+					}
+				}
 				else if ("simple".equals(autoIndent))
 					buffer.simpleIndentLine(caretLine);
 			}
@@ -4527,20 +4538,17 @@ loop:		for(int i = lineNo - 1; i >= 0; i--)
 			selectNone();
  		}
  	} //}}}
- 	
+
 	//{{{ turnOnElasticTabstops() method
 	/**
 	 * Turn ON elastic tab stops.
 	 */
 	public void turnOnElasticTabstops()
 	{
-		if(!buffer.isEditable())
-			getToolkit().beep();
-		else
-		{	
-			buffer.indentUsingElasticTabstops();
-			buffer.elasticTabstopsOn = true;
-		}
+		if(buffer.isLoading())
+			return;
+		buffer.indentUsingElasticTabstops();
+		buffer.elasticTabstopsOn = true;
 	} //}}}
 
 	//{{{ shiftIndentLeft() method
@@ -4725,7 +4733,7 @@ loop:		for(int i = lineNo - 1; i >= 0; i--)
 	{
 		getInputHandler().processKeyEvent(evt, 1 /* source=TEXTAREA (1) */, false);
 		if(!evt.isConsumed())
-			super.processKeyEvent(evt);	
+			super.processKeyEvent(evt);
 
 	} //}}}
 
@@ -4751,6 +4759,50 @@ loop:		for(int i = lineNo - 1; i >= 0; i--)
 		remove(comp);
 	} //}}}
 
+	//{{{ addTopLeftComponent() method
+	/**
+	 * Adds a component above the gutter.
+	 *
+	 * @since jEdit 5.2pre1
+	 */
+	public void addTopLeftComponent(Component comp)
+	{
+		add(ScrollLayout.TOP_LEFT, comp);
+	} //}}}
+
+	//{{{ addTopRightComponent() method
+	/**
+	 * Adds a component above the vertical scroll bar.
+	 *
+	 * @since jEdit 5.2pre1
+	 */
+	public void addTopRightComponent(Component comp)
+	{
+		add(ScrollLayout.TOP_RIGHT, comp);
+	} //}}}
+
+	//{{{ addBottomLeftComponent() method
+	/**
+	 * Adds a component below the gutter.
+	 *
+	 * @since jEdit 5.2pre1
+	 */
+	public void addBottomLeftComponent(Component comp)
+	{
+		add(ScrollLayout.BOTTOM_LEFT, comp);
+	} //}}}
+
+	//{{{ addBottomLeftComponent() method
+	/**
+	 * Adds a component below the vertical scroll bar.
+	 *
+	 * @since jEdit 5.2pre1
+	 */
+	public void addBottomRightComponent(Component comp)
+	{
+		add(ScrollLayout.BOTTOM_RIGHT, comp);
+	} //}}}
+
 	//{{{ getInputMethodRequests() method
 	@Override
 	public InputMethodRequests getInputMethodRequests()
@@ -4794,24 +4846,24 @@ loop:		for(int i = lineNo - 1; i >= 0; i--)
 	{
 		if(buffer == null)
 			return;
-		
+
 		if(buffer.getBooleanProperty("elasticTabstops"))
 		{
 			//call this only if it was previously off
 			if(!buffer.elasticTabstopsOn)
-			{	
+			{
 				turnOnElasticTabstops();
-			}	
+			}
 			if(buffer.getColumnBlock()!=null)
-			{	
+			{
 				buffer.getColumnBlock().setTabSizeDirtyStatus(true, true);
-			}	
+			}
 		}
 		else
 		{
 			buffer.elasticTabstopsOn = false;
 		}
-		
+
 		int _tabSize = buffer.getTabSize();
 		char[] foo = new char[_tabSize];
 		for(int i = 0; i < foo.length; i++)
@@ -5093,7 +5145,7 @@ loop:		for(int i = lineNo - 1; i >= 0; i--)
 			caretTimer.restart();
 
 			if(!displayManager.isLineVisible(caretLine))
-			{			
+			{
 				// If we've jumped outside of a narrowed display, just reset all
 				// folds to their default level, so that we don't get disconnected
 				// islands of visible lines.
@@ -6106,16 +6158,15 @@ loop:		for(int i = lineNo - 1; i >= 0; i--)
 		{
 			buffer.beginCompoundEdit();
 			int[] lines = getSelectedLines();
-			for(int i = 0; i < lines.length; i++)
+			for (int line : lines)
 			{
-				String text = getLineText(lines[i]);
+				String text = getLineText(line);
 				if (text.trim().length() == 0)
 					continue;
-				buffer.insert(getLineEndOffset(lines[i]) - 1,
-					commentEnd);
-				buffer.insert(getLineStartOffset(lines[i])
-					+ StandardUtilities.getLeadingWhiteSpace(text),
-					commentStart);
+				buffer.insert(getLineEndOffset(line) - 1, commentEnd);
+				buffer.insert(getLineStartOffset(line) +
+					StandardUtilities.getLeadingWhiteSpace(text),
+					      commentStart);
 			}
 		}
 		finally
@@ -6349,7 +6400,7 @@ loop:		for(int i = lineNo - 1; i >= 0; i--)
 				return offset + 1;
 			}
 			return following + index0Offset;
-			
+
 		}
 
 		public int previousOf(int offset)
@@ -6676,6 +6727,34 @@ loop:		for(int i = lineNo - 1; i >= 0; i--)
 		}
 	} //}}}
 
+	//{{{ RequestFocusLayerUI class
+	private class RequestFocusLayerUI extends LayerUI<JComponent>
+	{
+		//{{{ processMouseEvent() method
+		@Override
+		protected void processMouseEvent(MouseEvent e, JLayer<? extends JComponent> l)
+		{
+			if (e.getID() == MouseEvent.MOUSE_PRESSED)
+			{
+				requestFocus();
+			}
+		} //}}}
+
+		//{{{ installUI() method
+		@Override
+		public void installUI(JComponent c) {
+			super.installUI(c);
+			((JLayer)c).setLayerEventMask(AWTEvent.MOUSE_EVENT_MASK);
+		} //}}}
+
+		//{{{ uninstallUI() method
+		@Override
+		public void uninstallUI(JComponent c) {
+			super.uninstallUI(c);
+			((JLayer)c).setLayerEventMask(0);
+		} //}}}
+	} //}}}
+
 	//}}}
 
 	//{{{ Class initializer
@@ -6698,7 +6777,7 @@ loop:		for(int i = lineNo - 1; i >= 0; i--)
 		structureTimer.setRepeats(false);
 	} //}}}
 
-	public TabExpander getTabExpander() 
+	public TabExpander getTabExpander()
 	{
 		if(buffer.getBooleanProperty("elasticTabstops"))
 		{
diff --git a/org/gjt/sp/jedit/textarea/TextAreaDropHandler.java b/org/gjt/sp/jedit/textarea/TextAreaDropHandler.java
index e18b4be..d6fe1b9 100644
--- a/org/gjt/sp/jedit/textarea/TextAreaDropHandler.java
+++ b/org/gjt/sp/jedit/textarea/TextAreaDropHandler.java
@@ -24,6 +24,7 @@ package org.gjt.sp.jedit.textarea;
 
 //{{{ Imports
 import javax.swing.*;
+import java.awt.datatransfer.DataFlavor;
 import java.awt.dnd.*;
 import java.awt.*;
 import org.gjt.sp.jedit.buffer.JEditBuffer;
@@ -32,7 +33,7 @@ import org.gjt.sp.util.Log;
 
 /**
  * @author Slava Pestov
- * @version $Id: TextAreaDropHandler.java 21831 2012-06-18 22:54:17Z ezust $
+ * @version $Id: TextAreaDropHandler.java 23322 2013-11-07 13:47:32Z kpouer $
  */
 class TextAreaDropHandler extends DropTargetAdapter
 {
@@ -60,6 +61,8 @@ class TextAreaDropHandler extends DropTargetAdapter
 	@Override
 	public void dragOver(DropTargetDragEvent dtde)
 	{
+		if (!dtde.isDataFlavorSupported(DataFlavor.stringFlavor))
+			return;
 		Point p = dtde.getLocation();
 		p = SwingUtilities.convertPoint(textArea,p,
 			textArea.getPainter());
diff --git a/org/gjt/sp/jedit/textarea/TextAreaPainter.java b/org/gjt/sp/jedit/textarea/TextAreaPainter.java
index d680de0..3fca5ce 100644
--- a/org/gjt/sp/jedit/textarea/TextAreaPainter.java
+++ b/org/gjt/sp/jedit/textarea/TextAreaPainter.java
@@ -3,7 +3,8 @@
  * :tabSize=4:indentSize=4:noTabs=false:
  * :folding=explicit:collapseFolds=1:
  *
- * Copyright (C) 1999, 2005 Slava Pestov
+ * Copyright (C) 1999-2013 Slava Pestov, Shlomy Reinstein
+ * Matthieu Casanova, Kazutoshi Satoda, Alan Ezust, Dale Anson  
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -54,7 +55,7 @@ import org.gjt.sp.util.Log;
  * @see TextArea
  *
  * @author Slava Pestov
- * @version $Id: TextAreaPainter.java 23084 2013-07-27 16:11:13Z ezust $
+ * @version $Id: TextAreaPainter.java 23832 2015-01-24 03:26:47Z ezust $
  */
 public class TextAreaPainter extends JComponent implements TabExpander
 {
@@ -628,7 +629,7 @@ public class TextAreaPainter extends JComponent implements TabExpander
 
 	//{{{ setAntiAliasEnabled() method
 	/**
-	 * As of jEdit 4.3pre4, a new JDK 1.6 subpixel antialias mode is supported.
+	 * As of jEdit 4.3, subpixel antialias mode is supported.
 	 *
 	 * @since jEdit 4.2pre4
 	 */
@@ -1229,7 +1230,7 @@ public class TextAreaPainter extends JComponent implements TabExpander
 				return;
 
 			float x = indent = textArea.getHorizontalOffset();
-			float baseLine = y + fm.getHeight() -
+			float baseLine = y + getLineHeight() -
 				(fm.getLeading()+1) - fm.getDescent();
 
 			DefaultTokenHandler tokenHandler = new DefaultTokenHandler();
diff --git a/org/gjt/sp/jedit/textarea/package.html b/org/gjt/sp/jedit/textarea/package.html
index 8eee6e2..fa2783d 100644
--- a/org/gjt/sp/jedit/textarea/package.html
+++ b/org/gjt/sp/jedit/textarea/package.html
@@ -11,7 +11,6 @@ is an attempt to make an API partition for the standalone text area. So for exam
 <li> @ref TextArea and @ref JEditTextArea were split. </li>
 <li> @ref StandaloneTextArea is a new class for other open source Java applications to reuse. 
 <li> @ref JEditEmbeddedTextArea is a new class for jEdit plugins to reuse. </li>
-</li>
 </ul>
 
 <h2> Keeping things separate </h2>
@@ -24,6 +23,5 @@ we should only use classes from that set.
 <p> To build the standalone textarea, "ant build-textArea", and you'll quickly see if you
 broke something by using a class that was not supposed to be used. </p>
 
-</p>
 </body>
 </html>
diff --git a/org/gjt/sp/util/IOUtilities.java b/org/gjt/sp/util/IOUtilities.java
index a1f4265..ebb72a8 100644
--- a/org/gjt/sp/util/IOUtilities.java
+++ b/org/gjt/sp/util/IOUtilities.java
@@ -29,7 +29,7 @@ import javax.annotation.Nullable;
  * IO tools that depend on JDK only.
  *
  * @author Matthieu Casanova
- * @version $Id: IOUtilities.java 22995 2013-05-17 09:27:17Z kpouer $
+ * @version $Id: IOUtilities.java 23221 2013-09-29 20:03:32Z shlomy $
  * @since 4.3pre5
  */
 public class IOUtilities
@@ -150,10 +150,8 @@ public class IOUtilities
 			File[] files = file.listFiles();
 			if (files != null)
 			{
-				for (int i = 0; i < files.length; i++)
-				{
-					length += fileLength(files[i]);
-				}
+				for (File f : files)
+					length += fileLength(f);
 			}
 		}
 		return length;
@@ -161,115 +159,6 @@ public class IOUtilities
 
 	//{{{ closeQuietly() methods
 	/**
-	 * Method that will close an {@link InputStream} ignoring it if it is null and ignoring exceptions.
-	 * @deprecated we want to remove this method without breaking compatibility
-	 * with your plugin. Closeable works for this type as of Java5.
-	 * @see #closeQuietly(Closeable)
-	 * @param in the InputStream to close.
-	 */
-	@Deprecated
-	public static void closeQuietly(@Nullable InputStream in)
-	{
-		if(in != null)
-		{
-			try
-			{
-				in.close();
-			}
-			catch (IOException e)
-			{
-				//ignore
-			}
-		}
-	}
-
-	/**
-	 * Method that will close an {@link OutputStream} ignoring it if it is null and ignoring exceptions.
-	 * @deprecated we want to remove this method without breaking compatibility
-	 * with your plugin. Closeable works for this type as of Java5.
-	 * @see #closeQuietly(Closeable)
-	 * @param out the OutputStream to close.
-	 */
-	@Deprecated
-	public static void closeQuietly(@Nullable OutputStream out)
-	{
-		if(out != null)
-		{
-			try
-			{
-				out.flush();
-			}
-			catch (IOException e)
-			{
-				// ignore
-			}
-			try
-			{
-				out.close();
-			}
-			catch (IOException e)
-			{
-				//ignore
-			}
-		}
-	}
-
-	/**
-	 * Method that will close an {@link Reader} ignoring it if it is null and ignoring exceptions.
-	 * @deprecated we want to remove this method without breaking compatibility
-	 * with your plugin. Closeable works for this type as of Java5.
-	 * @see #closeQuietly(Closeable)
-	 * @param r the Reader to close.
-	 * @since jEdit 4.3pre5
-	 */
-	@Deprecated
-	public static void closeQuietly(@Nullable Reader r)
-	{
-		if(r != null)
-		{
-			try
-			{
-				r.close();
-			}
-			catch (IOException e)
-			{
-				//ignore
-			}
-		}
-	}
-
-	/**
-	 * Method that will close a {@link Writer} ignoring it if it is null and ignoring exceptions.
-	 * @deprecated we want to remove this method without breaking compatibility
-	 * with your plugin. Closeable works for this type as of Java5.
-	 * @see #closeQuietly(Closeable)
-	 * @param out the Writer to close.
-	 */
-	@Deprecated
-	public static void closeQuietly(@Nullable Writer out)
-	{
-		if(out != null)
-		{
-			try
-			{
-				out.flush();
-			}
-			catch (IOException e)
-			{
-				// ignore
-			}
-			try
-			{
-				out.close();
-			}
-			catch (IOException e)
-			{
-				//ignore
-			}
-		}
-	}
-
-	/**
 	 * Method that will close a {@link java.io.Closeable} ignoring it if it is null and ignoring exceptions.
 	 *
 	 * @param closeable the closeable to close.
diff --git a/org/gjt/sp/util/Log.java b/org/gjt/sp/util/Log.java
index a7be609..64e26e8 100644
--- a/org/gjt/sp/util/Log.java
+++ b/org/gjt/sp/util/Log.java
@@ -58,7 +58,7 @@ import static java.text.DateFormat.MEDIUM;
  * to the log, see {@link #init}.
  *
  * @author Slava Pestov
- * @version $Id: Log.java 22935 2013-04-17 17:24:33Z ezust $
+ * @version $Id: Log.java 23221 2013-09-29 20:03:32Z shlomy $
  */
 public class Log
 {
@@ -141,10 +141,9 @@ public class Log
 			"os.arch", "user.home", "java.home",
 			"java.class.path",
 			};
-		for(int i = 0; i < props.length; i++)
+		for (String prop : props)
 		{
-			log(MESSAGE,Log.class,
-				props[i] + '=' + System.getProperty(props[i]));
+			log(MESSAGE, Log.class, prop + '=' + System.getProperty(prop));
 		}
 	} //}}}
 
@@ -490,24 +489,20 @@ public class Log
 		//{{{ fireIntervalAdded() method
 		private void fireIntervalAdded(int index1, int index2)
 		{
-			for(int i = 0; i < listeners.size(); i++)
+			for (ListDataListener listener : listeners)
 			{
-				ListDataListener listener = listeners.get(i);
 				listener.intervalAdded(new ListDataEvent(this,
-					ListDataEvent.INTERVAL_ADDED,
-					index1,index2));
+					ListDataEvent.INTERVAL_ADDED, index1, index2));
 			}
 		} //}}}
 
 		//{{{ fireIntervalRemoved() method
 		private void fireIntervalRemoved(int index1, int index2)
 		{
-			for(int i = 0; i < listeners.size(); i++)
+			for (ListDataListener listener : listeners)
 			{
-				ListDataListener listener = listeners.get(i);
-				listener.intervalRemoved(new ListDataEvent(this,
-					ListDataEvent.INTERVAL_REMOVED,
-					index1,index2));
+				listener.intervalRemoved(new ListDataEvent(
+					this, ListDataEvent.INTERVAL_REMOVED, index1, index2));
 			}
 		} //}}}
 
diff --git a/org/gjt/sp/util/PropertiesBean.java b/org/gjt/sp/util/PropertiesBean.java
index c9882ab..2ac4adb 100644
--- a/org/gjt/sp/util/PropertiesBean.java
+++ b/org/gjt/sp/util/PropertiesBean.java
@@ -92,18 +92,18 @@ public abstract class PropertiesBean
 		try
 		{
 			PropertyDescriptor[] _props = getPropertyDescriptors();
-			for (int i = 0; i < _props.length; i++)
+			for (PropertyDescriptor prop : _props)
 			{
-				if ("class".equals(_props[i].getName()))
+				if ("class".equals(prop.getName()))
 					continue;
 
-				Method _set = _props[i].getWriteMethod();
+				Method _set = prop.getWriteMethod();
 				if (_set != null)
 				{
-					String _pname = root + "." + _props[i].getName();
+					String _pname = root + "." + prop.getName();
 					Object _val = p.getProperty(_pname);
 					if (_val != null)
-						_val = parse((String)_val, _props[i].getPropertyType());
+						_val = parse((String) _val, prop.getPropertyType());
 					try
 					{
 						_set.invoke(this, _val);
@@ -132,20 +132,17 @@ public abstract class PropertiesBean
 		try
 		{
 			PropertyDescriptor[] _props = getPropertyDescriptors();
-			for (int i = 0; i < _props.length; i++)
+			for (PropertyDescriptor prop : _props)
 			{
-				if ("class".equals(_props[i].getName()))
-					continue;
+				if ("class".equals(prop.getName())) continue;
 
-				Method _get = _props[i].getReadMethod();
+				Method _get = prop.getReadMethod();
 				if (_get != null)
 				{
 					Object _val = _get.invoke(this);
-					String _pname = root + "." + _props[i].getName();
-					if (_val != null)
-						p.setProperty(_pname, encode(_val));
-					else
-						p.remove(_pname);
+					String _pname = root + "." + prop.getName();
+					if (_val != null) p.setProperty(_pname, encode(_val));
+					else p.remove(_pname);
 				}
 			}
 		}
@@ -167,12 +164,11 @@ public abstract class PropertiesBean
 		try
 		{
 			PropertyDescriptor[] _props = getPropertyDescriptors();
-			for (int i = 0; i < _props.length; i++)
+			for (PropertyDescriptor prop : _props)
 			{
-				if ("class".equals(_props[i].getName()))
-					continue;
+				if ("class".equals(prop.getName())) continue;
 
-				String _pname = root + "." + _props[i].getName();
+				String _pname = root + "." + prop.getName();
 				p.remove(_pname);
 			}
 		}
diff --git a/org/gjt/sp/util/StandardUtilities.java b/org/gjt/sp/util/StandardUtilities.java
index 22994c2..e99dadc 100644
--- a/org/gjt/sp/util/StandardUtilities.java
+++ b/org/gjt/sp/util/StandardUtilities.java
@@ -40,7 +40,7 @@ import java.util.Stack;
  * Several tools that depends on JDK only.
  *
  * @author Matthieu Casanova
- * @version $Id: StandardUtilities.java 22936 2013-04-19 13:26:30Z kpouer $
+ * @version $Id: StandardUtilities.java 23381 2013-12-09 12:43:14Z kpouer $
  * @since 4.3pre5
  */
 public class StandardUtilities
@@ -490,7 +490,9 @@ loop:		for(int i = 0; i < str.length(); i++)
 	 * Returns if two strings are equal. This correctly handles null pointers,
 	 * as opposed to calling <code>o1.equals(o2)</code>.
 	 * @since jEdit 4.3pre6
+	 * @deprecated use {java.util.Objects#equals(Object, Object}
 	 */
+	@Deprecated
 	public static boolean objectsEqual(@Nullable Object o1, @Nullable Object o2)
 	{
 		if(o1 == null)
diff --git a/org/gjt/sp/util/StringList.java b/org/gjt/sp/util/StringList.java
index c31cdf0..3a7de92 100644
--- a/org/gjt/sp/util/StringList.java
+++ b/org/gjt/sp/util/StringList.java
@@ -49,10 +49,8 @@ public class StringList extends ArrayList<String>
 	// {{{ addAll()
 	public void addAll(Object[] array)
 	{
-		for (int i = 0; i < array.length; ++i)
-		{
-			add(array[i].toString());
-		}
+		for (Object element : array)
+			add(element.toString());
 	}   // }}}
 
 	// {{{ split()
diff --git a/org/gjt/sp/util/StringModel.java b/org/gjt/sp/util/StringModel.java
index 2fb9f9f..4e7adea 100644
--- a/org/gjt/sp/util/StringModel.java
+++ b/org/gjt/sp/util/StringModel.java
@@ -32,11 +32,8 @@ public class StringModel
 	void fireTextChanged()
 	{
 		TextEvent te = new TextEvent(this, TextEvent.TEXT_VALUE_CHANGED);
-		Iterator<TextListener> itr = listeners.iterator();
-		while (itr.hasNext())
-		{
-			itr.next().textValueChanged(te);
-		}
+		for (TextListener listener : listeners)
+			listener.textValueChanged(te);
 	}
 
 	public String toString()
diff --git a/org/jedit/core/FileOpenerService.java b/org/jedit/core/FileOpenerService.java
index 38302d4..5d17397 100644
--- a/org/jedit/core/FileOpenerService.java
+++ b/org/jedit/core/FileOpenerService.java
@@ -1,6 +1,6 @@
 /* FileOpenerService.java
  * :tabSize=4:indentSize=4:noTabs=false:
- * :folding=explicit:collapseFolds=1:
+ * :folding=sidekick:collapseFolds=1:
  *
  * Copyright © 2012 Alan Ezust
  *
diff --git a/org/jedit/keymap/EmacsUtil.java b/org/jedit/keymap/EmacsUtil.java
new file mode 100644
index 0000000..f857ead
--- /dev/null
+++ b/org/jedit/keymap/EmacsUtil.java
@@ -0,0 +1,393 @@
+package org.jedit.keymap;
+
+import java.lang.Character;
+import java.lang.StringBuffer;
+
+import org.gjt.sp.jedit.Buffer;
+import org.gjt.sp.jedit.EditAction;
+import org.gjt.sp.jedit.Registers;
+import org.gjt.sp.jedit.gui.HistoryModel;
+import org.gjt.sp.jedit.gui.InputHandler;
+import org.gjt.sp.jedit.jEdit;
+import org.gjt.sp.jedit.textarea.Selection;
+import org.gjt.sp.jedit.textarea.TextArea;
+
+/** Emacs Macro utility functions. 
+
+	These functions are based on EmacsUtil.bsh from the Emacs macros 
+	by Brian M. Clapper.
+	Rewritten in Java by Alan Ezust in 2013.
+*/
+
+public class EmacsUtil {
+	Buffer buffer; 
+	TextArea textArea;
+	
+	public EmacsUtil() {
+		buffer =  jEdit.getActiveView().getBuffer();
+		textArea = jEdit.getActiveView().getTextArea();
+	}
+	
+
+	public void emacsKillLine()
+	{
+		boolean lastActionWasThis = repeatingSameMacro ("Emacs/Emacs_Kill_Line");
+	
+		int caret = textArea.getCaretPosition();		
+		int caretLine = textArea.getCaretLine();
+		int lineStart = textArea.getLineStartOffset (caretLine);
+		int lineEnd = textArea.getLineEndOffset (caretLine);					
+		
+		// If we're at the end of line (ignoring any trailing white space),
+		// then kill the newline, too.
+		int caret2 = caret + 1;		
+		while (caret2 < lineEnd)
+		{
+			char ch = charAt (caret2);
+			
+			if (! Character.isWhitespace (ch))
+				break;
+	
+			caret2++;
+		}
+	
+		String deletedText = null;
+		Selection selection = null;
+	
+		if (caret2 == lineEnd)
+		{
+			// We're at the end of the line. Join this line and the next line--but
+			// do it with a true delete, not with textArea.joinLines(), to
+			// emulate emacs better.
+	
+			if (caretLine != textArea.getLastPhysicalLine())
+				selection = new Selection.Range (caret, caret2);
+		}
+	
+		else
+		{
+			// Simple delete to end of line.
+	
+			selection = new Selection.Range (caret, lineEnd - 1);
+			//textArea.deleteToEndOfLine();
+		}
+	
+		if (selection != null)
+		{
+			textArea.setSelection (selection);
+			deletedText = textArea.getSelectedText();
+			textArea.replaceSelection ("");
+			textArea.removeFromSelection (selection);
+	
+			if (lastActionWasThis)
+			{
+				String clipboard = getClipboard();
+				if (clipboard == null)
+					clipboard = "";
+	
+				setClipboard (clipboard + deletedText);
+			}	
+			else
+			{
+				setClipboard (deletedText);
+			}
+		}
+	}
+
+
+
+	public boolean repeatingSameMacro (String macroName)
+	{
+		InputHandler ih = jEdit.getActiveView().getInputHandler();
+		EditAction lastAction = ih.getLastAction();
+		int lastActionCount = ih.getLastActionCount();
+		
+		// When called from within a macro, the last action will be that macro.
+		// But, if the last action count is greater than 1, then it's a repeat.
+	
+		boolean repeat = false;
+		if ( (lastAction.getName().equals (macroName)) && (lastActionCount > 1) )
+			repeat = true;
+		
+		return repeat;
+	}
+	
+	public String lineAt (int i)
+	{
+		StringBuilder sb = new StringBuilder();
+		
+		while (! atEndOfBuffer (i))
+		{
+			char c = charAt (i);
+			sb.append(c);
+			if (c == '\n')
+				break;
+		}
+		
+		return sb.toString();
+	}
+	
+	public char charAt (int i)
+	{
+		if (i >= buffer.getLength()) return 0;
+		return buffer.getText (i, 1).charAt (0);
+	}
+	
+	public char charAtCaret()
+	{
+		int caret = textArea.getCaretPosition();
+		return (atEndOfBuffer() ? '\0' : buffer.getText (caret, 1).charAt (0));
+	}
+	
+	public boolean atEndOfBuffer()
+	{
+		TextArea textArea = jEdit.getActiveView().getTextArea();
+		return atEndOfBuffer (textArea.getCaretPosition());
+	}
+	
+	public boolean atEndOfBuffer (int caret)
+	{
+		return (caret >= buffer.getLength());
+	}
+	
+	public int eatNonAlphanums()
+	{
+		boolean eat = true;
+		
+		while (eat)
+		{
+			char ch = charAtCaret();
+			
+			if (ch == '\n')
+			{
+				textArea.goToNextLine (false);
+				textArea.goToStartOfLine (false);
+			}
+			
+			else
+			{
+				if (Character.isLetterOrDigit (ch))
+					eat = false;
+				
+				else
+					textArea.goToNextCharacter (false);
+			}
+		}
+		
+		return textArea.getCaretPosition();
+	}
+		   
+	public int eatWhitespace()
+	{
+		boolean eat = true;
+		
+		while (eat)
+		{
+			char ch = charAtCaret();
+			
+			if (ch == '\n')
+			{
+				textArea.goToNextLine (false);
+				textArea.goToStartOfLine (false);
+			}
+			
+			else if (Character.isWhitespace (ch))
+			{
+				textArea.goToNextCharacter (false);
+			}
+	
+			else
+			{
+				eat = false;
+			}
+		}
+		
+		return textArea.getCaretPosition();
+	}
+	
+	public int getCardinalProperty (String name, int defaultValue)
+	{
+		int result = jEdit.getIntegerProperty (name, defaultValue);
+	
+		if (result <= 0)
+			result = defaultValue;
+		
+		return result;
+	}
+	
+	public String makeBufferPropertyName (String prefix)
+	{	
+		return makeBufferPropertyName (buffer, prefix);
+	}
+	
+	public String makeBufferPropertyName (Buffer theBuffer, String prefix)
+	{
+		StringBuilder propName = new StringBuilder(prefix);
+	
+		// Convert any Windows-style file separators to Unix ones, since
+		// backslashes are special characters in properties files.
+	
+		String fileSep = System.getProperty ("file.separator");
+		String bufName;
+		if (! fileSep.equals ("/"))
+		{
+			// Backslash is also special in regular expressions. Since, in theory,
+			// the file separator could be *anything*, we check explicitly for
+			// backslash here.
+			if (fileSep.equals ("\\"))
+				fileSep = fileSep + "\\";	
+			bufName = theBuffer.getPath().replaceAll (fileSep, "/");
+		}
+		else
+		{
+			bufName = theBuffer.getPath();
+		}
+		propName.append (bufName);
+		return propName.toString();
+	}
+	
+	public int getDefaultWrap()
+	{
+		return getCardinalProperty ("buffer.maxLineLen", 79);
+	}
+	
+	public int getMark (Buffer buffer)
+	{
+		String propName = makeBufferPropertyName ("emacs.mark");
+		int mark = getCardinalProperty (propName, -1);
+		if (mark != -1)
+		{
+			if (mark >= buffer.getLength())
+				mark = buffer.getLength() - 1;
+		}
+		return mark;
+	}
+	
+	public void setMark (Buffer buffer, int pos)
+	{
+		String propName = makeBufferPropertyName (buffer, "emacs.mark");
+		jEdit.setTemporaryProperty (propName, String.valueOf (pos));
+	}
+	
+	public void beep()
+	{
+		jEdit.getActiveView().getToolkit().beep();
+	}
+	
+	public Selection getKillRegion()
+	{
+		// If there's a selection, use it instead.
+		int caret = textArea.getCaretPosition();
+		Selection selection = textArea.getSelectionAtOffset (caret);
+		if (selection == null)
+		{
+			int mark = getMark (buffer);
+			if (mark == -1)
+			{
+				beep();
+				return null;
+			}
+	
+			selection = new Selection.Range (Math.min (caret, mark),
+											 Math.max (caret, mark));
+			textArea.setSelection (selection);
+		}
+	
+		return selection;
+	}
+	
+	public String getClipboard()
+	{
+		return Registers.getRegister ('$').toString();
+	}
+	
+	public void setClipboard (String string)
+	{
+		Registers.setRegister ('$', string);
+	}
+	
+	public void setClipboard (Selection selection)
+	{
+		TextArea textArea = jEdit.getActiveView().getTextArea();
+		setClipboard (textArea.getSelectedText (selection));
+	}
+	
+	public void addToClipboardAndHistory (String string)
+	{
+		// The special register '$' is the clipboard.
+	
+		setClipboard (string);
+		
+		// Save the text in the history, too.
+		
+		HistoryModel.getModel ("clipboard").addItem (string);
+	}
+	
+	public void addToClipboardAndHistory (Selection selection)
+	{
+		addToClipboardAndHistory (textArea.getSelectedText (selection));
+	}
+	
+	public int findEndOfSentence()
+	{
+		int caret = textArea.getCaretPosition();
+	
+		for (;;)
+		{
+			if (atEndOfBuffer (caret))
+				break;
+	
+			char ch = charAt (caret);
+			if (ch == '.')
+			{
+				if (Character.isWhitespace (charAt (caret + 1)))
+				{
+					caret++;
+					break;
+				}
+			}
+	
+			caret++;
+		}
+		
+		return caret;
+	}
+	
+	public int findBeginningOfSentence()
+	{
+		int caret = textArea.getCaretPosition() - 1;
+		if (charAt (caret) == '.')
+			caret--;
+	
+		for (;;)
+		{
+			if (caret <= 0)
+				break;
+	
+			char ch = charAt (caret);
+			if (ch == '.')
+			{
+				if (Character.isWhitespace (charAt (caret + 1)))
+				{
+					caret++;
+					break;
+				}
+			}
+			
+			else if (Character.isUpperCase (ch))
+			{
+				caret--;
+				if (caret <= 0)
+					break;
+				if (Character.isWhitespace (charAt (caret)))
+					break;
+			}
+	
+			caret--;
+		}
+		
+		return caret;
+	}
+}
+
+   
\ No newline at end of file
diff --git a/org/jedit/localization/jedit_cs.props b/org/jedit/localization/jedit_cs.props
index dd5fa8c..d940ec6 100644
--- a/org/jedit/localization/jedit_cs.props
+++ b/org/jedit/localization/jedit_cs.props
@@ -1731,6 +1731,8 @@ helpviewer.title=jEdit Pomoc
 helpviewer.loading=Načítání...
 helpviewer.back.label=Zpět
 helpviewer.forward.label=Dopředu
+# FIXME: no translation
+helpviewer.copy-link.label=Copy link to clipboard
 
 helpviewer.toc.loading=Načítání...
 helpviewer.toc.label=Obsah
@@ -2127,8 +2129,7 @@ macro.rs.CutLinesContaining.LinesCut.message=řadka/y vyjmuta
 #{{{ Editing
 
 #{{{ Go to column
-macro.rs.GoToColumn.ColumnBefore.label=Sloupec (mezi 1 a
-macro.rs.GoToColumn.ColumnAfter.label=):
+macro.rs.GoToColumn.label=Sloupec (mezi 1 a {0}):
 #}}}
 
 #{{{ Key Words to Uppercase
diff --git a/org/jedit/localization/jedit_de.props b/org/jedit/localization/jedit_de.props
index caab517..f58673c 100644
--- a/org/jedit/localization/jedit_de.props
+++ b/org/jedit/localization/jedit_de.props
@@ -14,6 +14,7 @@
 ###                                        jedit_en.props (Revision 22535).
 ###                                      - About 330 labels newly translated, many are new
 ###                                        in jEdit 5, but some may have been missed before.
+###    21.11.2013  R. Schwenn  5.0.1.2   - Update for jEdit 5.1
 ###}}}
 ###
 ###{{{ Notes
@@ -81,6 +82,7 @@ common.moveDown=Nach unten
 common.clearAll=Alle löschen
 common.selectAll=Alle wählen
 common.selectNone=Nichts wählen
+common.loading=Lade...
 
 #lineSep.unix=Unix (\\n).
 #lineSep.windows=DOS/Windows (\\r\\n).
@@ -145,7 +147,7 @@ closeall-bufferset.label=Alle schließen
 closeall-bufferset.tooltip=Alle Dateien des aktiven Dateisatzes schließen
 bufferset-toggle-exclusive.label=$Exclusive Dateisätze Ein/Aus
 bufferset-toggle-exclusive.tooltip=Wenn eine Datei geöffnet wird, soll sie in anderen nicht überlappenden Dateisätzen geschlossen werden
-close-all.label=Alle sc$hließen
+close-all.label=Alle sc$hließen (global)
 close-all.tooltip=Alle Dateien in allen Ansichten schließen.
 save.label=$Speichern
 save-as.label=Speichern $unter...
@@ -568,7 +570,7 @@ view.gutter.marker=Lesezeichen: {0}
 view.status.add-marker=Kürzel für neues Lesezeichen? [{0}]
 view.status.auto-wrap=Suchtext nicht gefunden; Es geht am anderen Ende weiter!
 view.status.bracket=Passende Klammer in Zeile {0}: {1}
-view.status.caret-tooltip=Position der Einfügemarke (Absolut,Zeile,Spalte relativ%)
+view.status.caret-tooltip=Zeile, Spalte[-virtuell] (Offset/Länge)
 view.status.copy-append-string-register=Kopieren/Anhängen an Register? [{0}]
 view.status.copy-string-register=Kopieren in Register? [{0}]
 view.status.cut-append-string-register=Ausschneiden/Anhängen an Register? [{0}]
@@ -1245,7 +1247,7 @@ view.title.select=Bitte einen Namen für diese Ansicht eingeben:
 #{{{ Buffer options dialog
 buffer-options.title=Datei-Optionen
 buffer-options.caption=Die Einstellungen dieses Dialoges gelten nur für die aktive Datei.\n\
-  Editorweite Einstellungen werden im Dialog Extras->Globale Optionen getroffen.
+  Editorweite Einstellungen werden unter Globale Optionen->Bearbeiten getroffen.
 buffer-options.loading-saving=Laden und Speichern
 buffer-options.lineSeparator=Zeilenendezeichen:
 buffer-options.encoding=Zeichenkodierung:
@@ -1390,7 +1392,7 @@ options.editing.noWordSep=Zusätzliche Wortzeichen:
 options.editing.camelCasedWords="CamelCased" Worte trennen
 options.editing.noTabs=Soft-Tabs (Leerzeichen statt Tabulatoren einfügen)
 options.editing.elasticTabstops=Einrückung unter Verwendung elastischer Tabulatoren
-options.editing.elasticTabstops.tooltip=(Experimentell) - Könnte jEdit instabil werden lassen.
+options.editing.elasticTabstops.tooltip=Spalten in Zeilen über und unter einer "Zelle" bleiben ausgerichtet auf Tab-Stops, die in Abhängigkeit der "Zellen"-Breite angepasst werden.
 options.editing.deepIndent=Tiefe Einrückung
 options.editing.autoIndent=Automatische Einrückung
 options.editing.largefilemode.title=Modus für große Dateien
@@ -1410,10 +1412,8 @@ options.encodings.label=Zeichenkodierungen
 options.encodings.selectEncodings=Zeichenkodierungen, die in entsprechenden Dialogen zur Auswahl stehen sollen:
 options.encodings.available=Verfügbare Zeichenkodierungen
 options.encodings.selected=Gewählte Zeichenkodierung(en)
-options.encodings.available.tooltip=<html>Zeichenkodierungen in dieser Spalte werden <b>nicht</b> in Zeichenkodierungs-Dialogen gelistet. \
-  Zum Aktivieren in die rechte Spalte ziehen!</html>
-options.encodings.selected.tooltip=Zeichenkodierungen in dieser Spalte werden in Zeichenkodierungs-Dialogen gelistet. \
-  Zum Deaktivieren in die linke Spalte ziehen!
+options.encodings.available.tooltip=<html>Zeichenkodierungen in dieser Spalte werden <b>nicht</b> in Zeichenkodierungs-Auswahlboxen gelistet. Zum Anzeigen in die rechte Spalte ziehen!</html>
+options.encodings.selected.tooltip=Zeichenkodierungen in dieser Spalte werden in Zeichenkodierungs-Auswahlboxen gelistet. Zum Verstecken in die linke Spalte ziehen!
 #}}}
 
 #{{{ Gutter pane
@@ -1450,6 +1450,7 @@ options.mouse.dragAndDrop=Drag & Drop im Textbereich
 options.mouse.joinNonWordChars=Ziehen nach Doppelklick erweitert Auswahl über Sonderzeichen
 options.mouse.middleMousePaste=Schnelles Kopieren mit mittlerer Maustaste
 options.mouse.ctrlForRectangularSelection=Spaltenauswahl, solange STRG gedrückt ist
+options.mouse.singleClickToOpen=Dateien und Ordner mit einfachem Klick öffnen
 options.mouse.gutter.foldClick=Klick ins Gutter:
 options.mouse.gutter.SfoldClick=Umschalt-Klick ins Gutter:
 options.mouse.gutter.toggle-fold=Falte ein-/ausklappen
@@ -1469,6 +1470,8 @@ options.plugin-manager.app-dir=jEdit Programm-Verzeichnis
 options.plugin-manager.none=Plugin Central Standard
 options.plugin-manager.disable-obsolete=Veraltete Plugins deaktivieren
 options.plugin-manager.list-cache.minutes=Plugin-Liste zwischenspeichern für (Minuten):
+options.plugin-manager.no-plugin-available=Kein Plugin verfügbar
+options.plugin-manager.no-plugin-uptodate=Alle Plugins sind auf aktuellem Stand.
 #}}}
 
 #{{{ Printing pane
@@ -1536,6 +1539,7 @@ options.shortcuts.label=Tastenkürzel
 options.shortcuts.select.label=Tastenkürzel bearbeiten:
 options.shortcuts.select.tooltip=Filter für: Eingebaute Befehle, Makros, Plugin-Befehle, Dock-Layouts
 options.shortcuts.name=Befehl
+options.shortcuts.actionset=Befehlssatz
 options.shortcuts.shortcut1=Primäres Tastenkürzel
 options.shortcuts.shortcut2=Alternatives Tastenkürzel
 options.shortcuts.filter.label=Filter:
@@ -1637,6 +1641,7 @@ options.textarea.fracFontMetrics.tooltip=Nicht empfohlen mit Subpixel-Kantenglä
 options.textarea.stripTrailingEOL=Letztes Zeilenende verstecken (falls vorhanden)
 options.textarea.completeFromAllBuffers=Wort-Vervollständigung von allen offenen Dateien (Standard ist \
     die Suche auf alle gerade sichtbaren Dateien zu begrenzen)
+options.textarea.insertCompletionWithDigit=Wort vervollständigen durch Tippen der korrespondierenden Ziffer (ansonsten wird die Ziffer als Teil des Wortes angesehen). 
 options.textarea.lineSpacing.label=Zusätzlicher vertikaler Zeilenabstand (in Pixel):
 #}}}
 
@@ -1669,6 +1674,7 @@ options.view.viewLayout=Ansichtslayout
 options.view.floatableToolbars=Frei positionierbare Symbolleisten
 options.view.alternateDockingLayout=Alternatives Dock-Layout
 options.view.alternateToolBarLayout=Alternatives Symbolleisten-Layout
+options.view.abbreviatePaths=Pfade mit Namen von Umgebungsvariablen abkürzen, wenn möglich
 options.view.showFullPath=Zeige vollständigen Dateipfad in der Titelleiste
 options.view.showSearchbar=Suchzeile immer anzeigen
 options.view.beepOnSearchAutoWrap=Pieps, wenn Suche automatisch am anderen Dateiende fortsetzt
@@ -1755,6 +1761,7 @@ helpviewer.title=jEdit Hilfe
 helpviewer.loading=Laden...
 helpviewer.back.label=Zurück
 helpviewer.forward.label=Vorwärts
+helpviewer.copy-link.label=Verweis kopieren
 
 helpviewer.toc.loading=Laden...
 helpviewer.toc.label=Inhalt
@@ -2024,16 +2031,16 @@ install-plugins.info.size=Größe
 install-plugins.info.releaseDate=Release-Datum
 install-plugins.info.version=Version
 install-plugins.info.category=Kategorie
+install-plugins.info.author=Autor
+install-plugins.info.released=Freigegeben
+install-plugins.info.depends=Abhängig von
+install-plugins.info.optionalDepends=Optional abhängig von
 
 install-plugins.totalSize={0} Plugin(s), Gesamtgröße: {1}
 install-plugins.select-all=Alle wählen
 install-plugins.install=Installieren
 install-plugins.show-updates=Updates anzeigen
 
-install-plugins.info=<b>Autor</b>: {0}\n\
-	<b>Release</b>: {1}\n\
-	{2}
-
 update-plugins.title=Aktualisieren
 
 plugin-manager.progress=Gewählte Plugins werden heruntergeladen von Plugins.jedit.org...
@@ -2156,10 +2163,13 @@ macro.rs.CutLinesContaining.LinesCut.message=Zeile(n) ausgeschnitten
 #{{{ Editing
 
 #{{{ Go to column
-macro.rs.GoToColumn.ColumnBefore.label=Spalte (zwischen 1 und
-macro.rs.GoToColumn.ColumnAfter.label=):
+macro.rs.GoToColumn.label=Spalte (zwischen 1 und {0}):
 #}}}
 
+# Go To Offset
+macro.rs.GoToOffset.label=Offset (zwischen 1 und {0}):
+
+
 #{{{ Key Words to Uppercase
 macro.rs.KeywordsToUpperCase.ConvertedKeywords.message=zu Großbuchstaben konvertierte Schlüsselworte
 #}}}
@@ -2504,6 +2514,7 @@ Files/Insert_Selection.label=Füge Datei ein (Name in Auswahl)
 Files/Next_Dirty_Buffer.label=Nächste nicht gespeicherte Datei
 Files/Open_Path.label=Öffne Datei (Name eingeben)
 Files/Open_Selection.label=Öffne Datei (Name in Auswahl)
+Files/Open_Selection_In_Desktop.label=Starte Datei (Name in Auswahl)
 Files/Send_Buffer_To_Next_Split.label=Datei in den nächsten Dateisatz
 Files/Toggle_ReadOnly.label=Schreibschutz umschalten
 #}}}
diff --git a/org/jedit/localization/jedit_en.props b/org/jedit/localization/jedit_en.props
index 100f1b5..f185435 100644
--- a/org/jedit/localization/jedit_en.props
+++ b/org/jedit/localization/jedit_en.props
@@ -525,7 +525,7 @@ view.gutter.marker=Marker: {0}
 view.status.add-marker=Shortcut for new marker? [{0}]
 view.status.auto-wrap=Search string not found; wrapping around!
 view.status.bracket=Matches line {0}: {1}
-view.status.caret-tooltip=Offset, line and column number (offset,line,column[-virtual] relative%)
+view.status.caret-tooltip=line, column[-virtual] (offset/length)
 view.status.copy-append-string-register=Register name to copy append to? [{0}]
 view.status.copy-string-register=Register to copy to? [{0}]
 view.status.cut-append-string-register=Register to cut append to? [{0}]
@@ -1357,7 +1357,7 @@ options.editing.noTabs=Soft (emulated with spaces) tabs
 options.editing.elasticTabstops=Indent using elastic tabstops
 options.editing.elasticTabstops.tooltip=Columns in lines above and below a "cell" are kept aligned on tab stops that can grow or shrink depending on the width of the cell.
 options.editing.deepIndent=Deep indent
-options.editing.autoIndent=Automatic indentation
+options.editing.autoIndent=Automatic indentation:
 options.editing.largefilemode.title=Large file mode
 options.editing.largefilemode=What should I do about very big files:
 options.editing.largefilemode.option.ask=<html><b>Ask</b> what to do when opening a large file</html>
@@ -1608,6 +1608,7 @@ options.textarea.fracFontMetrics.tooltip=Not recommended with subpixel antialias
 options.textarea.stripTrailingEOL=Hide final end of line (if any)
 options.textarea.completeFromAllBuffers=Complete words from all open buffers (default is \
     to limit search to currently visible buffers)
+options.textarea.insertCompletionWithDigit=Complete word by typing corresponding digit (otherwise, digit is considered part of the word)
 options.textarea.lineSpacing.label=Extra vertical line spacing (in pixels):
 #}}}
 
@@ -1728,6 +1729,7 @@ helpviewer.title=jEdit Help
 helpviewer.loading=Loading...
 helpviewer.back.label=Back
 helpviewer.forward.label=Forward
+helpviewer.copy-link.label=Copy link to clipboard
 
 helpviewer.toc.loading=Loading...
 helpviewer.toc.label=Contents
@@ -1999,16 +2001,16 @@ install-plugins.info.size=Size
 install-plugins.info.releaseDate=Release date
 install-plugins.info.version=Version
 install-plugins.info.category=Category
+install-plugins.info.author=Author
+install-plugins.info.released=Released
+install-plugins.info.depends=Depends on
+install-plugins.info.optionalDepends=Optionally depends on
 
 install-plugins.totalSize={0} plugin(s), total size: {1}
 install-plugins.select-all=Select All
 install-plugins.install=Install
 install-plugins.show-updates=Show Updates
 
-install-plugins.info=<b>Author</b>: {0}\n\
-	<b>Released</b>: {1}\n\
-	{2}
-
 update-plugins.title=Update
 
 plugin-manager.progress=Downloading {0} from mirror {1}
@@ -2131,10 +2133,12 @@ macro.rs.CutLinesContaining.LinesCut.message=line(s) cut
 #{{{ Editing
 
 #{{{ Go to column
-macro.rs.GoToColumn.ColumnBefore.label=Column (between 1 and
-macro.rs.GoToColumn.ColumnAfter.label=):
+macro.rs.GoToColumn.label=Column (between 1 and {0}):
 #}}}
 
+# Go To Offset
+macro.rs.GoToOffset.label=Offset (between 0 and {0}): 
+
 #{{{ Key Words to Uppercase
 macro.rs.KeywordsToUpperCase.ConvertedKeywords.message=Converted Keywords to Upper Case
 #}}}
diff --git a/org/jedit/localization/jedit_fr.props b/org/jedit/localization/jedit_fr.props
index 84a7b44..4fbc7a6 100644
--- a/org/jedit/localization/jedit_fr.props
+++ b/org/jedit/localization/jedit_fr.props
@@ -1728,6 +1728,7 @@ helpviewer.title=Aide de jEdit
 helpviewer.loading=Chargement en cours...
 helpviewer.back.label=Précédente
 helpviewer.forward.label=Suivante
+helpviewer.copy-link.label=Copier l'adresse du lien
 
 helpviewer.toc.loading=Chargement en cours...
 helpviewer.toc.label=Contenus
@@ -2123,8 +2124,7 @@ macro.rs.CutLinesContaining.LinesCut.message=ligne(s) coupées
 #{{{ Editing
 
 #{{{ Go to column
-macro.rs.GoToColumn.ColumnBefore.label=Colonne (entre 1 et
-macro.rs.GoToColumn.ColumnAfter.label=):
+macro.rs.GoToColumn.label=Colonne (entre 1 et {0}):
 #}}}
 
 #{{{ Key Words to Uppercase
diff --git a/org/jedit/localization/jedit_ja.props b/org/jedit/localization/jedit_ja.props
index 85c8b8d..8f7dec2 100644
--- a/org/jedit/localization/jedit_ja.props
+++ b/org/jedit/localization/jedit_ja.props
@@ -1723,6 +1723,8 @@ helpviewer.title=jEdit ヘルプ
 helpviewer.loading=ロード中...
 helpviewer.back.label=戻る
 helpviewer.forward.label=進む
+# FIXME: no translation
+helpviewer.copy-link.label=Copy link to clipboard
 
 helpviewer.toc.loading=ロード中...
 helpviewer.toc.label=コンテンツ
@@ -2126,8 +2128,7 @@ macro.rs.CutLinesContaining.LinesCut.message=行切り取り
 #{{{ Editing
 
 #{{{ Go to column
-macro.rs.GoToColumn.ColumnBefore.label=列 ( 1 から
-macro.rs.GoToColumn.ColumnAfter.label=の間で指定):
+macro.rs.GoToColumn.label=列 ( 1 から {0} の間で指定):
 #}}}
 
 #{{{ Key Words to Uppercase
diff --git a/org/jedit/localization/jedit_ru.props b/org/jedit/localization/jedit_ru.props
index 81d5c6b..971bfe9 100644
--- a/org/jedit/localization/jedit_ru.props
+++ b/org/jedit/localization/jedit_ru.props
@@ -883,7 +883,7 @@ search.synchronize.tooltip=Установить фильтр и дирекори
 search.findBtn=Искать
 search.findBtn.mnemonic=f
 search.replaceBtn=Заменить
-search.replaceBtn.mnemonic=
+search.replaceBtn.mnemonic=З
 search.replaceAndFindBtn=Заменить и найти
 search.replaceAndFindBtn.mnemonic=r
 search.replaceAllBtn=Заменить все
@@ -1716,6 +1716,8 @@ helpviewer.title=Помощь jEdit
 helpviewer.loading=Загрузка...
 helpviewer.back.label=Назад
 helpviewer.forward.label=Вперёд
+# FIXME: missing translation
+helpviewer.copy-link.label=Copy link to clipboard
 
 helpviewer.toc.loading=Загрузка...
 helpviewer.toc.label=Содержание
@@ -2112,8 +2114,7 @@ macro.rs.CutLinesContaining.LinesCut.message=строк вырезано
 #{{{ Editing
 
 #{{{ Go to column
-macro.rs.GoToColumn.ColumnBefore.label=Столбец (межды 1 и
-macro.rs.GoToColumn.ColumnAfter.label=):
+macro.rs.GoToColumn.label=Столбец (межды 1 и {0}):
 #}}}
 
 #{{{ Key Words to Uppercase
diff --git a/org/jedit/localization/jedit_zh.props b/org/jedit/localization/jedit_zh.props
index a5f0ea4..025163a 100644
--- a/org/jedit/localization/jedit_zh.props
+++ b/org/jedit/localization/jedit_zh.props
@@ -1710,6 +1710,8 @@ helpviewer.title=jEdit帮助
 helpviewer.loading=加载...
 helpviewer.back.label=返回
 helpviewer.forward.label=向前
+# FIXME: missing translation
+helpviewer.copy-link.label=Copy link to clipboard
 
 helpviewer.toc.loading=加载...
 helpviewer.toc.label=目录
@@ -2112,8 +2114,7 @@ macro.rs.CutLinesContaining.LinesCut.message=行以剪切
 #{{{ Editing
 
 #{{{ Go to column
-macro.rs.GoToColumn.ColumnBefore.label=列 (在 1 和
-macro.rs.GoToColumn.ColumnAfter.label=):
+macro.rs.GoToColumn.label=列 (在 1 和 {0}):
 #}}}
 
 #{{{ Key Words to Uppercase
diff --git a/org/jedit/options/OptionGroupPane.java b/org/jedit/options/OptionGroupPane.java
index 78bcbf2..074dd7d 100644
--- a/org/jedit/options/OptionGroupPane.java
+++ b/org/jedit/options/OptionGroupPane.java
@@ -125,7 +125,7 @@ public class OptionGroupPane extends AbstractOptionPane implements TreeSelection
 
 		Object[] nodes = path.getPath();
 
-		StringBuffer buf = new StringBuffer();
+		StringBuilder sb = new StringBuilder();
 
 		OptionPane optionPane = null;
 
@@ -178,17 +178,17 @@ public class OptionGroupPane extends AbstractOptionPane implements TreeSelection
 				continue;
 			}
 			if (label != null)
-				buf.append(label);
+				sb.append(label);
 
 			if (i > 0 && i < lastIdx)
-				buf.append(": ");
+				sb.append(": ");
 		}
 
 		if (optionPane == null)
 			return;
 		
 		String ttext = jEdit.getProperty("optional.title-template", new Object[] {
-			optionGroup.getName(), buf.toString() });
+			optionGroup.getName(), sb.toString() });
 		setTitle(ttext);
 
 		try
@@ -323,7 +323,9 @@ public class OptionGroupPane extends AbstractOptionPane implements TreeSelection
 			JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
 			JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
 		scroller.setMinimumSize(new Dimension(120, 0));
-		splitter = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scroller, new JScrollPane(stage));
+		JScrollPane scroll = new JScrollPane(stage);
+		scroll.getVerticalScrollBar().setUnitIncrement(10);
+		splitter = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scroller, scroll);
 		content.add(splitter, BorderLayout.CENTER);
 
 		// register the Options dialog as a TreeSelectionListener.
diff --git a/org/jedit/options/PluginOptionGroup.java b/org/jedit/options/PluginOptionGroup.java
index 49a5c08..f8639ea 100644
--- a/org/jedit/options/PluginOptionGroup.java
+++ b/org/jedit/options/PluginOptionGroup.java
@@ -61,34 +61,24 @@ public class PluginOptionGroup extends OptionGroup
 
 		// Query plugins for option panes
 		EditPlugin[] plugins = jEdit.getPlugins();
-		for(int i = 0; i < plugins.length; i++)
+		for (EditPlugin ep : plugins)
 		{
-			EditPlugin ep = plugins[i];
-			if(ep instanceof EditPlugin.Broken)
+			if (ep instanceof EditPlugin.Broken)
 				continue;
 
 			String className = ep.getClassName();
-			String optionPane = jEdit.getProperty(
-				"plugin." + className + ".option-pane");
-			if(optionPane != null)
+			String optionPane = jEdit.getProperty("plugin." + className + ".option-pane");
+			if (optionPane != null)
 				addOptionPane(optionPane);
 			else
 			{
-				String options = jEdit.getProperty(
-					"plugin." + className
-					+ ".option-group");
-				if(options != null)
+				String options = jEdit.getProperty("plugin." + className + ".option-group");
+				if (options != null)
 				{
-					addOptionGroup(
-						new OptionGroup(
-						"plugin." + className,
-						jEdit.getProperty("plugin."
-						+ className + ".name"),
-						options)
-					);
+					addOptionGroup(new OptionGroup("plugin." + className, jEdit.getProperty(
+						"plugin." + className + ".name"), options));
 				}
 			}
-
 		}
 
 		// only add the Plugins branch if there are OptionPanes
diff --git a/org/jedit/options/TabbedOptionDialog.java b/org/jedit/options/TabbedOptionDialog.java
index 3e24f9d..c7ab53b 100644
--- a/org/jedit/options/TabbedOptionDialog.java
+++ b/org/jedit/options/TabbedOptionDialog.java
@@ -182,10 +182,8 @@ public class TabbedOptionDialog extends EnhancedDialog implements ActionListener
 	{
 		GUIUtilities.saveGeometry(this, getName());
 
-		Iterator<OptionPane> itr = panes.iterator();
-		while (itr.hasNext())
+		for (OptionPane op : panes)
 		{
-			OptionPane op = itr.next();
 			if (shownPanes.contains(op))
 				op.save();
 		}
diff --git a/org/jedit/package.html b/org/jedit/package.html
index c907e1c..9d8e882 100644
--- a/org/jedit/package.html
+++ b/org/jedit/package.html
@@ -1 +1,4 @@
-<html><body>jEdit 5 API</body></html>
+<html><body>
+<h1>jEdit 5 API</h1>
+<p> New classes should go here instead of under <tt>org.gjt.sp</tt> packages. </p>
+</body></html>
diff --git a/package-files/linux/deb/control b/package-files/linux/deb/control
index e8f23e3..0570dea 100644
--- a/package-files/linux/deb/control
+++ b/package-files/linux/deb/control
@@ -6,9 +6,9 @@ Section: contrib/editors
 Homepage: http://www.jedit.org/
 Conflicts: jedit-cvs
 Replaces: jedit-cvs
-Recommends: default-jre | openjdk-6-jre
-Build-depends: default-jdk | openjdk-6-jdk, ant
-Suggests: exuberant-ctags, cscope, global, ant, openjdk-6-jdk | default-jdk
+Recommends: default-jre | openjdk-7-jre
+Build-depends: default-jdk | openjdk-7-jdk, ant
+Suggests: exuberant-ctags, cscope, global, ant, openjdk-7-jdk | default-jdk
 Priority: optional
 Installed-Size: @deb.installed.size@
 Description: A plugin-based editor for programmers.
diff --git a/package-files/linux/deb/jedit.desktop b/package-files/linux/deb/jedit.desktop
index 7923c7a..32b5ddd 100644
--- a/package-files/linux/deb/jedit.desktop
+++ b/package-files/linux/deb/jedit.desktop
@@ -17,5 +17,5 @@ Type=Application
 Categories=Development;TextEditor;
 StartupNotify=true
 MimeType=text/plain;
-StartupWMClass=org-gjt-sp-jedit-jEdit
+StartupWMClass=jedit
 Keywords=Code;Editor;Programming;PHP;FTP;
diff --git a/package-files/linux/jedit.1 b/package-files/linux/jedit.1
index 3542baa..41ee17f 100644
--- a/package-files/linux/jedit.1
+++ b/package-files/linux/jedit.1
@@ -26,7 +26,7 @@ Furthermore, \fBjEdit\fP is extremely customizable, and extensible, using either
 in Java. With plugins, you can create a very powerful development environment
 for HTML, XML, C/C++, Python, Perl, Ruby, Lisp, Scheme, and many others.
 
-\fBjEdit\fP Requires Sun Java 2 version 1.6.
+\fBjEdit\fP Requires A Java Runtime Environment Version 1.7 or later. 
 
 \fBjEdit\fP is released under the GNU General Public License, which can be found in
 the online help.
diff --git a/package-files/linux/slackware/slack-desc b/package-files/linux/slackware/slack-desc
index bc94be9..4b1ce8d 100644
--- a/package-files/linux/slackware/slack-desc
+++ b/package-files/linux/slackware/slack-desc
@@ -9,7 +9,7 @@
 jEdit: jEdit @jedit.version@ (Programmer's Text Editor)
 jEdit: 
 jEdit: jEdit is a mature and well-designed programmer's text editor that
-jEdit: has been in development for over 7 years. While jEdit beats many
+jEdit: has been in development for over 13 years. While jEdit beats many
 jEdit: expensive development tools for features and ease of use, it is
 jEdit: released as free software with full source code, provided under
 jEdit: the terms of the GNU General Public License.
diff --git a/package-files/osx/.background/background.png b/package-files/osx/.background/background.png
new file mode 100644
index 0000000..96ec3cc
Binary files /dev/null and b/package-files/osx/.background/background.png differ
diff --git a/package-files/osx/DS_Store b/package-files/osx/DS_Store
new file mode 100644
index 0000000..e4955b1
Binary files /dev/null and b/package-files/osx/DS_Store differ
diff --git a/package-files/osx/jedit b/package-files/osx/jedit
new file mode 100644
index 0000000..7bddebe
Binary files /dev/null and b/package-files/osx/jedit differ
diff --git a/package-files/windows/jedit.launch4j.xml b/package-files/windows/jedit.launch4j.xml
index f9fd76d..338a7ef 100644
--- a/package-files/windows/jedit.launch4j.xml
+++ b/package-files/windows/jedit.launch4j.xml
@@ -1,8 +1,25 @@
-<?xml version="1.0" encoding="US-ASCII"?>
-<!-- US-ASCII is the best encoding to avoid problem of Launch4j which
-uses system default encoding no matter what encoding the config file
-declare in it. Here, "best" means a common subset of system default
-encodings on many of known OS and locales. -->
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ jEdit - Programmer's Text Editor
+  ~ :tabSize=8:indentSize=8:noTabs=false:
+  ~ :folding=explicit:collapseFolds=1:
+  ~
+  ~ Copyright © 2014 jEdit contributors
+  ~
+  ~ This program is free software; you can redistribute it and/or
+  ~ modify it under the terms of the GNU General Public License
+  ~ as published by the Free Software Foundation; either version 2
+  ~ of the License, or any later version.
+  ~ This program is distributed in the hope that it will be useful,
+  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  ~ GNU General Public License for more details.
+  ~
+  ~ You should have received a copy of the GNU General Public License
+  ~ along with this program; if not, write to the Free Software
+  ~ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+  -->
+
 <launch4jConfig>
 	<headerType>gui</headerType>
 	<outfile>jedit.exe</outfile>
@@ -12,7 +29,6 @@ encodings on many of known OS and locales. -->
 	<downloadUrl>http://www.java.com/download</downloadUrl>
 	<supportUrl>http://www.jEdit.org</supportUrl>
 	<cmdLine>-reuseview</cmdLine>
-	<customProcName>false</customProcName>
 	<stayAlive>true</stayAlive>
 	<icon>@base.dir@/icons/jedit.ico</icon>
 	<jre>
@@ -24,7 +40,7 @@ encodings on many of known OS and locales. -->
 		<fileVersion>@jedit.build.number@</fileVersion>
 		<txtFileVersion>@jedit.version@</txtFileVersion>
 		<fileDescription>jEdit - Programmer's Text Editor</fileDescription>
-		<copyright>Copyright (C) 1998- at current.year@ Contributors</copyright>
+		<copyright>Copyright © 1998- at current.year@ Contributors</copyright>
 		<productVersion>@jedit.build.number@</productVersion>
 		<txtProductVersion>@jedit.version@</txtProductVersion>
 		<productName>jEdit</productName>
diff --git a/properties/README.txt b/properties/README.txt
index eca40d6..5ba7362 100644
--- a/properties/README.txt
+++ b/properties/README.txt
@@ -2,6 +2,11 @@ SITE PROPERTIES
 
 Any property files (with extension .props) placed in this directory will
 be loaded by jEdit before the user-specific properties. On multi-user
-machines, this can be used to enforce a site-wide key binding or color
-scheme, for example. Just copy the relevant entries from your user
-properties file into a new .props file, and place it in this directory.
+machines, this can be used to enforce a site-wide color scheme, for example.
+Just copy the relevant entries from your user properties file into a new .props file, and place it in this directory.
+
+As of jEdit 5.0, keyboard shortcuts should not be placed in this file.  If
+you want to define a site-wide set of keyboard shortcuts, you should create
+a named keymap and place it in the "keymaps" directory.
+
+
diff --git a/startup/startup.bsh b/startup/startup.bsh
index 75e9b79..9e1ae24 100644
--- a/startup/startup.bsh
+++ b/startup/startup.bsh
@@ -1,4 +1,5 @@
-// Slava Pestov's startup script. Doesn't have much in it yet.
+// jEdit default startup.bsh script.
+//  Used mostly for experimental keyboard workarounds.
 // :folding=explicit:expandFolds=1:
 
 //Most of the file is commented out. Note that the hacks here are
@@ -18,6 +19,7 @@ ac()
 	setAccessibility(true);
 }
 
+
 /* For the mathematicians among us. */
 e = Math.E;
 pi = Math.PI;
@@ -63,7 +65,7 @@ s(search,replace,flags)
 
 /*}}}*/
 
-/*{{{ Remapping modifier keys part I */
+/*{{{ Remapping modifier keys  */
 
 /* The below is the default, swap the items around to
  * change meaning of C+, A+, M+, S+.
@@ -78,55 +80,74 @@ s(search,replace,flags)
 //	InputEvent.ALT_MASK,   /* == M+ */
 //	InputEvent.SHIFT_MASK  /* == S+ */);
 
+/* ... if you want MacOS keyboard to behave like a Linux or Windows keyboard
+   (This is also a MacOSX plugin option): */
+
+// KeyEventTranslator.setModifierMapping(InputEvent.CTRL_MASK,
+//	InputEvent.META_MASK, InputEvent.ALT_MASK,
+//	InputEvent.SHIFT_MASK);
+
+
 /*}}}*/
 
-/*{{{ Remapping modifier keys part II */
+/*{{{ Keypad arrowkeys vs regular arrowkeys 
+    Linux distinguishes between keypad arrowkeys and regular arrows, unlike Windows.
+    The translations below force keypad arrowkeys to behave the same way as regular arrowkeys
+    on all platforms.
+*/
+
+String[] modifierList = new String[] {"A", "C", "S", "CA", "AS", "CS", null};
+
+for (String mod: modifierList) {
+    linp = new KeyEventTranslator.Key(mod, KeyEvent.VK_KP_LEFT, (char)0);
+    crossp = new KeyEventTranslator.Key(mod, KeyEvent.VK_LEFT, (char)0); 
+    KeyEventTranslator.addTranslation(linp, crossp);
+    linp = new KeyEventTranslator.Key(mod, KeyEvent.VK_KP_RIGHT, (char)0);
+    crossp = new KeyEventTranslator.Key(mod, KeyEvent.VK_RIGHT, (char)0); 
+    KeyEventTranslator.addTranslation(linp, crossp);
+    linp = new KeyEventTranslator.Key(mod, KeyEvent.VK_KP_UP, (char)0);
+    crossp = new KeyEventTranslator.Key(mod, KeyEvent.VK_UP, (char)0); 
+    KeyEventTranslator.addTranslation(linp, crossp);
+    linp = new KeyEventTranslator.Key(mod, KeyEvent.VK_KP_DOWN, (char)0);
+    crossp = new KeyEventTranslator.Key(mod, KeyEvent.VK_DOWN, (char)0); 
+    KeyEventTranslator.addTranslation(linp, crossp);
+}
 
-/* Note if you chose to make use of the M+ (option key) prefix on MacOS, you
- * will need to disable a little piece of code: */
-//Debug.ALT_KEY_PRESSED_DISABLED = false;
-/* Otherwise M+ will be ignored for the purposes of keyboard shortcuts. */
+/* }}}*/
 
-/* But if you enable this, you might find that Option+8 for example invokes your
- * macro but also inserts a bulletpoint, as per standard Macintosh keyboard
- * behavior. To disable the Option key for inserting special high ASCII
- * characters, uncomment this. Note that it has wider implications, notably
- * DROVAK keyboard shortcuts will be mapped as if the keyboard was QWERTY. */
-//Debug.ALTERNATIVE_DISPATCHER = false;
 
-/*}}}*/
 
 /*{{{ Workaround for buggy international key handling */
 
 /* If international keys do not work in the text area, sometimes it is possible
  * to workaround the problem by adding translation mappings: */
 
-// KeyEventTranslator.translateKey(
+// KeyEventTranslator.addTranslation(
 //	new KeyEventTranslator.Key("CS",KeyEvent.VK_COMMA,'\0'),
 //	new KeyEventTranslator.Key("C",KeyEvent.VK_SEMICOLON,'\0')
 // );
 
-// KeyEventTranslator.translateKey(
+// KeyEventTranslator.addTranslation(
 //	new KeyEventTranslator.Key(null,KeyEvent.VK_CLOSE_BRACKET,'\0'),
 //	new KeyEventTranslator.Key(null,0,'"')
 // );
 
-// KeyEventTranslator.translateKey(
+// KeyEventTranslator.addTranslation(
 //	new KeyEventTranslator.Key("S",KeyEvent.VK_CLOSE_BRACKET,'\0'),
 //	new KeyEventTranslator.Key(null,0,(char)0x5e)
 // );
 
-// KeyEventTranslator.translateKey(
+// KeyEventTranslator.addTranslation(
 //	new KeyEventTranslator.Key("C",KeyEvent.VK_CLOSE_BRACKET,'\0'),
 //	new KeyEventTranslator.Key(null,0,'~')
 // );
 
-// KeyEventTranslator.translateKey(
+// KeyEventTranslator.addTranslation(
 //	new KeyEventTranslator.Key(null,KeyEvent.VK_EQUALS,'\0'),
 //	new KeyEventTranslator.Key(null,0,'\'')
 // );
 
-// KeyEventTranslator.translateKey(
+// KeyEventTranslator.addTranslation(
 //	new KeyEventTranslator.Key("S",KeyEvent.VK_EQUALS,'\0'),
 //	new KeyEventTranslator.Key(null,0,'`')
 // );

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jedit.git



More information about the pkg-java-commits mailing list