Hi,
this thread follows the discussion in
http://thread.gmane.org/gmane.editors.textmate.general/13806/focus=13806
'run script with args'
In order to be able to control the arguments and STDIN here my
suggestion:
Example for Perl:
#!/usr/bin/env perl -w
#!TMC: STDIN=cat ~/Desktop/test.txt
#!TMC: ARG=1 "2 and 3" /etc/file
#!TMC:end
print join ('-',@ARGV);
print "\n";
@a = <STDIN>;
chomp(@a);
$j=1;
foreach $line (@a) {
print $j++.$line."\n";
}
The actual command line would be: 'cat ~/Desktop/test.txt | /usr/bin/
perl -w 1 "2 and 3" /etc/file
The idea is to specify the values for ARG and STDIN hidden as
comments within the script.
If you want to test several ARGs and STDINs you can write
#!/usr/bin/env perl -w
# !TMC: STDIN=cat ~/Desktop/test.txt
# !TMC: ARG=1 "2 and 3" /etc/file
#!TMC: STDIN = echo -e "A\nB"
#!TMC: ARG = DATA
#!TMC:end
...
By doing so line 5 and 6 are active. You see to change ARG and STDIN
is easy.
Of course, you can think about to use tm_dialog with an history list
or whatever but I believe this is fast and very simple. If you forget
to delete the TMC tags while running this script from Terminal it
doesn't matter. These tags are comments.
For that purpose I add some stuff to scriptmate.rb.
Here some hints:
#parse script for arguments and STDIN pipe data given as comment(s)
#!TMC: ARG= //everything after = is interpreted as
arguments like ARG= one two "three and four" five
#!TMC: STDIN= //everything after = will be executed on
the system and piped to the script like STDIN=cat /PATH/TO/FILE
#!TMC:end //marker to cancel the parsing; the
parsing also ends if ARG _and_ STDIN are set
#
#!TMC: ... //active
# !TMC: ... //not active to have the chance to chooce
#
#known problems:
# for Perl
# piping STDIN: e.g. @a = <>; doesn't work, use instead @a =
<STDIN>;
#
Any comments?
Bye,
Hans
PLEASE forgive my Ruby syntax ;)
Begin forwarded message:
> From: Scott Lahteine <slahteine(a)mac.com>
> Date: 27. Nov 2006 22:55:49 GMT+01:00
> To: textmate-dev(a)lists.macromates.com
> Subject: [SVN] Bundle for Torquescript (2D)
> Reply-To: Bundle developers <textmate-dev(a)lists.macromates.com>
>
> Hi,
>
> I've created a Bundle to support Torquescript, the scripting
> language used by GragageGames' Torque Engine ( http://
> garagegames.com ). The Torque Engine was used to create such games
> as Tribes II and Marble Blast.
>
> Last year GarageGames released Torque Game Builder, a system for
> making 2D games, which also uses the Torquescript language. They
> sell the Indie license for only US$100 and it has been a staggering
> success for them. At GDC 2006 we learned that they're selling about
> 3000 licenses per week.
>
> So far this bundle only supports Torque 2D (Torque Game Builder)
> but I hope to extend it for Torque 3D eventually.
>
> The bundle and documentation are posted here:
> http://thinkyhead.com/pub/Torque2DForTextMate.zip
>
> --
> Scott Lahteine Thinkyhead Software
> scott(a)thinkyhead.com http://www.thinkyhead.com/
>
>
>
>
> _______________________________________________
> textmate-dev mailing list
> textmate-dev(a)lists.macromates.com
> http://lists.macromates.com/mailman/listinfo/textmate-dev
Attached is a little patch to add embedded XML to Perl.
For example:
my $foo = <<XML;
<?xml version="1.0" encoding="UTF-8"?>
<example>foo</example>
XML
Perhaps this option already exists or perhaps it can be a feature request.
When editing files the filename appears in the title bar of the
application. Is it possible to get the full path name displayed at the
top? Many times I'll be working on files of the same name in different
directories and it's a pain to figure out which one is which.
thanks
I gave a talk using TM last Friday and have written a bit about the
way I prepared it
http://advogato.org/person/fxn/diary.html?start=452
I send it to the list in case it is helpful to someone else.
-- fxn
Hello
I have annoying problem while using Textmate to edit and view LaTex
files.
Very frequently, and I have not been able to determine a pattern to
this behavior, I save the current document I'm working on, (apple -
s), then I try to view it, (apple - R), the document is processed by
pdftex fine with no errors, but Textmate complains that "Error: PDF
file not written to disk", even though there are no problems with the
texing.
Here is the exact error message displayed in the "Typeset & View"
window:
<start error message>
Compiling LaTeX…
This is pdfeTeXk, Version 3.141592-1.30.4-2.2 (Web2C 7.5.5)
Typesetting: ./mathmethods.tex
Document Class: article 2005/09/16 v1.4f Standard LaTeX document class
Output written on mathmethods.pdf (1 page, 21844 bytes).
mathmethods.log
Error: PDF file not written to disk
<end error message>
I think there might be some issue with the LaTex bundle not parsing
the output of pdftex correctly.
FYI, I have a MacPro, OS 10.4.8
Any ideas???
thanks
Hi all-
Here is a first attempt to make a slightly RefTeX-esque citation
command. I worked it up to fit my writing style a little more: It's
not bound to the cite context, so you invoke it after typing, say, a
last name or a word from a title. It will prompt for any of a set of
citation formats (many of which will require natbib to typeset), and
then complete the cite with the existing cite completion command.
Output is as a snippet so you can tab through to add page numbers or
additional citekeys (invoke it again while within a cite command, and
it will skip the format selection and prompt for another citekey
match -- though that breaks the ability to tab out of the cite
command). I like it.
It's a quick hackup, and improvements/suggestions are welcome --- but
it scratches an itch, for now. I'd like to have a default of \cite,
for example, so you can invoke it and just hit enter to move right
past the format selection and on to citekey completion.
Cheers-
-Alan
I have discovered a couple of oddities in the Python language grammar:
Function names containing digits are not handled the same as functions names that do not contain digits. You can see this by looking at how the following code is highlighted:
def foo(self):
pass
def foo2(self):
pass
I have not spent much time studying TextMate language grammars yet, but it appears that the "begin" regular expression for meta.function.python should be modified to allow digits in the function name.
Type names are highlighted as type names even in contexts where they couldn't possibly be type names. For example, in:
foo.set(x)
the member function "set" is highlighted as if it were a type.
A negative look-behind RE could distinguish this specific case. I don't know how many other such cases are lurking in Python.
One could argue that it's bad practice to use type names as method names. Probably so, but it's not always avoidable. In particular, "set" wasn't even a type name until recently, and it's used as a method name in the standard library (e.g., in Tkinter). It's also a very nice verb to use as a method name.
Both of these came up while typing in a single recipe from _Python Cookbook_ (Recipe 11.11 from the 2nd Edition). I hope that's not typical. Syntax coloring needs to be *more* reliable than eyeballing the code.
-Paul
paul(a)mustbeart.com
For those trying out the Backpack bundle, I've discovered several
undocumented features in the Backpack API, including some functions
that allow for list manipulation. I've added a command to the bundle
that allows for viewing of lists in a tree format like the View\Edit
Notes command. Select a page->list->see the list items. No editing
of list items or checking off yet, but this has opened some great
possibilities for GTD integration. I can now take a GTD file and
create a page, sectioning the projects into lists and allowing you to
check off your GTD items remotely and sync when you're back at your
main computer. That's the next step, anyway. I'm getting some great
feedback from Haris regarding how it should function, so I'm
structuring things around my own needs and the requirements of GTDAlt
integration.
I've set up a Subversion account with the help of Ale Muňoz so you
can update to the latest version by:
cd ~/Library/Application Support/TextMate/Bundles/
svn co http://svn.sofanaranja.com/projects/brettbundles/trunk/Bundles/
Backpack.tmbundle
That will get you to the latest version, which is 8 right now.
Direct Download available at:
http://blog.circlesixdesign.com/2006/11/25/backpack-bundle-adds-list-
support/
Brett