I don't know if TextMate supports read-only documents or not, but I would like to be able to specify a custom view filter for a given document in my project that produced a read-only text or html file in place of the document's content that automatically displayed as a normal project tab. The document in the tab view should have all of the TextMate-specific features of a normal Commmand output window (e.g. go to line, etc.)
Use Cases ---------
TextMate doesn't allow you to view jpegs, which is fine. But if I could define a filter to run on selection that produced HTML output, I could not only view the jpeg in the tab, but I could list statistics about the file (size, dimensions, etc.) that I could either just read or select and copy-and-past somewhere else in my project.
Viewing object files using the output from otool would also be handy, particularly with the go-to feature and the ability to convert to (more attractive) html output.
Man pages are another option. Define a blank file "xcodebuild.man" and include it in your project hierarchy, setting a project-wide .man filter to the output from Bwana (which does html man pgae output). Now you can just click on (or tab to) the man page to read it, without having an extra window pop-up or having to execute a command.
Custom UIs embedded in TextMate are another huge opportunity. Define a Project.build_ui file and filter through something that generates an HTML page that nicely renders all of your build options, along with some handy buttons to initiate a build, view the last build results (in an embedded HTML scroll view, whose lines have standard Command go-to line behavior), etc. The customization possibilities for TextMate are endless.
An embedded Subversion UI is another option.
An embedded Trac page is another. The possibilities are endless.
The key thing is that the filter is *automatic*. This makes it appear in a tab just like any other built-in TextMate feature as far as the user is concerned. This builds on the existing Command... infrastructure Allan's already built.
UI Implementation -----------------
Select file in Project browser and choose "Filter through Script...". Up pops a dialog similar to the Command editor dialog. Extra options include: update when source changes, update on view, and update first time only.
Project-wide options would allow you to assign filters to extensions automatically (e.g. .jpg).
Any comments or suggestions are welcome.
Best, Erich
On May 2, 2005, at 22:41, Erich Ocean wrote:
[...] Any comments or suggestions are welcome.
Sounds like a very good idea. So as I see it, this can be achieved with basically 2 extensions to the current system: 1) commands can “overwrite” the current buffer, and if output is HTML, the text view will just switch to an HTML view and, 2) commands can be setup to fire when selecting files in the project drawer, so basically just a new activation mechanism.
With a tab-system like Safari there will be per buffer history, and #1 will just be switching to a new buffer within the same tab, and might be nice to have in general (or variations, where instead it splits the buffer and shows the output in the split view etc.).
I'm adding this as a goal to the project-window make-over.