Permalink
Browse files

change scope from source.cfdg to source.context-free; add 'Render in …

…Context Free' command

git-svn-id: http://svn.textmate.org/trunk/Bundles/Context Free.tmbundle@5293 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information...
1 parent 5ae7b1e commit ca61fe16f9378d1f6ad31d6ec2df4473af67ef18 Jacob Rus committed Sep 21, 2006
View
56 Commands/Render in Context Free.tmCommand
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>beforeRunningCommand</key>
+ <string>nop</string>
+ <key>command</key>
+ <string>content () {
+ perl -pe 's/["\\]/\\$&amp;/g'
+}
+
+osascript &lt;&lt;-APPLESCRIPT
+ tell application "Context Free" to activate
+ menu_click({"Context Free", "File", "New"})
+ tell app "System Events"
+ set value of ((process "Context Free")'s (window 1)'s (splitter group 1)'s (group 1)'s (scroll area 1)'s (text area 1)) to "$(content)"
+ end tell
+ menu_click({"Context Free", "Render", "Render"})
+
+
+ -- Helper functions
+ on menu_click(mList)
+ local appName, topMenu, r
+ if mList's length &lt; 3 then error "Menu list is not long enough"
+ set {appName, topMenu} to (items 1 through 2 of mList)
+ set r to (items 3 through (mList's length) of mList)
+ tell app "System Events" to my menu_click_recurse(r, ((process appName)'s (menu bar 1)'s (menu bar item topMenu)'s (menu topMenu)))
+ end menu_click
+ on menu_click_recurse(mList, parentObject)
+ local f, r
+ set f to item 1 of mList
+ if mList's length &gt; 1 then set r to (items 2 through (mList's length) of mList)
+ tell app "System Events"
+ if mList's length is 1 then
+ click parentObject's menu item f
+ else
+ my menu_click_recurse(r, (parentObject's (menu item f)'s (menu f)))
+ end if
+ end tell
+ end menu_click_recurse
+
+APPLESCRIPT</string>
+ <key>input</key>
+ <string>selection</string>
+ <key>keyEquivalent</key>
+ <string>@r</string>
+ <key>name</key>
+ <string>Render in Context Free</string>
+ <key>output</key>
+ <string>showAsTooltip</string>
+ <key>scope</key>
+ <string>source.context-free</string>
+ <key>uuid</key>
+ <string>4A4BCD2A-C90D-4F5B-90A5-3C1B4208FBD6</string>
+</dict>
+</plist>
View
2 Preferences/Indentation Rules.tmPreferences
@@ -5,7 +5,7 @@
<key>name</key>
<string>Indentation Rules</string>
<key>scope</key>
- <string>source.cfdg</string>
+ <string>source.context-free</string>
<key>settings</key>
<dict>
<key>decreaseIndentPattern</key>
View
2 Preferences/Rules.tmPreferences
@@ -5,7 +5,7 @@
<key>name</key>
<string>Rules</string>
<key>scope</key>
- <string>source.cfdg entity.name.function.definition</string>
+ <string>source.context-free entity.name.function.definition</string>
<key>settings</key>
<dict>
<key>showInSymbolList</key>
View
2 Preferences/Symbol Overrides.tmPreferences
@@ -5,7 +5,7 @@
<key>name</key>
<string>Symbol Overrides</string>
<key>scope</key>
- <string>source.cfdg entity.name.function</string>
+ <string>source.context-free entity.name.function</string>
<key>settings</key>
<dict>
<key>showInSymbolList</key>
View
2 Snippets/Background Directive.tmSnippet
@@ -7,7 +7,7 @@
<key>name</key>
<string>Background Directive</string>
<key>scope</key>
- <string>source.cfdg</string>
+ <string>source.context-free</string>
<key>tabTrigger</key>
<string>b</string>
<key>uuid</key>
View
2 Snippets/Circle Primitive.tmSnippet
@@ -7,7 +7,7 @@
<key>name</key>
<string>Circle Primitive</string>
<key>scope</key>
- <string>source.cfdg</string>
+ <string>source.context-free</string>
<key>tabTrigger</key>
<string>C</string>
<key>uuid</key>
View
2 Snippets/Include Directive.tmSnippet
@@ -7,7 +7,7 @@
<key>name</key>
<string>Include Directive</string>
<key>scope</key>
- <string>source.cfdg</string>
+ <string>source.context-free</string>
<key>tabTrigger</key>
<string>i</string>
<key>uuid</key>
View
2 Snippets/Rule.tmSnippet
@@ -9,7 +9,7 @@
<key>name</key>
<string>Rule</string>
<key>scope</key>
- <string>source.cfdg</string>
+ <string>source.context-free</string>
<key>tabTrigger</key>
<string>r</string>
<key>uuid</key>
View
2 Snippets/Square Primitive.tmSnippet
@@ -7,7 +7,7 @@
<key>name</key>
<string>Square Primitive</string>
<key>scope</key>
- <string>source.cfdg</string>
+ <string>source.context-free</string>
<key>tabTrigger</key>
<string>S</string>
<key>uuid</key>
View
2 Snippets/Startshape Directive.tmSnippet
@@ -7,7 +7,7 @@
<key>name</key>
<string>Startshape Directive</string>
<key>scope</key>
- <string>source.cfdg</string>
+ <string>source.context-free</string>
<key>tabTrigger</key>
<string>s</string>
<key>uuid</key>
View
2 Snippets/Triangle Primitive.tmSnippet
@@ -7,7 +7,7 @@
<key>name</key>
<string>Triangle Primitive</string>
<key>scope</key>
- <string>source.cfdg</string>
+ <string>source.context-free</string>
<key>tabTrigger</key>
<string>T</string>
<key>uuid</key>
View
3 Syntaxes/Context Free.tmLanguage
@@ -5,6 +5,7 @@
<key>fileTypes</key>
<array>
<string>cfdg</string>
+ <string>context free</string>
</array>
<key>foldingStartMarker</key>
<string>[\{\[]\s*$</string>
@@ -494,7 +495,7 @@
</dict>
</dict>
<key>scopeName</key>
- <string>source.cfdg</string>
+ <string>source.context-free</string>
<key>uuid</key>
<string>8D0EE5A2-FB60-40F8-8D0F-1E1FFB506462</string>
</dict>
View
3 info.plist
@@ -6,6 +6,8 @@
<dict>
<key>items</key>
<array>
+ <string>4A4BCD2A-C90D-4F5B-90A5-3C1B4208FBD6</string>
+ <string>------------------------------------</string>
<string>C6506DEB-C9DB-4996-BAA0-78897BD9931E</string>
<string>6545F453-C10C-4495-97AC-119FEDE9E877</string>
<string>54E5EF74-2097-4C8E-9456-19943792AADE</string>
@@ -27,6 +29,7 @@
<string>C63A09B4-482D-4B91-B4BA-5B844BAEBB2B</string>
<string>563F7F3C-A0BD-4E1E-AA5C-FEB12D7371C6</string>
<string>8EF0593F-78AB-4D96-BB8C-51BFA61D29CD</string>
+ <string>4A4BCD2A-C90D-4F5B-90A5-3C1B4208FBD6</string>
<string>C6506DEB-C9DB-4996-BAA0-78897BD9931E</string>
<string>6545F453-C10C-4495-97AC-119FEDE9E877</string>
<string>54E5EF74-2097-4C8E-9456-19943792AADE</string>

0 comments on commit ca61fe1

Please sign in to comment.