Hi all,
I've written a command that performs an AppleScript to look up the
selected text in a FileMaker database. I have the command Output set to
"Replace Selected Text". It's all working well, except that the result
that's replacing my selection is always being followed by a newline--which
is definitely not being added by my AppleScript or FileMaker.
Any ideas on how to get rid of the added newline?
--
Tim Mansour <tim(a)neologica.com.au>
The current method the command Quick Open of the C bundle does use
is look for the file in several funny directories that not always are
then same c/c++ are looking into.
Is not easy to know where the cpp preprocessor look for the included
files. The only method I have found is from Andrew Tomazos and is a
small Perl script that makes c++ have mistakes and then shows us the
real places where it is looking into.
Running it once is enough, I think, and then pick up the directories
for a script to quick opening included files.
I would like to know who is the C bundle maintainer for to share this
things with him.
I also find a bit complicated the current way of making changes (yet
small changes) and then you will be out of updates of the official
bundle since yours will be always loaded before the official one.
Tx.
#!/usr/bin/env perl
$line=$ENV{'TM_CURRENT_LINE'};
$header=$ENV{'TM_SELECTED_TEXT'};
if (!$header) {
$line =~ /#\s*include\s*([<"])(.*?)[">]/;
$local = $1;
$header = $2;
}
if ($local eq '"') {
$t = $ENV{'TM_DIRECTORY'};
if (-f "$t/$header" ) {
print "$t/$header";
system("mate -r \"$t/$header\"");
exit 0;
}
}
@incs = qw(
/usr/include/c++/4.0.0
/usr/include/c++/4.0.0/powerpc-apple-darwin8
/usr/include/c++/4.0.0/backward
/usr/local/include
/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/include
/usr/include
/System/Library/Frameworks
/Library/Frameworks
);
foreach $t (@incs) {
if (-f "$t/$header") {
print "$t/$header";
system("mate -r \"$t/$header\"");
exit 0;
}
}
print "";
exit 1;
I wrote:
> Oops. I got caught submitting a change without testing it. I don't
> seem capable of never repeating that mistake--that's where automated
> tests come in handy.
Is there any facility for creating automated tests for language grammar rules?
It would be useful to be able to define tests within rules or patterns such as:
test_matches = " _italic_ ";
test_no_matches = "snake_case_word";
...or perhaps...
test_matches = { " _italic_ " = 1; "snake_case_word" = 0; "
_italic_number_1_ _italic_number_2 " = 2; };
And then be able to run tests for a specific bundle (say from within
the bundle editor) like one would unit tests, and see if they're green
or if there's a problem.
Would it be possible to write a BundleTester bundle? I guess one
would just need to parse the indicated bundle's language property list
and run any tests found using Oniguruma. Would these test properties
be otherwise ignored?
--
Daryl
On 4/18/07, Daryl Spitzer <daryl.spitzer(a)gmail.com> wrote:
> > I got around to apply it, thanks.
>
> Thank you.
>
> > > While I was in there, I made the same change to the
> > > 'markup.bold.twiki' match.
> >
> > This won't work, since * is not a word character, so \b will actually
> > have the opposite effect, i.e. making foo*bar*fud match the inner
> > word as bold.
>
> Oops. I got caught submitting a change without testing it. I don't
> seem capable of never repeating that mistake--that's where automated
> tests come in handy. (Which leads me to a question which I will post
> separately.)
>
> > Instead it should probably be (?<!\w) and (?!\w) before/after the
> > match. I didn't make this change though.
>
> I think you made the right call. Unlike snake_case_words, I have yet
> to run across a real-world need for asterisks embedded within words.
> We should wait to "fix" it until it is proven to be a problem.
>
> --
> Daryl
>
>
> On 4/13/07, Allan Odgaard <throw-away-1(a)macromates.com> wrote:
> > On 5. Apr 2007, at 22:09, Daryl Spitzer wrote:
> >
> > > It is a bug that words surround by underscores in snake_case_words
> > > in a TextMate Twiki document are italicized. (In this example, the
> > > word "case" is italicized.) When displayed in TWiki, those words
> > > are not italicized.
> > >
> > > I made a small change to the Twiki language (in the Twiki bundle)
> > > to correct this--see the 'markup.italic.twiki' match in the
> > > attached patch.
> >
> > I got around to apply it, thanks.
> >
> > > While I was in there, I made the same change to the
> > > 'markup.bold.twiki' match.
> >
> > This won't work, since * is not a word character, so \b will actually
> > have the opposite effect, i.e. making foo*bar*fud match the inner
> > word as bold.
> >
> > Instead it should probably be (?<!\w) and (?!\w) before/after the
> > match. I didn't make this change though.
> >
> >
> >
> >
> > ______________________________________________________________________
> > For new threads USE THIS: textmate(a)lists.macromates.com
> > (threading gets destroyed and the universe will collapse if you don't)
> > http://lists.macromates.com/mailman/listinfo/textmate
> >
>
I don't know if this is a problem with TextMate or a "feature" of OSX, but
I have a problem with the "Save As..." dialog. I want to be able to type
a full path into the Save As: filename box. So if I want to save the file
as "foo.txt" in the "/tmp" directory, I just want to type "/tmp/foo.txt"
rather than mousing around the dialog to navigate to the "/tmp" directory,
then entering the name "foo.txt".
(And, as luck would have it, MacOS "helpfully" hides the "/tmp" directory
from that dialog, so I can't even navigate there! But that's beside
the point; I could fix that with a symlink.)
As it is, if I type "/tmp/foo.txt" into the dialog I get a file in my home
directory named ":tmp:foo.txt". The translation of slashes to colons
makes me think this is probably a mis-feature of OSX rather than TextMate,
but even so, is there a way around it?
--
Steve King, <steve(a)narbat.com>
It is a bug that words surround by underscores in snake_case_words in
a TextMate Twiki document are italicized. (In this example, the word
"case" is italicized.) When displayed in TWiki, those words are not
italicized.
I made a small change to the Twiki language (in the Twiki bundle) to
correct this--see the 'markup.italic.twiki' match in the attached
patch. While I was in there, I made the same change to the
'markup.bold.twiki' match. But I intentionally didn't change the
'markup.raw.fixed.twiki' match, since I don't think it's likely that
someone will type a word with a pair of '=' embedded in it. Let me
know if you think I should resubmit the patch with this change (or
other changes) included.
--
Daryl
Thanks for pointing me in the right direction.
On my macbook, I found the keystrokes to be fn-option-F2.
On Tuesday, April 17, 2007, at 10:16AM, "Ciarán Walsh"
<ciawal(a)gmail.com> wrote:
> On 17 Apr 2007, at 17:43, Robert Ullrey wrote:
>
>> I am wondering if there is a way to get the systems contextual
>> menu to appear with suggested spellings without having to resort to
>> control-click?
>
> You can use ?F2 on the misspelled word.
Not sure if there's a wish list form somewhere anyways I have two semi odd
ones...
It would be handy if there was a overlay feature in textmate much like you
get in photo editing software. What would be really nice if there were X
layers and if you could choose to name each layer and hide and show a layer.
Also if each layer had a transparency setting it would be nice so you could
have 10 layers that combined would appear to be almost one document. Maybe
you could combine 10 peoples comments on your file.
My second wish list item is meta data for a text file. That is I could tag
line 1 as having meta data of "this line is great". If a user adds more text
to the document and line 1 is pushed down to line 10 that meta data should
stay with the original data it was tagged on.
These requests stem from code reviewing.
Not saying anyone gives a rats about or that this is even remotly possible
or usable. The ideas were on my mind and I thought I would post them.
Bob
Hi!
I used the blogging-bundle before w/out any problems. 5 minutes ago I
fired up Textmate and when I use the cat-snippet from the blogging
bundle I get the following error:
/Users/nik/Library/Application Support/TextMate/Support/lib/dialog.rb:
5: warning: already initialized constant TM_DIALOG
/tmp/temp_textmate.b4fiwD:5:in `require': No such file to load -- /
lib/blogging.rb (LoadError)
from /tmp/temp_textmate.b4fiwD:5
Does anyone know what to do?
Niels
Hello,
I'm looking at creating a bundle that can be used to provide peer code
reviews making use of TextMate for the majority if not all of the
process. I'm looking for high level input/suggestions. Does anyone else
think this would be helpful to them? Anyone else want to work on this with
me?
The high level process of this goes like this:
( A database is used to store a code file for review and all comments
submitted against that file. This allows metrics to be reported on as well
as allowing any number of people to review the same code at the same time
from many different locations. This also allows the status of comments to be
tracked and changed and what not. I think I can push and pull data from a
database pretty easily from TM. I'm looking at targeting PostgreSQL.)
0. Code creator submits a file to be reviewed via TM.(Submitting
actually inserts the code into the database)
1. Reviewer/s retrieves the stored file from the database and the file
contents are displayed in TM(This is all done via TM).
2. Reviewer/s comments on a line by line basis or select multiple lines and
comment via TM. Each comment should have a status such as BUG, STANDARDS
BROKEN, GENERAL, etc. I'm thinking of using GUI integration to allow data
input.
3. Code creator can comment on the comments left by a reviewer/s via TM.
Example "I did this because of XYZ".
4. Code creator makes fixes in their code via TM based on reviewer/s
comments.
5. Code creator submits changed code.
6. Reviewer/s can then flag a comment as FIXED, COMPLETED, CLOSED etc. These
would be user configurable values I'm just showing these ones as an example.
7. Repeat 0 to 6 until all comments are in a FIXED/COMPELTE/CLOSED state.
8. Mark review in the database as completed. This will keep anyone from
adding new comments. But the process above will all be in the database for
future reporting and what not if it's needed.
Things I wish I could do, but not sure that I can:
0. I can't mark a line in TextMate with a little graphic in the left
gutter to indicate that line has a comment on it. I do see maybe using the
HTML viewer like the TODO bundle does as an alternative. Is it possible to
highlight a line with a specific color on the fly? Say mark a line with a
BUG comment and the line will turn red and lines with comments marked as
GENERAL are yellow etc etc?
Thanks in advance for any input
Bob