]> gitweb.factorcode.org Git - factor.git/blob - basis/editors/editors-docs.factor
Create basis vocab root
[factor.git] / basis / editors / editors-docs.factor
1 USING: help.markup help.syntax parser source-files vocabs.loader ;
2 IN: editors
3
4 ARTICLE: "editor" "Editor integration"
5 "Factor development is best done with one of the supported editors; this allows you to quickly jump to definitions from the Factor environment."
6 { $subsection edit }
7 "Depending on the editor you are using, you must load one of the child vocabularies of the " { $vocab-link "editors" } " vocabulary, for example " { $vocab-link "editors.emacs" } ", for example:"
8 { $code "USE: editors.emacs" }
9 "Editor integration vocabularies store a quotation in a global variable when loaded:"
10 { $subsection edit-hook }
11 "If a syntax error was thrown while loading a source file, you can jump to the location of the error in your editor:"
12 { $subsection :edit } ;
13
14 ABOUT: "editor"
15
16 HELP: edit
17 { $values { "defspec" "a definition specifier" } }
18 { $description "Opens the source file containing the definition using the current " { $link edit-hook } ". See " { $link "editor" } "." }
19 { $examples
20     "Editing a word definition:"
21     { $code "\\ foo edit" }
22     "A word's documentation:"
23     { $code "\\ foo >link edit" }
24     "A method definition:"
25     { $code "{ editor draw-gadget* } edit" }
26     "A help article:"
27     { $code "\"handbook\" >link edit" }
28 } ;
29
30 HELP: edit-location
31 { $values { "file" "a pathname string" } { "line" "a positive integer" } }
32 { $description "Opens a source file at the specified line number containing using the current " { $link edit-hook } ". Line numbers are indexed starting from 1. See " { $link "editor" } "." } ;
33
34 HELP: no-edit-hook
35 { $error-description "Thrown when " { $link edit } " is called when the " { $link edit-hook } " variable is not set. See " { $link "editor" } "." } ;
36
37 HELP: :edit
38 { $description "If the most recent error was a " { $link source-file-error } " thrown while parsing a source file, opens the source file at the failing line in the default editor using the " { $link edit-hook } ". See " { $link "editor" } "." } ;