]> gitweb.factorcode.org Git - factor.git/blob - basis/editors/editors-docs.factor
editors: adding EDITOR: syntax and use classes instead of tuples
[factor.git] / basis / editors / editors-docs.factor
1 USING: help.markup help.syntax parser source-files
2 source-files.errors vocabs.loader kernel ;
3 IN: editors
4
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."
7 { $subsections edit }
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" } "."
11 $nl
12 "Editor integration vocabularies store an object 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 } ;
16
17 ABOUT: "editor"
18
19 HELP: edit
20 { $values { "object" object } }
21 { $description "Opens the source file containing the definition using the current " { $link editor-class } ". See " { $link "editor" } "." }
22 { $examples
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" }
29     "A help article:"
30     { $code "\"handbook\" >link edit" }
31 } ;
32
33 HELP: edit-location
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" } "." } ;
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. See " { $link "editor" } "." } ;