1 USING: help.markup help.syntax parser source-files
2 source-files.errors vocabs.loader kernel ;
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 class or tuple in a global variable when loaded:"
13 { $subsections editor-class }
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 { $subsections :edit } ;
20 { $values { "object" object } }
21 { $description "Opens the source file containing the definition using the current " { $link editor-class } ". See " { $link "editor" } "." }
23 "Editing a word definition:"
24 { $code "\\ foo edit" }
25 "A word's documentation:"
26 { $code "\\ foo >link edit" }
27 "A method definition:"
28 { $code "M\\ fixnum + edit" }
30 { $code "\"handbook\" >link edit" }
34 { $values { "file" "a pathname string" } { "line" "a positive integer" } }
35 { $description "Opens a source file at the specified line number containing using the current " { $link editor-class } ". Line numbers are indexed starting from 1. See " { $link "editor" } "." } ;
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. See " { $link "editor" } "." } ;