Re: [TxMt] get TM markups for syntax highlighting à la inputFormat=xml

Hans-Joerg Bibiko bibiko at eva.mpg.de
Thu Dec 7 09:05:12 UTC 2006


> [...]
> But my point is the nice Web Preview option "Refresh after change".
>
> That means that while typing my document the transformed Web  
> Preview shows the latest changes. Of course I always can type some  
> short cut to get this via a command, but "Refresh after change"  
> would be more comfortable ;)
>
> On the other hand, maybe there is a way to call a Bundle's command  
> like a cron job, i.e. a command which will be execute e.g. each 0.5s.

OK I found a solution. It is a kind of an hack but at least it works.

The idea:

- write a bash script which
    - execute via osascript a TM command (or commands ;) )
        to write the content with syntax markups to disk
    - transform this temp file (e.g. like doctohtml.rb)
    - pipe it to Web Preview
- put this bash script in TM_SUPPORT_PATH/bin
- type this script in 'Pipe text through' within Web Preview Options

and it works.

BTW Doing so you can do some nice things, e.g.
- call Bundle commands from a Bundle command via osascript
- run a Bundle command as daemon (or with Web Preview 'pipe text  
through')
   e.g. for automatic 'Completion' while typing without pressing ESC
    (This I tried out and it works quite good if you fine-tune the  
refresh rate and switch off your loudspeaker ;)

I know it is only a hack and has of course limitations (esp. for  
speed) but ...
my tiny problem is solved ;)

Best

-Hans



More information about the textmate mailing list