[TxMt] Re: making a new bundle from old

William Scott wgscott at chemistry.ucsc.edu
Tue Nov 21 16:32:57 UTC 2006


Hi Michael:


I've put the stuff here:   http://xanana.ucsc.edu/xtal/ 
textmate_extra_bundles.tgz

Please remember this is still rather rough, and I'm not sure I'm  
doing things right.

Almost everything I have in this either would work with bash or will  
work with trivial modifications (I could change "print" to "echo" and  
figure out a workaround to the different array indexing conventions  
(zsh defines the first element of an array as having index 1, bash  
and every other computer language seem to agree on 0).

So if some of these things were to be incorporated, I suggest that a  
separate zsh bundle not be made.  bash has become more and more zsh- 
like in syntax, and the stuff like [[ condition ]]  used in zsh is  
already in the Scripting Bundle.

If there is to be a new shell script bundle, I would suggest having  
two scripting bundles:  One that is Bourne/Korn-like, and one that is  
tcsh-like, in its syntax. This is a more natural divide.  The current  
Scripting Bundle isn't really useful for tcsh scripts apart from the  
syntax highlighting and commands.  It probably isn't worth the  
trouble to have a separate zsh bundle.  Most people script in bash.   
I like zsh because I learned ksh and it is quite elegant, but isn't  
as portable (yet) as bash. I've been happily using (and adding to)  
the bash-centric scripting bundle for a couple of months now.

In my zsh bundle, I've got a bunch of shell/osascript snippets.  I  
think changing print to echo is all that would be needed to make them  
bash-compatible (at least the ones I just tested).  I don't know if  
they would be of general interest, but they permit the scripter to  
use some simple OS X gui elements in their shell scripts, which is  
kind of entertaining.

I modified the "Run Script" command to permit the user to enter  
arguments to the shell script before running it.  Although I wrote  
the command in zsh, there is no reason why bash or tcsh users can't  
use it.  Maybe it should be shift-command-R (if that is not taken) to  
allow the user the choice.

I also put in some conditional test snippets and a few other generic  
things that may or may not be of interest.

HTH,

Bill


William G. Scott

contact info:  http://chemistry.ucsc.edu/~wgscott







More information about the textmate mailing list