Hi,
Running Octave scripts from Textmate using Matlab bundle works fine, but I'm not sure what sort of output I should use. I have set it to 'Show as HTML', since I don't want to create a new file for each run and the tooltip option is too volatile. The only problem is the text comes out without any line breaks, which is very painful to read especially when it comes to vectors and matrices.
You could try wrapping the output in a <pre> tag
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"
octave -f -q
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?
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.
Many thanks,
baptiste
__________________________________________________ Do You Yahoo!? En finir avec le spam? Yahoo! Mail vous offre la meilleure protection possible contre les messages non sollicités http://mail.yahoo.fr Yahoo! Mail
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
On 5. Jan 2007, at 17:14, Nicolas Weber wrote:
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>"
Should be possible to do:
octave -f -q | pre
pre is a bash function defined in bash_init.sh which will output the <pre> … </pre>, set a few CSS properties to get word wrap but preserve whitespace, escape < and &, and ensure tab expansion (or something along those lines).
Is there a way I can select an entire C function in one step? Starting from the beginning of the function would be fine.
Thanks,
Ernest
Hi,
Is there a way I can select an entire C function in one step? Starting from the beginning of the function would be fine.
Not exactly one step, but quite fast:
cmd-left opt-up shift-opt-down
(needs sane braces, though). You can record that as a macro to access it with one keystroke.
Nico