[TxMt] Re : textmate Digest, Vol 28, Issue 15
Nicolas Weber
nicolasweber at gmx.de
Fri Jan 5 16:14:47 UTC 2007
Hi,
> i missed your reply until now for some reason, thanks. I'm not
> quite sure how to do what you suggest, though. My 'runOctave'
> command is the following,
>
> # just to remind you of some useful environment variables
> # see Help / Environment Variables for the full list
> echo File: "$TM_FILEPATH"
> echo Word: "$TM_CURRENT_WORD"
> echo Selection: "$TM_SELECTED_TEXT"
>
echo "<pre>"
> octave -f -q
echo "</pre>"
> i tried adding the strings "<pre>, pre, | pre, ..." randomly around
> that, but with no success. Could you give me further hint or link
> me some help page?
The output of the command is interpreted as html. Because of that,
it's not that wrong to put
. "$TM_SUPPORT_PATH/lib/html.sh"
htmlHeader "Octave output"
at the start of your command and
htmlFooter
at the end. It's documented in the TextMate Help in section 10.3
(HTML Output).
The Help links to http://macromates.com/blog/archives/2005/09/28/
html-output-for-commands/ for additional information, but read the
Help first, probably you won't need the additional information.
The linked page contains some errors, you have to hit "stop loading"
in your browser before the page loaded completely, else it will
forward you to a non-existing local file. Furthermore, not all stuff
in the sample boxes is escaped correctly, so you'll want to look at
the html source for the samples :-P
> I also get a very annoying problem: my code calls some functions
> located in other files, many of them are not read correctly for
> some reason and generate an error due to a wrong line ending
> apparently. If i just open them and save them, it works fine. Since
> running a code in Octave can call many functions, i'd save a lot of
> time in fixing that problem.
This sounds like a problem of Octave for me :-)
If you have access to all these files, you can convert them yourself
from the shell with find (to find all your source files) and tr -d
'\015' (to remove dos line endings). Or some other shell trick.
HTH,
Nico
More information about the textmate
mailing list