From e226b9f7c790b6dccb5f3152ff40d796940967a9 Mon Sep 17 00:00:00 2001 From: slava Date: Mon, 25 Sep 2006 02:30:35 +0000 Subject: [PATCH] Add docs for no-edit-hook, link "definitions" article in, don't draw-world if the world has 0 width or height --- doc/handbook/tools.facts | 1 + library/tools/definitions.facts | 16 +++++++++++++++- library/tools/errors.factor | 4 +++- library/ui/ui.factor | 7 ++++++- 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/doc/handbook/tools.facts b/doc/handbook/tools.facts index df072a3d32..8e9116816c 100644 --- a/doc/handbook/tools.facts +++ b/doc/handbook/tools.facts @@ -10,6 +10,7 @@ $terpri "Interactive development:" { $subsection "listener" } { $subsection "debugger" } +{ $subsection "definitions" } { $subsection "word-introspection" } { $subsection "inspector" } { $subsection "annotations" } diff --git a/library/tools/definitions.facts b/library/tools/definitions.facts index 1ac05a522c..737e64d2c3 100644 --- a/library/tools/definitions.facts +++ b/library/tools/definitions.facts @@ -1,5 +1,5 @@ IN: definitions -USING: help io prettyprint ; +USING: help io modules prettyprint ; HELP: ?resource-path { $values { "path" "a string" } { "newpath" "a string" } } @@ -33,3 +33,17 @@ HELP: comment. { $values { "string" "a string" } } { $description "Prettyprints some text with the comment style." } $prettyprinting-note ; + +HELP: edit +{ $values { "defspec" "a definition specifier" } } +{ $description "Opens the source file containing the definition in the default editor. You must load one of the following modules using " { $link require } " for this word to work:" + { $list + { $snippet "contrib/emacs" } + { $snippet "contrib/jedit" } + { $snippet "contrib/textmate" } + { $snippet "contrib/vim" } + } +} ; + +HELP: no-edit-hook +{ $error-description "Thrown when " { $link edit } " is called when the " { $link edit-hook } " variable is not set. See " { $link edit } " for details." } ; diff --git a/library/tools/errors.factor b/library/tools/errors.factor index 5986f95426..7ea959cc37 100644 --- a/library/tools/errors.factor +++ b/library/tools/errors.factor @@ -3,7 +3,7 @@ IN: errors USING: generic help tools io kernel math math-internals parser prettyprint queues sequences sequences-internals strings test -words ; +words definitions ; : expired-error. ( obj -- ) "Object did not survive image save/load: " write third . ; @@ -157,3 +157,5 @@ M: condition error. delegate error. ; M: condition error-help drop f ; M: assert summary drop "Assertion failed" ; + +M: no-edit-hook summary drop "No edit hook is set" ; diff --git a/library/ui/ui.factor b/library/ui/ui.factor index 59ac998553..a01c435324 100644 --- a/library/ui/ui.factor +++ b/library/ui/ui.factor @@ -172,8 +172,13 @@ M: world-error error. "This world has been deactivated to prevent cascading errors." print delegate error. ; +: draw-world? ( world -- ) + #! We don't draw deactivated worlds, or those with 0 size. + #! On Windows, the latter case results in GL errors. + dup world-active? swap rect-dim [ zero? not ] all? and ; + : draw-world ( world -- ) - dup world-active? [ + dup draw-world? [ [ dup world set [ dup (draw-world)