]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/ui/tools/operations/operations.factor
Fix conflict
[factor.git] / basis / ui / tools / operations / operations.factor
index d8802d66c934ee2fb6f35afff69fd723225a70ba..ac95ebfef7a59105c39d1d99bfec6dbd0175d8c1 100644 (file)
@@ -1,21 +1,20 @@
-! Copyright (C) 2006, 2007 Slava Pestov.
+! Copyright (C) 2006, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: continuations definitions ui.tools.browser
-ui.tools.interactor ui.tools.listener ui.tools.profiler
-ui.tools.search ui.tools.traceback ui.tools.workspace generic
-help.topics stack-checker summary inspector io.pathnames
-io.styles kernel namespaces parser prettyprint quotations
-tools.annotations editors tools.profiler tools.test tools.time
-tools.walker ui.commands ui.gadgets.editors ui.gestures
-ui.operations ui.tools.deploy vocabs vocabs.loader words
-sequences tools.vocabs classes compiler.units accessors
-vocabs.parser ;
+USING: continuations definitions generic help.topics threads
+stack-checker summary io.pathnames io.styles kernel namespaces
+parser prettyprint quotations tools.crossref tools.annotations
+editors tools.profiler tools.test tools.time tools.walker vocabs
+vocabs.loader words sequences tools.vocabs classes
+compiler.units accessors vocabs.parser macros.expander ui
+ui.tools.browser ui.tools.listener ui.tools.listener.completion
+ui.tools.profiler ui.tools.inspector ui.tools.traceback
+ui.commands ui.gadgets.editors ui.gestures ui.operations
+ui.tools.deploy models ;
 IN: ui.tools.operations
 
 ! Objects
-[ drop t ] \ inspect H{
+[ drop t ] \ inspector H{
     { +primary+ t }
-    { +listener+ t }
 } define-operation
 
 : com-prettyprint ( obj -- ) . ;
@@ -34,8 +33,12 @@ IN: ui.tools.operations
 
 [ drop t ] \ com-unparse H{ } define-operation
 
-! Input
+! Models
+[ model? ] \ inspect-model H{
+    { +primary+ t }
+} define-operation
 
+! Input
 : com-input ( obj -- ) string>> listener-input ;
 
 [ input? ] \ com-input H{
@@ -56,11 +59,23 @@ IN: ui.tools.operations
     { +secondary+ t }
 } define-operation
 
+! Thread
+: com-thread-traceback-window ( thread -- )
+    continuation>> dup occupied>>
+    [ value>> traceback-window ]
+    [ drop beep ]
+    if ;
+
+[ thread? ] \ com-thread-traceback-window H{
+    { +primary+ t }
+    { +secondary+ t }
+} define-operation
+
 ! Pathnames
 : edit-file ( pathname -- ) edit ;
 
 [ pathname? ] \ edit-file H{
-    { +keyboard+ T{ key-down f { C+ } "E" } }
+    { +keyboard+ T{ key-down f { C+ } "e" } }
     { +primary+ t }
     { +secondary+ t }
     { +listener+ t }
@@ -69,7 +84,7 @@ IN: ui.tools.operations
 UNION: definition word method-spec link vocab vocab-link ;
 
 [ definition? ] \ edit H{
-    { +keyboard+ T{ key-down f { C+ } "E" } }
+    { +keyboard+ T{ key-down f { C+ } "e" } }
     { +listener+ t }
 } define-operation
 
@@ -78,25 +93,18 @@ UNION: definition word method-spec link vocab vocab-link ;
 
 [ definition? ] \ com-forget H{ } define-operation
 
-! Words
-[ word? ] \ insert-word H{
-    { +secondary+ t }
-} define-operation
-
 [ topic? ] \ com-follow H{
-    { +keyboard+ T{ key-down f { C+ } "H" } }
+    { +keyboard+ T{ key-down f { C+ } "h" } }
     { +primary+ t }
 } define-operation
 
-: com-usage ( word -- )
-    get-workspace swap show-word-usage ;
-
-[ word? ] \ com-usage H{
-    { +keyboard+ T{ key-down f { C+ } "U" } }
+[ word? ] \ usage. H{
+    { +keyboard+ T{ key-down f { C+ } "u" } }
+    { +listener+ t }
 } define-operation
 
 [ word? ] \ fix H{
-    { +keyboard+ T{ key-down f { C+ } "F" } }
+    { +keyboard+ T{ key-down f { C+ } "f" } }
     { +listener+ t }
 } define-operation
 
@@ -108,25 +116,11 @@ GENERIC: com-stack-effect ( obj -- )
 
 M: quotation com-stack-effect infer. ;
 
-M: word com-stack-effect def>> com-stack-effect ;
-
-[ word? ] \ com-stack-effect H{
-    { +listener+ t }
-} define-operation
-
-! Vocabularies
-: com-vocab-words ( vocab -- )
-    get-workspace swap show-vocab-words ;
-
-[ vocab? ] \ com-vocab-words H{
-    { +secondary+ t }
-    { +keyboard+ T{ key-down f { C+ } "B" } }
-} define-operation
+M: word com-stack-effect 1quotation com-stack-effect ;
 
 : com-enter-in ( vocab -- ) vocab-name set-in ;
 
 [ vocab? ] \ com-enter-in H{
-    { +keyboard+ T{ key-down f { C+ } "I" } }
     { +listener+ t }
 } define-operation
 
@@ -138,12 +132,10 @@ M: word com-stack-effect def>> com-stack-effect ;
 } define-operation
 
 [ vocab-spec? ] \ run H{
-    { +keyboard+ T{ key-down f { C+ } "R" } }
     { +listener+ t }
 } define-operation
 
 [ vocab? ] \ test H{
-    { +keyboard+ T{ key-down f { C+ } "T" } }
     { +listener+ t }
 } define-operation
 
@@ -165,33 +157,24 @@ M: word com-stack-effect def>> com-stack-effect ;
     { +listener+ t }
 } define-operation
 
-: com-show-profile ( workspace -- )
-    profiler-gadget call-tool ;
-
-: com-profile ( quot -- ) profile f com-show-profile ;
+: com-profile ( quot -- ) profile profiler-window ;
 
 [ quotation? ] \ com-profile H{
-    { +keyboard+ T{ key-down f { C+ } "r" } }
+    { +keyboard+ T{ key-down f { C+ } "o" } }
     { +listener+ t }
 } define-operation
 
-! Profiler presentations
-[ dup usage-profile? swap vocab-profile? or ]
-\ com-show-profile H{ { +primary+ t } } define-operation
+: com-expand-macros ( quot -- ) expand-macros . ;
 
-! Operations -> commands
-source-editor
-"word"
-"These commands operate on the Factor word named by the token at the caret position."
-\ selected-word
-[ selected-word ]
-[ dup search [ ] [ no-word ] ?if ] 
-define-operation-map
+[ quotation? ] \ com-expand-macros H{
+    { +keyboard+ T{ key-down f { C+ } "m" } }
+    { +listener+ t }
+} define-operation
 
+! Operations -> commands
 interactor
 "quotation"
 "These commands operate on the entire contents of the input area."
 [ ]
 [ quot-action ]
-[ [ parse-lines ] with-compilation-unit ]
 define-operation-map