FUEL: Better handling of $see in help browser.

db4
Jose A. Ortega Ruiz 2009-01-30 00:20:58 +01:00
parent 303e238374
commit 2ea9d0bce1
2 changed files with 11 additions and 10 deletions

View File

@ -2,15 +2,15 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays assocs combinators help help.crossref USING: accessors arrays assocs combinators help help.crossref
help.markup help.topics io io.streams.string kernel make memoize help.markup help.topics io io.streams.string kernel make namespaces
namespaces parser prettyprint sequences summary tools.vocabs parser prettyprint sequences summary tools.vocabs tools.vocabs.browser
tools.vocabs.browser vocabs vocabs.loader words ; vocabs vocabs.loader words ;
IN: fuel.help IN: fuel.help
<PRIVATE <PRIVATE
MEMO: fuel-find-word ( name -- word/f ) : fuel-find-word ( name -- word/f )
[ [ name>> ] dip = ] curry all-words swap filter [ [ name>> ] dip = ] curry all-words swap filter
dup empty? not [ first ] [ drop f ] if ; dup empty? not [ first ] [ drop f ] if ;
@ -102,11 +102,11 @@ PRIVATE>
: (fuel-vocab-help) ( name -- str ) : (fuel-vocab-help) ( name -- str )
dup empty? [ fuel-vocab-children-help ] [ (fuel-vocab-element) ] if ; dup empty? [ fuel-vocab-children-help ] [ (fuel-vocab-element) ] if ;
MEMO: (fuel-get-vocabs/author) ( author -- element ) : (fuel-get-vocabs/author) ( author -- element )
[ "Vocabularies by " prepend \ $heading swap 2array ] [ "Vocabularies by " prepend \ $heading swap 2array ]
[ authored fuel-vocab-list ] bi 2array ; [ authored fuel-vocab-list ] bi 2array ;
MEMO: (fuel-get-vocabs/tag) ( tag -- element ) : (fuel-get-vocabs/tag) ( tag -- element )
[ "Vocabularies tagged " prepend \ $heading swap 2array ] [ "Vocabularies tagged " prepend \ $heading swap 2array ]
[ tagged fuel-vocab-list ] bi 2array ; [ tagged fuel-vocab-list ] bi 2array ;

View File

@ -585,12 +585,13 @@
(defun fuel-markup--see (e) (defun fuel-markup--see (e)
(let* ((word (nth 1 e)) (let* ((word (nth 1 e))
(cmd (and word `(:fuel* (,(format "%s" word) fuel-word-see) "fuel" t))) (cmd (and word `(:fuel* ((:quote ,(format "%S" word)) see) "fuel")))
(res (and cmd (ret (and cmd (fuel-eval--send/wait cmd)))
(fuel-eval--retort-result (fuel-eval--send/wait cmd 100))))) (res (and (not (fuel-eval--retort-error ret))
(fuel-eval--retort-output ret))))
(if res (if res
(fuel-markup--code (list '$code res)) (fuel-markup--code (list '$code res))
(fuel-markup--snippet (list '$snippet word))))) (fuel-markup--snippet (list '$snippet " " word)))))
(defun fuel-markup--null (e)) (defun fuel-markup--null (e))