]> gitweb.factorcode.org Git - factor.git/commitdiff
FUEL: Better handling of $see in help browser.
authorJose A. Ortega Ruiz <jao@gnu.org>
Thu, 29 Jan 2009 23:20:58 +0000 (00:20 +0100)
committerJose A. Ortega Ruiz <jao@gnu.org>
Thu, 29 Jan 2009 23:20:58 +0000 (00:20 +0100)
extra/fuel/help/help.factor
misc/fuel/fuel-markup.el

index e70327bd35b949ad9cd51409bb90a8d1d9e94475..55183734b37ce14132a385b568cb8e2f3f4c7dd2 100644 (file)
@@ -2,15 +2,15 @@
 ! See http://factorcode.org/license.txt for BSD license.
 
 USING: accessors arrays assocs combinators help help.crossref
-help.markup help.topics io io.streams.string kernel make memoize
-namespaces parser prettyprint sequences summary tools.vocabs
-tools.vocabs.browser vocabs vocabs.loader words ;
+help.markup help.topics io io.streams.string kernel make namespaces
+parser prettyprint sequences summary tools.vocabs tools.vocabs.browser
+vocabs vocabs.loader words ;
 
 IN: fuel.help
 
 <PRIVATE
 
-MEMO: fuel-find-word ( name -- word/f )
+: fuel-find-word ( name -- word/f )
     [ [ name>> ] dip = ] curry all-words swap filter
     dup empty? not [ first ] [ drop f ] if ;
 
@@ -102,11 +102,11 @@ PRIVATE>
 : (fuel-vocab-help) ( name -- str )
     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 ]
     [ 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 ]
     [ tagged fuel-vocab-list ] bi 2array ;
 
index 7a8fa0c234885eb08ff10576afaa758812cfaf71..2784335fbbb1298b55debf090b148e1d4b04d5e1 100644 (file)
 
 (defun fuel-markup--see (e)
   (let* ((word (nth 1 e))
-         (cmd (and word `(:fuel* (,(format "%s" word) fuel-word-see) "fuel" t)))
-         (res (and cmd
-                   (fuel-eval--retort-result (fuel-eval--send/wait cmd 100)))))
+         (cmd (and word `(:fuel* ((:quote ,(format "%S" word)) see) "fuel")))
+         (ret (and cmd (fuel-eval--send/wait cmd)))
+         (res (and (not (fuel-eval--retort-error ret))
+                   (fuel-eval--retort-output ret))))
     (if res
         (fuel-markup--code (list '$code res))
-      (fuel-markup--snippet (list '$snippet word)))))
+      (fuel-markup--snippet (list '$snippet " " word)))))
 
 (defun fuel-markup--null (e))