aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+667e-11@users.noreply.github.com>2007-08-06 05:05:37 -0400
committerGravatar mitchell <70453897+667e-11@users.noreply.github.com>2007-08-06 05:05:37 -0400
commit9cb58b78ef4f67201f3ff2b506307292fde8560a (patch)
treee421062cba6d7c3699097118da11520cef9dd5e6 /modules
parent9f18f8ab9acce36399aa34c1f11c966b792f3d2f (diff)
Initial import of utility scripts.
Diffstat (limited to 'modules')
-rwxr-xr-xmodules/new68
1 files changed, 68 insertions, 0 deletions
diff --git a/modules/new b/modules/new
new file mode 100755
index 00000000..18f23902
--- /dev/null
+++ b/modules/new
@@ -0,0 +1,68 @@
+#!/bin/sh
+
+# usage:
+# ./new [module_name] [language_name]
+
+mkdir $1
+
+cat > $1/init.lua <<_EOF
+-- Copyright 2007 Mitchell mitchell<att>caladbolg.net. See LICENSE.
+
+---
+-- The $1 module.
+-- It provides utilities for editing $2 code.
+module('modules.$1', package.seeall)
+
+if type(_G.snippets) == 'table' then
+---
+-- Container for $2-specific snippets.
+-- @class table
+-- @name snippets.$1
+ _G.snippets.$1 = {}
+end
+
+if type(_G.keys) == 'table' then
+---
+-- Container for $2-specific key commands.
+-- @class table
+-- @name keys.$1
+ _G.keys.$1 = {}
+end
+
+require '$1.commands'
+require '$2.snippets'
+
+function set_buffer_properties()
+
+end
+_EOF
+
+cat > $1/snippets.lua <<_EOF
+-- Copyright 2007 Mitchell mitchell<att>caladbolg.net. See LICENSE.
+
+---
+-- Snippets for the $1 module.
+module('modules.$1.snippets', package.seeall)
+
+local snippets = _G.snippets
+
+if type(snippets) == 'table' then
+ snippets.$1 = {}
+end
+_EOF
+
+cat > $1/commands.lua <<_EOF
+-- Copyright 2007 Mitchell mitchell<att>caladbolg.net. See LICENSE.
+
+---
+-- Commands for the $1 module.
+module('modules.$1.commands', package.seeall)
+
+-- $2-specific key commands.
+local keys = _G.keys
+if type(keys) == 'table' then
+ keys.$1 = {
+ al = { textadept.io.open, _HOME..'/modules/$1/init.lua' },
+ }
+end
+_EOF