<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV><DIV>On Jan 8, 2007, at 3:59 AM, Jacob Rus wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Torsten Grust wrote:</DIV> <BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Dear all,</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I'm hacking on a little project that is somewhat abusing the 'Pipe text through' feature of TextMate's Web Preview window (''abusing'' in the sense that I do not want to preview HTML text). If you open the Web Preview and uncheck the 'Pipe text through' option you can observe how rapidly TextMate can update the preview (set the 'Refresh after change delay' to 0.00s and type away in some plain text -- the update seems almost immediate and you'll have immediate typing response in the editor window). Enabling 'Pipe text through' makes TextMate pipe the current editor window contents into the specified command.<SPAN class="Apple-converted-space">  </SPAN>Even if you only specify 'cat >/dev/null' as that command, you will notice that text editing will become sluggish.<SPAN class="Apple-converted-space">  </SPAN>I assume that this delay is all due to the overhead of *forking* the specified</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">command -- executing 'cat >/dev/null' itself takes no noticable time on files of size <100k on my Powerbook G4.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I've got two questions here:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">(1) Is there a smarter way to receive live updates of the current editor window contents?<SPAN class="Apple-converted-space">  </SPAN>Maybe via the plugin API?</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">(2) How about a comptabile change in 'Pipe text through's behavior?<SPAN class="Apple-converted-space">  </SPAN>If the file specified in 'Pipe text through' is a named pipe (mkfifo(1)) do not fork any command but simply write the editor window contents into that named pipe. Otherwise, behave as before.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Item (2) sounds like a moderate change that could get us rid of the forking overhead for at least some applications that need live update.<SPAN class="Apple-converted-space">  </SPAN>What are the chances that Allan has open ears for such things?</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Thanks and all the best for the New Year,</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">   </SPAN>--Torsten</DIV> </BLOCKQUOTE><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I'm not exactly sure what Allan's plans are, but as far as I know, all of the architecture for that part of the app (as well as just about everything else) is being rewritten for TM 2.0, so your best bet is probably to wait for that, and then give feedback.<SPAN class="Apple-converted-space">  </SPAN>I know that Allan wants to do some unification of the regular html preview and the commands' html view, etc.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">-Jacob</DIV></BLOCKQUOTE></DIV><BR><DIV>I've been lobbying for an 'update on refresh' option in html output commands for a LONG time.</DIV><DIV>I have a little command that I use in the pipe text through thing.</DIV><DIV>It looks at the scope and guesstimates what you want to be previewing.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>If you're writing HTML, textile or markdown, it'll show a live preview of the rendering.</DIV><DIV>If you're writing Javascript it'll give you a live update of my 'Basic Javascript Test' window.</DIV><DIV>If you're writing a Rails View, it's supposed to render out the actual url on your test server but I broke that somehow.</DIV><DIV>If you're writing CSS, it'll show you any url (including local file:// urls) with that css applied to it.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>The rendering slowdown of using the preview window used to be an absolute blocker, but recently Allan has made sure that the text you're typing will make it to the buffer even if it's a wee bit jumpy.</DIV><DIV><BR><DIV>thomas Aylott — <I>design</I><B>42</B> — <B>subtleGradient </B>— CrazyEgg</DIV></DIV><DIV><BR class="khtml-block-placeholder"></DIV></BODY></HTML>