1 USING: help.markup help.syntax parser source-files
2 source-files.errors vocabs.loader ;
5 ARTICLE: "editor" "Editor integration"
6 "Factor development is best done with one of the supported editors; this allows you to quickly jump to definitions from the Factor environment."
8 "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" } ":"
9 { $code "USE: editors.emacs" }
10 "If you intend to always use the same editor, it helps to have it load during stage 2 bootstrap. Place the code to load and possibly configure it in the " { $link "factor-boot-rc" } "."
12 "Editor integration vocabularies store a quotation in a global variable when loaded:"
13 { $subsection edit-hook }
14 "If a syntax error was thrown while loading a source file, you can jump to the location of the error in your editor:"
15 { $subsection :edit } ;
20 { $var-description "A quotation with stack effect " { $snippet "( file line -- )" } ". If not set, the " { $link edit } " word throws a condition with restarts for loading one of the sub-vocabularies of the " { $vocab-link "editors" } " vocabulary." } ;
23 { $values { "defspec" "a definition specifier" } }
24 { $description "Opens the source file containing the definition using the current " { $link edit-hook } ". See " { $link "editor" } "." }
26 "Editing a word definition:"
27 { $code "\\ foo edit" }
28 "A word's documentation:"
29 { $code "\\ foo >link edit" }
30 "A method definition:"
31 { $code "M\\ fixnum + edit" }
33 { $code "\"handbook\" >link edit" }
37 { $values { "file" "a pathname string" } { "line" "a positive integer" } }
38 { $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" } "." } ;
41 { $error-description "Thrown when " { $link edit } " is called when the " { $link edit-hook } " variable is not set. See " { $link "editor" } "." } ;
44 { $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" } "." } ;