72 lines
4.0 KiB
HTML
72 lines
4.0 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head><title>Factor plugin</title>
|
|
|
|
<style>
|
|
.fancy-heading { background: #c0d0ff; border: 1px solid #2040ff; }
|
|
div.fancy-heading { padding: 1px; margin: 0px 0px 3px 0px; }
|
|
.screenshot {
|
|
float: right;
|
|
margin: 0px 9px 9px 0px;
|
|
border: 0px;
|
|
}
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
<h1 align="center">Factor plugin</h1>
|
|
|
|
Factor is a programming language with postfix syntax. This document describes the Factor plugin only, not the Factor language itself. The language is described in detail in the <a href="devel-guide/index.html">Factor Developer's Guide</a>. Also, be sure to visit the Factor home page located at <a href="http://factor.sourceforge.net">factor.sourceforge.net</a>.<p>
|
|
|
|
If you're interested in using the Factor plugin as a quick calculator embedded in jEdit, here is a quick start guide:
|
|
|
|
<pre>2 2 + .
|
|
10 3 ^ .
|
|
HEX: ffce HEX: fefc bitand .
|
|
pi sin .
|
|
pi i * exp .</pre>
|
|
|
|
<h2 class="fancy-heading">Introduction</h2>
|
|
|
|
If Factor is compiled with the jEdit classes in the class path, the resulting <code>Factor.jar</code> can then be placed in <code>$HOME/.jedit/jars/</code> and loaded by jEdit.<p>
|
|
|
|
The plugin embeds a Factor interpreter inside jEdit that gets lazily loaded when first used. The interpreter communicates with the plugin and vice versa to perform various useful tasks.<p>
|
|
|
|
Note that while the Factor plugin requires jEdit 4.2pre15, you will need to download and install the Factor edit mode separately from the <a href="http://factor.sf.net">Factor home page</a>. If you are running jEdit 4.2final, this edit mode is already included.
|
|
|
|
<h2 class="fancy-heading">Plugin actions</h2>
|
|
|
|
The Factor plugin adds a menu to jEdit's <b>Plugins</b> menu with the following commands (which can also be assigned keyboard shortcuts, added to the tool bar etc):
|
|
|
|
<ul>
|
|
<li><b>Factor Listener</b> opens a dockable window with an interactive interpreter.</li>
|
|
<li><b>Run current file</b> evaluates the <code>run-file</code> word with the current buffer's path name as an argument.</li>
|
|
<li><b>Evaluate selection</b> evaluates the current selection.</li>
|
|
<li><b>Apropos word at caret</b> performs an apropos search on the current selection, or the word at the caret if there is no selection. An "apropos search" lists all words in all vocabularies whose names contain a certain string. For example, you can use this to list all string words by searching for "str", or to find out which vocabulary contains the word "unparse" by searching for "unparse".</li>
|
|
<li><b>See word at caret</b> shows the definition of the word at the caret in the listener dockable window.</li>
|
|
<li><b>Edit word at caret</b> opens the source file containing the definition of the word at the caret.
|
|
For this to work with words defined in the standard library, you must set the "resource-path" variable in your <code>~/.factor-rc</code> to point to the location of the library sources:
|
|
|
|
<pre>"/home/slava/Factor/" "resource-path" set</pre>
|
|
</li>
|
|
<li><b>Word usages at caret</b> shows all usages of the word at the caret in the listener dockable window.</li>
|
|
</ul>
|
|
|
|
<h2 class="fancy-heading">SideKick parser</h2>
|
|
|
|
The Factor plugin uses the SideKick plugin to perform background parsing of Factor source files. This has the following implications:
|
|
|
|
<ul>
|
|
<li><b>Plugins</b>><b>SideKick</b>><b>Structure Browser</b> displays a list of all words defined in the current buffer.</li>
|
|
<li><b>Plugins</b>><b>SideKick</b>><b>Show Completion Popup</b> displays a popup listing completions for the partial word at the caret. Completions are searched for in all vocabularies in the current file's search path, as determined by <code>IN:</code> and <code>USE:</code> declarations.</li>
|
|
<li>The navigation commands in the <b>Plugins</b>><b>SideKick</b> menu will work. SideKick refers to each unit of source structure as an "asset". In Factor, each word definition is an "asset".</li>
|
|
<li>Any parse errors are reported using the ErrorList plugin, which means they will be highlighted in the text area and shown in the ErrorList window.
|
|
</li>
|
|
</ul>
|
|
|
|
</body>
|
|
</html>
|