From f38247b7c3fa73558d2ebe9f098a231686399b33 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Mon, 23 Jul 2012 09:37:20 -0700 Subject: [PATCH] editors: allow editing of word docs and tests. --- basis/editors/editors.factor | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/basis/editors/editors.factor b/basis/editors/editors.factor index 6f046454f8..96bdd73359 100644 --- a/basis/editors/editors.factor +++ b/basis/editors/editors.factor @@ -5,7 +5,7 @@ help.topics io io.backend io.files io.launcher io.pathnames kernel lexer math namespaces parser prettyprint sequences source-files source-files.errors splitting strings summary tools.crossref vocabs vocabs.files vocabs.hierarchy -vocabs.loader vocabs.metadata calendar threads ; +vocabs.loader vocabs.metadata calendar threads words ; FROM: vocabs => vocab-name >vocab-link ; IN: editors @@ -85,11 +85,21 @@ M: string edit edit-vocab ; [ [ smart-usage ] keep prefix ] bi edit-each ; -: edit-docs ( vocab -- ) - vocab-docs-path 1 edit-location ; +GENERIC: edit-docs ( object -- ) -: edit-tests ( vocab -- ) - vocab-tests-file 1 edit-location ; +M: object edit-docs vocab-docs-path 1 edit-location ; + +M: word edit-docs + dup "help-loc" word-prop + [ nip first2 edit-location ] + [ vocabulary>> edit-docs ] + if* ; + +GENERIC: edit-tests ( object -- ) + +M: object edit-tests vocab-tests-file 1 edit-location ; + +M: word edit-tests vocabulary>> edit-tests ; : edit-platforms ( vocab -- ) dup vocab-platforms-path vocab-append-path 1 edit-location ;