From 83f2a48853f2000321cd60b1e29869fa9001dcc9 Mon Sep 17 00:00:00 2001 From: Keith Lazuka Date: Mon, 14 Sep 2009 11:13:45 -0400 Subject: [PATCH] help.vocabs: inform the user when browsing a vocab that is not loaded. --- basis/help/vocabs/vocabs.factor | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/basis/help/vocabs/vocabs.factor b/basis/help/vocabs/vocabs.factor index e8b145d37e..a7cd70707d 100644 --- a/basis/help/vocabs/vocabs.factor +++ b/basis/help/vocabs/vocabs.factor @@ -227,6 +227,15 @@ C: vocab-author ] bi ] unless-empty ; +: vocab-is-not-loaded ( vocab -- ) + "Attention" $heading + vocab-name dup "The " " vocabulary is not loaded. In order to browse " + "its documentation, you must first load it." append surround print-element + "USE: " prepend 1array $code ; + +: describe-words ( vocab -- ) + dup vocab [ words $words ] [ vocab-is-not-loaded ] if ; + : words. ( vocab -- ) last-element off [ require ] [ words $words ] bi nl ; @@ -243,7 +252,7 @@ C: vocab-author first { [ describe-help ] [ describe-metadata ] - [ words $words ] + [ describe-words ] [ describe-files ] [ describe-children ] } cleave ;