PageRenderTime 47ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/jEdit/tags/jedit-4-1-pre5/doc/users-guide/starting.xml

#
XML | 300 lines | 292 code | 6 blank | 2 comment | 0 complexity | 75b947f924a6714fd292c089d204f732 MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  1. <!-- jEdit buffer-local properties: -->
  2. <!-- :tabSize=1:indentSize=1:noTabs=true: -->
  3. <chapter id="starting"><title>Starting jEdit</title>
  4. <sect1 id="conventions"><title>Conventions</title>
  5. <para>
  6. Several conventions are used throughout jEdit's user interface and
  7. this manual. They will be described here.
  8. </para>
  9. <para>
  10. When a menu item selection is being described, the
  11. top level menu is listed first, followed by successive levels of submenus,
  12. finally followed by the menu item itself. All menu components are separated
  13. by greater-than symbols (<quote>&gt;</quote>). For example,
  14. <guimenu>View</guimenu>&gt;<guisubmenu>Scrolling</guisubmenu>&gt;<guimenuitem>Scroll
  15. to Current Line</guimenuitem> refers to the <guimenuitem>Scroll to Current
  16. Line</guimenuitem> command contained in the
  17. <guisubmenu>Scrolling</guisubmenu> submenu of the <guimenu>View</guimenu> menu.
  18. </para>
  19. <para>
  20. As with many other applications, menu items that end with
  21. ellipsis (...) display dialog boxes or windows when invoked.
  22. </para>
  23. <para>
  24. Many jEdit commands can be also be invoked using keystrokes. This speeds
  25. up editing by letting you keep your hands on the keyboard. Not all
  26. commands with keyboard shortcuts
  27. are accessible with one key stroke; for example, the
  28. keyboard shortcut for <guimenuitem>Scroll to Current Line</guimenuitem> is
  29. <keycombo><keycap>Control</keycap><keycap>E</keycap></keycombo>
  30. <keycombo><keycap>Control</keycap><keycap>J</keycap></keycombo>. That is, you
  31. must first
  32. press <keycombo><keycap>Control</keycap><keycap>E</keycap></keycombo>, followed by
  33. <keycombo><keycap>Control</keycap><keycap>J</keycap></keycombo>.
  34. </para>
  35. <para>
  36. In many dialog boxes, the default button (it has a heavy outline, or a
  37. special border, depending on the current Swing look and feel) can be activated by
  38. pressing <keycap>Enter</keycap>. Similarly, pressing
  39. <keycap>Escape</keycap> will usually close a dialog box.
  40. </para>
  41. <para>
  42. Finally, some user interface elements (menus, menu items, buttons) have a
  43. certain letter in their label underlined. Pressing this letter in combination
  44. with the <keycap>Alt</keycap> key activates the associated user interface
  45. widget.
  46. </para>
  47. <sidebar><title>MacOS</title>
  48. <para>
  49. jEdit tries to adapt itself to established conventions when running on
  50. MacOS.
  51. </para>
  52. <para>
  53. If you are using MacOS, mentally substitute the modifier keys you see in
  54. this manual as follows:
  55. </para>
  56. <itemizedlist>
  57. <listitem><para>Read <keycap>Control</keycap> as <keycap>Command</keycap>
  58. </para></listitem>
  59. <listitem><para>Read <keycap>Alt</keycap> as <keycap>Option</keycap>
  60. </para></listitem>
  61. </itemizedlist>
  62. <para>
  63. If you only have a one-button mouse, a right button click (to show a
  64. context menu, and so on) can be simulated by holding down
  65. <keycap>Control</keycap> while clicking. A middle button click (to insert
  66. the most recent selection in the text area) can be simulated by
  67. holding down <keycap>Option</keycap> while clicking.
  68. </para>
  69. </sidebar>
  70. </sect1>
  71. <sect1 id="starting-any-os"><title>Platform-Independent Instructions</title>
  72. <para>
  73. Exactly how jEdit is started depends on the operating system;
  74. on Unix systems, usually you would
  75. run the <quote>jedit</quote> command at the command line,
  76. or select jEdit from a menu; on Windows, you might
  77. use the jEditLauncher package, which is documented in
  78. <xref linkend="starting-windows" />.
  79. </para>
  80. <para>
  81. If jEdit is started while another copy is already running, control is
  82. transferred to the running copy, and a second instance is not loaded.
  83. This saves time and memory if jEdit is started multiple times.
  84. Communication between instances of jEdit is implemented using
  85. TCP/IP sockets; the initial instance is known as the
  86. <firstterm>server</firstterm>, and subsequent invocations are
  87. <firstterm>clients</firstterm>.
  88. </para>
  89. <para>
  90. If the <command>-background</command> command line switch is specified,
  91. jEdit will continue running and waiting for client requests even
  92. after all editor windows are closed. When run in background mode,
  93. you can open and close jEdit any number of times, only having
  94. to wait for it to start the first time. The downside of this
  95. is that jEdit will continue to consume memory when no windows
  96. are open.
  97. </para>
  98. <para>
  99. For more information about command line switches that control the
  100. server feature, see <xref linkend="cli-usage" />.
  101. Note that if you are using <application>jEditLauncher</application>
  102. to start jEdit on Windows, this switch cannot be specified on the
  103. MS-DOS prompt command line when starting jEdit; it must be set as described
  104. in <xref linkend="launcher-starting" />.
  105. </para>
  106. <para>
  107. Unlike other applications, jEdit automatically loads any files that were
  108. open last time in was used, so you can get back to work immediately, without
  109. having to find the files you are working on first. This feature can be
  110. disabled in the <guibutton>Loading and Saving</guibutton> pane of the
  111. <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global Options</guimenuitem>
  112. dialog box; see <xref linkend="global-opts" />.
  113. </para>
  114. <sidebar><title>The edit server and security</title>
  115. <para>
  116. Not only does the server pick a random TCP port number on startup,
  117. it also requires that clients provide an <firstterm>authorization
  118. key</firstterm>; a randomly-generated number only accessible to
  119. processes running on the local machine.
  120. So not only will <quote>bad guys</quote> have to guess a 64-bit integer,
  121. they will need to get it right on the first try; the edit server
  122. shuts itself off upon receiving an invalid packet.
  123. </para>
  124. <para>
  125. In environments that demand absolute security, the edit server can be
  126. disabled by specifying the <command>-noserver</command> command line switch.
  127. </para>
  128. </sidebar>
  129. </sect1>
  130. <sect1 id="starting-windows"><title>Starting jEdit on Windows</title>
  131. <para>
  132. On Windows, jEdit comes with <emphasis>jEditLauncher</emphasis> - an optional
  133. package of components that make it easy to start jEdit, manage its command
  134. line settings, and launch files and macro scripts.
  135. </para>
  136. <para>
  137. The jEditLauncher package provides three shortcuts for running jEdit: one in
  138. the desktop's <guilabel>Start</guilabel> menu, a entry in the Programs menu, and
  139. a third shortcut on your desktop. Any of these may be deleted or moved without
  140. affecting jEdit's operation. To launch jEdit, simply select one of these shortcuts
  141. as you would for any Windows application.
  142. </para>
  143. <para>
  144. The jEditLauncher package includes a utility for changing the command line
  145. parameters that are stored with jEditLauncher and used every time it runs jEdit.
  146. You can change the Java interpreter used to launch jEdit, the amount of heap memory,
  147. the working directory and other command line parameters. To make these changes,
  148. select <guilabel>Set jEdit Parameters</guilabel> from the jEdit group in
  149. the Programs menu, or run <userinput>jedit /p</userinput> from a command
  150. line that has jEdit's installation directory in its search path. A dialog
  151. will appear that allows you to change and save a new set of command line
  152. parameters.
  153. </para>
  154. <para>
  155. The package also adds menu items to the context or <quote>right-click</quote>
  156. menu displayed by the Windows shell when you click on a file item in the
  157. desktop window, a Windows Explorer window or a standard file selection dialog.
  158. The menu entries allow you to open selected files in jEdit, starting the
  159. application if necessary. It will also allow you to open all files in a
  160. directory with a given extension with a single menu selection. If a BeanShell
  161. macro script with a <filename>.bsh</filename> extension is selected, the menu
  162. includes the option of running that script within jEdit. If you have the
  163. <application>JDiff</application> plugin installed with jEdit, you can also
  164. select two files and have jEdit compare them in a side-by-side graphical display.
  165. </para>
  166. <para>
  167. For a more detailed description of all features found in
  168. the jEditLauncher package, see <xref linkend="launcher-guide"/>.
  169. </para>
  170. </sect1>
  171. <sect1 id="cli-usage"><title>Command Line Usage</title>
  172. <para>
  173. On operating systems that support a command line, jEdit can be passed
  174. various arguments to control its behavior.
  175. </para>
  176. <para>
  177. If you are using <application>jEditLauncher</application>
  178. to start jEdit on Windows, only file names can be specified
  179. on the command line; the parameters documented below must be set as described
  180. in <xref linkend="launcher-starting" />.
  181. </para>
  182. <para>
  183. When opening files from the command line, a line number or marker to
  184. position the caret on can be specified like so:
  185. </para>
  186. <screen><prompt>$ </prompt><userinput>jedit MyApplet.java +line:10</userinput>
  187. <prompt>$ </prompt><userinput>jedit thesis.tex +marker:c</userinput></screen>
  188. <para>
  189. A number of options can also be specified to control several obscure features.
  190. They are listed in the following table.
  191. </para>
  192. <informaltable>
  193. <tgroup cols="2">
  194. <colspec colnum="1" colwidth="1.5in" />
  195. <thead>
  196. <row><entry>Option</entry><entry>Description</entry></row>
  197. </thead>
  198. <tbody>
  199. <row>
  200. <entry><command>-background</command></entry>
  201. <entry>Runs jEdit in background mode. In background mode,
  202. the edit server will continue listening for
  203. client connections even after all views are closed.
  204. See <xref linkend="starting" />.</entry>
  205. </row>
  206. <row>
  207. <entry><command>-nogui</command></entry>
  208. <entry>Makes jEdit not open an initial view, and instead only open one
  209. when the first client connects. Can only be used in combination with
  210. the <command>-background</command> switch. You can use this switch to
  211. <quote>pre-load</quote> jEdit when you log in to your computer, for
  212. example.
  213. </entry>
  214. </row>
  215. <row>
  216. <entry><command>-norestore</command></entry>
  217. <entry>Disables automatic restore of previously open files on
  218. startup. This feature can also be set permanently in the
  219. <guibutton>Loading and Saving</guibutton> pane of the
  220. <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global Options</guimenuitem>
  221. dialog box; see <xref linkend="global-opts" />.
  222. </entry>
  223. </row>
  224. <row>
  225. <entry><command>-run=<replaceable>script</replaceable></command></entry>
  226. <entry>Runs the specified BeanShell script. There can only be one
  227. of these parameters on the command line. See
  228. <xref linkend="scripts-command-line" /> for details.</entry>
  229. </row>
  230. <row>
  231. <entry><command>-server</command></entry>
  232. <entry>Stores the server port info in the file named <filename>server</filename>
  233. inside the settings directory.</entry>
  234. </row>
  235. <row>
  236. <entry><command>-server=<replaceable>name</replaceable></command></entry>
  237. <entry>Stores the server port info in the file named
  238. <replaceable>name</replaceable>. File names for this
  239. parameter are relative to the settings directory.</entry>
  240. </row>
  241. <row>
  242. <entry><command>-noserver</command></entry>
  243. <entry>Does not attempt to
  244. connect to a running edit server, and does not start one either. For
  245. information about the edit server, see <xref linkend="starting" />.</entry>
  246. </row>
  247. <row>
  248. <entry><command>-settings=<replaceable>dir</replaceable></command></entry>
  249. <entry>Loads and saves the user-specific settings in
  250. the directory named <replaceable>dir</replaceable>, instead of the
  251. default <filename><replaceable>user.home</replaceable>/.jedit</filename>.
  252. The directory will be created automatically if it does not exist. Has no
  253. effect when connecting to another instance via the edit server.</entry>
  254. </row>
  255. <row>
  256. <entry><command>-nosettings</command></entry>
  257. <entry>Starts jEdit without loading user-specific settings.
  258. See <xref linkend="settings-directory" />.</entry>
  259. </row>
  260. <row>
  261. <entry><command>-noplugins</command></entry>
  262. <entry>Causes jEdit to not load any plugins.
  263. See <xref linkend="using-plugins" />. Has no effect
  264. when connecting to another instance via the edit server.</entry>
  265. </row>
  266. <row>
  267. <entry><command>-nostartupscripts</command></entry>
  268. <entry>Causes jEdit to not run any startup scripts.
  269. See <xref linkend="startup-scripts" />.
  270. Has no effect
  271. when connecting to another instance via the edit server.</entry>
  272. </row>
  273. <row>
  274. <entry><command>-usage</command></entry>
  275. <entry>Shows a brief command line usage message without starting
  276. jEdit.
  277. This message is also shown if an invalid switch was specified.</entry>
  278. </row>
  279. <row>
  280. <entry><command>-version</command></entry>
  281. <entry>Shows the version number without starting jEdit.</entry>
  282. </row>
  283. <row>
  284. <entry><command>- -</command></entry>
  285. <entry>Specifies the end of the command line switches. Further
  286. parameters are treated as file names, even if they begin with
  287. a dash. Can be used to open files whose names start with a
  288. dash, and so on.</entry>
  289. </row>
  290. </tbody>
  291. </tgroup>
  292. </informaltable>
  293. </sect1>
  294. </chapter>