From 9cb58b78ef4f67201f3ff2b506307292fde8560a Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Mon, 6 Aug 2007 05:05:37 -0400 Subject: Initial import of utility scripts. --- modules/new | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100755 modules/new (limited to 'modules/new') 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 mitchellcaladbolg.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 mitchellcaladbolg.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 mitchellcaladbolg.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 -- cgit v1.2.3