I like how TextMate seamlessly merges user bundles with the default bundles. I can add new snippets, for example, and they'll be stored (transparently) in my ~/Library folder, so that when I upgrade to a new version of TextMate, my custom snippets won't get blown away.
This works great for adding things to the default bundles, but what about changing them? I know any changes I make to a default bundle will override the original, but that works well only until the next TextMate release comes out. Consider the release notes from the recent update:
"Lots and lots of changes, fixes, and additions to the bundles."
That means wherever I've made a change to a bundle, even small tweaks, I'll be losing all these bug fixes and enhancements that have been made in the new version. For this reason, I've been avoiding making any changes to the default bundles, but of course this prevents me from tweaking the bundles to suit my particular needs and workflow.
I'm wondering how other TextMate users handle this problem. Do people track the bundle repository, merging upstream changes (and fixing conflicts) as they occur? Or is it more common simply to avoid making any changes at all, as I've been doing (reluctantly)?
Trevor
Trevor,
I guess the most sensible approach to do such things is to create a new bundle and override the stuff in the "old" = "original" bundle. For example: when you have a better version of a snippet you can just move the snippet from the old bundle to your new one, keep its scope selector and keyboard shortcuts etc. And then change it. When you update TextMate and/or when you update from the subversion Bundle repository you will get new versions… which then collide and whenever you access that command/keystroke it will give you the popup menu -- so you will know there might be changes in the original bundle; but you can also have multiple versions of a command or snippet around this way.
I have written a short how-to for the wiki on extending language grammars at http://macromates.com/wiki/Main/Howtos#bundleExtension
Dan
On Apr 4, 2006, at 4:48 AM, Daniel Käsmayr wrote:
I guess the most sensible approach to do such things is to create a new bundle and override the stuff in the "old" = "original" bundle. For example: when you have a better version of a snippet you can just move the snippet from the old bundle to your new one, keep its scope selector and keyboard shortcuts etc. And then change it. When you update TextMate and/or when you update from the subversion Bundle repository you will get new versions… which then collide and whenever you access that command/keystroke it will give you the popup menu -- so you will know there might be changes in the original bundle; but you can also have multiple versions of a command or snippet around this way.
I'm a bit confused about how this would work. Let's say I want to tweak the Run Script command in the Python bundle. Is the following scenario correct?
1. Select the Run Script command in the Bundle Editor and hit the ++ button to duplicate it 2. Tweak the source of the command as needed 3. There is now a conflict between the new and old commands, so change the shortcut of the old command to something else
At this point, I've got my tweaked command doing what the original used to do, and the original is still there, sitting in the background.
But what happens when I upgrade TextMate and there is a new version of Run Script? Does TextMate replace my original one (which still has the same name, only a different shortcut)? If so, then perhaps that means I can simply delete the original after making a copy for my own use. That should work, as long as I make sure the name of my tweaked command is different from the old one, right?
Trevor
On 5/4/2006, at 22:18, Trevor Harmon wrote:
If so, then perhaps that means I can simply delete the original after making a copy for my own use.
You can, but then it’s better just to edit it. Since it’s easier to restore an edited item to the default setting (by removing the custom one from ~/Library) then undelete default items (which require messing with the bundles info.plist, which also end in ~/Library).
That should work, as long as I make sure the name of my tweaked command is different from the old one, right?
Bundle items all have UUID [1] so the name plays no role in this. If you edit a default, TM will always see it as the edited default, if you duplicate a default, this is a new item, no matter what you call it.
[1] Universal Unique Identifiers
Hi Trevor,
You have to be careful in this situation, indeed.
# Adding stuff
I have my own bundle where I add all kinds of stuff and try not to change the default bundles. A clever naming theme for those item (I use All: foo, CSS: Insert Color, Text: Footnote, ..) will make it manageable.
# Basic Snippets
I changed all the snippets in the PHP bundle to suit my code formatting. Those snippets won't be updated anyway, because they are very basic. So, no worries about losing new functionality.
# Changing complexer things
I'm listening on the TextMate dev Mailing List for bundle changes (and I'm in the IRC channel most of the time) so I know, what's going on. Also if you check out Bundles via subversion (what you don't seem to do) you can see, which items changed. If I see any interesting stuff there, I will have a look at it, and merge or replace my stuff. Otherwise making a duplicate of the particular command in your own bundle and changing that, brings you some way. Sure, there will be a popup dialog asking you what to execute when triggering the shortcut. Unfortunately, changing a bundle item keyboard shortcut will duplicate the whole thing. So either you make a new shortcut for your own stuff, or live with the dialog. If you are sure, your adapted command is better in some ways, then the default command, be sure to post it here on the list, others might find it interesting too and your version could make it into the default bundle.
# Bundle Editor
There were some proposals for how to improve the Bundle Editor and include a versioning and merging of Default bundles, local changes and SVN checkouts. I had wanted to whip something together (just a command line script which compares dates and makes diffs, to view and make patches), but did not find the time yet.
So. I don't know if that was particularly helpful.
Soryu.
On 4/4/2006, at 14:02, Soryu wrote:
# Changing complexer things
I'm listening on the TextMate dev Mailing List for bundle changes (and I'm in the IRC channel most of the time) so I know, what's going on.
There is also an RSS feed which contains the changes:
feed://macromates.com/svnlog/bundles.rss
Even users who do not use the svn checkout, may want to subscribe, as this is the only change log published for bundles.
But as Soryu says: if you change a snippet, you generally don’t care about the original version. For commands it’s slightly different, but we try to allow “stylistic changes” via environment variables. And (again to repeat Soryu) if someone improves a command in a useful way, we would love to hear about it, as we may then want to roll in the changes in the default version.
# Bundle Editor
There were some proposals for how to improve the Bundle Editor and include a versioning and merging of Default bundles, local changes and SVN checkouts. I had wanted to whip something together (just a command line script which compares dates and makes diffs, to view and make patches), but did not find the time yet.
I also have something like this on my to-do, but you know… time and priorities…
There were some proposals for how to improve the Bundle Editor and include a versioning and merging of Default bundles, local changes and SVN checkouts. I had wanted to whip something together (just a command line script which compares dates and makes diffs, to view and make patches), but did not find the time yet.
I also have something like this on my to-do, but you know time and priorities
I think a major weakness of tm at present is the need to use svn to get language features (bundles).
What I'd like to see for users like myself is a page which parses the SVN repository into a list of download links to current bundles.
This is how subethaedit works, and it is great for people who just want to grab a bundle and be done with it. (tm is better than subethaedit in that if you do get a .tmtheme or other file, tm can install it for you: subetha just says "you need to stick this in one of these places..."
On Apr 4, 2006, at 11:22 AM, Timothy Bates wrote:
I think a major weakness of tm at present is the need to use svn to get language features (bundles).
As a newly subscribed list member, testing with the TM demo, I can say I agree. In fact, it is one of the reasons that I haven't bought- in, and I'm spending today looking at the alternatives. I work alone, and don't use SVN for anything else. I have it installed, but it is a PITA for someone who doesn't otherwise need it.
The other reason is that the Actionscript bundle is pretty out of date, and the commands do not work for Actionscript, apparently requiring Perl.
-- Troy RPSystems, Ltd. http://www.rpsystems.net
On Apr 4, 2006, at 11:40 AM, Daniel Käsmayr wrote:
The other reason is that the Actionscript bundle is pretty out of date, and the commands do not work for Actionscript, apparently requiring Perl.
Isn't Perl 5.8.6 included in every OSX install?
<shrug> I thought OSX was more oriented to php.
I don't know. I don't use Perl for anything either. It isn't on my system afaik, and if it is, it isn't working.
So, to effectively use TM, I need to deal with svn and perl issues?
I'm probably shopping at the wrong store. I wanted a productive text editor that works with the applications I DO use, without messing with configuring and troubleshooting a bunch of stuff I don't.
-- Troy RPSystems, Ltd. http://www.rpsystems.net
On Apr 4, 2006, at 11:58 AM, Andy Armstrong wrote:
Isn't Perl 5.8.6 included in every OSX install?
<shrug> I thought OSX was more oriented to php.
OS X ships with Perl, yes.
In fact it is. And, it is working (just tested.)
So then, the actionscript commands don't work for other reasons. Probably aimed at mx2004, where I have Flash 8 installed.
-- Troy RPSystems, Ltd. http://www.rpsystems.net
So, to effectively use TM, I need to deal with svn and perl issues?
I'm probably shopping at the wrong store. I wanted a productive text editor that works with the applications I DO use, without messing with configuring and troubleshooting a bunch of stuff I don't.
One of the great things of TextMate is the neat integration of all those unix commands. OSX comes shipped with perl, python, ruby, php - you name it. Plus of course all those little utilities that make Unix more than just a kernel - grep, awk, wc… and far more. With TextMate you can use them, combine then and do a lot of stuff that simply can't be done in other editors. If something does not work the way you expect it - here is the right place to ask (or in the IRC channel). But it should pretty much work out-of-the box (except if you broke it in some way).
A default set of bundles is included in every TextMate release. For special things or bundles under development, there is the svn archive. This is bleeding edge, under development or special interest. You don't HAVE to use it, to work with TextMate. The next release will always (mostly) update the standard set of bundles.
In fact, there are people using TextMate who never even opened the Bundle Editor and still find it a great Editor.
Soryu.
On 4/4/2006, at 17:54, Troy Rollins wrote:
[...] So, to effectively use TM, I need to deal with svn and perl issues?
No. Perl works out-of-the-box and TextMate comes out-of-the-box with bundles for all the popular languages [1], including HTML, PHP, Apache, ActionScript, CSS, JavaScript, and, SQL.
Exactly what problem are you facing, which makes you think you have to deal with svn or Perl?
[1] Here’s the full list: ActionScript, Apache, C, CSS, Diff, HTML, Java, JavaScript, Latex, Markdown, Math, Objective-C, OpenGL, PHP, PHPDoc, Perl, PropertyList, Python, Rails, Ruby, SQL, Source, Subversion, TODO, Text, TextMate, Textile, Transmit, UnixShell, Web Searches, XML, Xcode, and YAML.
On Apr 4, 2006, at 12:14 PM, Allan Odgaard wrote:
Exactly what problem are you facing, which makes you think you have to deal with svn or Perl?
[1] Here’s the full list: ActionScript,
The Actionscript commands don't do anything, probably because of Flash 8? I'm also not sure that Mike Chambers command line tool has been updated for Flash 8, so it could be that the entire AS command set is not valid.
I know I've heard about something having to do with using the mtasc compiler with TM, but can't really find the details... anyway mtasc is not in my current workflow, and it is another thing I don't really need right now.
My workflow DOES involve the Flash IDE, which has a code editor well- known for its limitations, so I'd like to supplement it. Eclipse performs like a pig under OSX even on my quad, so I want something faster. TextMate in general has the performance, and some awesome tools (and a good opportunity to grow my meager UNIX skills), but I'd like to be productive while I learn to best use it.
-- Troy RPSystems, Ltd. http://www.rpsystems.net
On Apr 4, 2006, at 12:26 PM, Troy Rollins wrote:
The Actionscript commands don't do anything, probably because of Flash 8? I'm also not sure that Mike Chambers command line tool has been updated for Flash 8, so it could be that the entire AS command set is not valid.
For instance, selecting something in actionscript, and firing the "find in actionscript dictionary" which has a command which reads:
"$TM_BUNDLE_SUPPORT/Tools/asd.pl"
Sort of works, it shows the items it found in a new window (apparently only from the basic actionscript dictionary). Selecting one of them however causes eternal chasing arrows in that window.
The "Test Movie" command seems to work, and is a simple jsfl, so that makes sense.
"Build in flash", is based on FlashCommand by Mike Chambers, and I'm not sure that has been made compatible with Flash 8.
I didn't try "publish movie", but it should work, as it is again a jsfl which very simply aims at the currently open movie (frontmost tab in Flash).
"Show AS function signature" doesn't seem to do anything on my system.
Is the actionscript functionality in TM considered to be compatible with Flash 8? Should I assume not, or try to find out why it mostly doesn't work on my own system?
Thanks. -- Troy RPSystems, Ltd. http://www.rpsystems.net
On 4/4/2006, at 20:06, Troy Rollins wrote:
For instance, selecting something in actionscript, and firing the "find in actionscript dictionary" which has a command which reads:
"$TM_BUNDLE_SUPPORT/Tools/asd.pl"
Sort of works, it shows the items it found in a new window (apparently only from the basic actionscript dictionary). Selecting one of them however causes eternal chasing arrows in that window.
Try right-click the link and copy it, to see what it leads to. The progress indicator would imply that it’s trying to load the link you clicked (but for some reason, get stuck during that).
"Show AS function signature" doesn't seem to do anything on my system.
It should show the result (function signature) as a tool tip. Likely it doesn’t find one. I assume you would use it when the caret is on an AS (framework/library) function.
Is the actionscript functionality in TM considered to be compatible with Flash 8?
Personally I know nothing about ActionScript or Flash. But this stuff seems to be for MX 2004, which I assume predates Flash 8?!?
On Apr 4, 2006, at 7:40 PM, Allan Odgaard wrote:
Is the actionscript functionality in TM considered to be compatible with Flash 8?
Personally I know nothing about ActionScript or Flash. But this stuff seems to be for MX 2004, which I assume predates Flash 8?!?
Exactly. And Macromedia made some structural changes which pretty much breaks most of these commands.
-- Troy RPSystems, Ltd. http://www.rpsystems.net
On Apr 4, 2006, at 5:02 AM, Soryu wrote:
Otherwise making a duplicate of the particular command in your own bundle and changing that, brings you some way. Sure, there will be a popup dialog asking you what to execute when triggering the shortcut. Unfortunately, changing a bundle item keyboard shortcut will duplicate the whole thing. So either you make a new shortcut for your own stuff, or live with the dialog.
So if all I do is change the shortcut of an item, then TextMate will see that as a completely overridden item, and thus after an upgrade, any changes to that item will be invisible to me (because I've overridden them)?
Trevor
On 5/4/2006, at 22:27, Trevor Harmon wrote:
So if all I do is change the shortcut of an item, then TextMate will see that as a completely overridden item, and thus after an upgrade, any changes to that item will be invisible to me (because I've overridden them)?
Yes: http://macromates.com/textmate/manual/ bundles#editing_default_bundles_items