Hi citizens:
I found myself extensively modifying the Shell Script bundle for zsh- specific things. I eventually experienced what drunks refer to as a moment of clarity: Maybe having a separate ZSH bundle would be a good thing. So I renamed the bundle to zsh, then edited the Shell Script (bash) Language file, changed scopeName to 'source.zsh', and then changed all other instances of source.shell to source.zsh in the Scope Selector window in the other files.
It seems to work, but then when I went to put the default Shell Script bundle back in, it instead reversed changes I had made in stuff in the new zsh bundle.
So I deduced I am doing something wrong, that TextMate still identifies this with the previously named bundle, and the two won't co-exist until I fix the problem.
However, since I took a rather backward approach, I am not clear on what else I need to change in order for TextMate to recognize my attempt at a zsh bundle as something separate from the old Shell Script bundle. I've made some new bundles de novo, but I an not clear on how to fix the mess I made here.
Thanks.
Bill
PS: Once I have something nonpathological, I am happy to share it.
On Nov 20, 2006, at 9:25 PM, William Scott wrote:
So I deduced I am doing something wrong, that TextMate still identifies this with the previously named bundle, and the two won't co-exist until I fix the problem.
However, since I took a rather backward approach, I am not clear on what else I need to change in order for TextMate to recognize my attempt at a zsh bundle as something separate from the old Shell Script bundle. I've made some new bundles de novo, but I an not clear on how to fix the mess I made here.
Basically you are encountering the way TextMate treats bundle items and bundles in general. Each bundle item is characterized uniquely by a UUID, which is a string like this: 4694B05E-6227-11D9- BFB1-000D93589AF6 In fact, this is exactly the UUID that characterizes the shell bundle. You can find this out if you open the info.plist file of that bundle for editing in the editor. When you renamed the shell bundle, this did not change this number. So what you would have to do is in the command line find the bundle and duplicate it, and then in the copy find the corresponding info file, and use the "uuidgen" command line tool to generate a random UUID, and put that as the UUID in that file, so that it differs from the shell one.
Now, this is only half the work, since now each single bundle item had such a UUID, and for the time being those are the same in the copy as they were in the original. So you have to generate new UUID's and put them there for each one of them. You can probably create a script to do this for you.
If you prefer to do something equivalent from within the bundle editor, then you can do it as follows. The basic principle is that any operation that creates a new bundle/item provides it with a new UUID. So you would need to first create a new bundle. Then duplicate in the bundle editor each item of your original bundle, and move those duplicates to the new bundle you created. Those duplicates will have different UUID's if you create them using the Bundle Editor.
Finally, you need to recreate the menu structure, by selecting your new bundle and moving things around in the main area on the right of the bundle editor.
Hope this helps.
Thanks.
Bill
PS: Once I have something nonpathological, I am happy to share it.
Please do.
Haris
On Nov 20, 2006, at 10:13 PM, Charilaos Skiadas wrote:
change this number. So what you would have to do is in the command line find the bundle and duplicate it, and then in the copy find the corresponding info file, and use the "uuidgen" command line tool to generate a random UUID, and put that as the UUID in that file, so that it differs from the shell one.
Now, this is only half the work[snip]
Even simpler… ;)
Go into the bundle editor and select your bundle, hit the button at the bottom with two plusses to duplicate (middle button). This will give everything in there a unique uuid. Close the bundle editor. Then go into finder and delete your first bundle (in ~/Library/Application Support/Bundles/). Then in TextMate choose the reload bundles option under the Bundles menu. (You don't want to delete the bundle from within TextMate because then it would mark it as deleted and the old Shell Bundle would never appear.)
The simply rename the new bundle and everything should work just fine.
Realistically the Shell bundle was never meant to be specific to bash, it just has been because most people use bash so that's what people submitted stuff for. ;) Some of the things like command completion, path completion etc could actually be shared so it might make sense to leave it as one. But it depends how many bundle items a shell gets.
Also if it ends up that a lot of stuff is shared between them perhaps it would be good to use source.shell.*? Dunno, just a thought.
Bill
PS: Once I have something nonpathological, I am happy to share it.
Please do.
Haris
Thank you and Michael for the suggestions. I think I am about 99% of the way there.
My one remaining problem is that the default textmate Shell Script bundle "takes over" my files with #!/bin/zsh . I removed the firstLineMatch zsh entry from the Shell Script language bundle, but TextMate still behaves as if it were there. If I delete the Shell Script bundle entirely, leaving only my new zsh bundle, it does the right thing. Is there a less drastic solution, and also if I were to submit this, is there a way to "over-ride" the Shell Script bundle default short of editing it?
Some of my creations can work with any bourne-type shell, and I have at least one command that might be of general interest (it is a copy of the Run Script command but solicits arguments from the user to feed the shell script, which might be assigned shift-command-R or something evocative).
Most of the others are code snippets that are general but hard for me to remember.
Is there some vetting procedure to determine whether others might be interested, whether I have tried to or accidently inserted nefarious code, and so on?
Thanks again for your help.
My only complaint about TextMate is that it is one more thing to tinker with instead of getting my work done.
Bill
On Nov 21, 2006, at 12:36 AM, William Scott wrote:
My one remaining problem is that the default textmate Shell Script bundle "takes over" my files with #!/bin/zsh . I removed the firstLineMatch zsh entry from the Shell Script language bundle, but TextMate still behaves as if it were there. If I delete the Shell Script bundle entirely, leaving only my new zsh bundle, it does the right thing. Is there a less drastic solution, and also if I were to submit this, is there a way to "over-ride" the Shell Script bundle default short of editing it?
This is simply because the Bash grammar's match is overly broad since no other shell grammars have existed. It would be changed if there was a dedicated zsh grammar like yours. ;)
Should probably now get some input from Allan and see if he'd rather have one or more than one shell bundle. How many items are currently in it? (And do you have it up anywhere it can be downloaded?)