On Aug 14, 2007, at 08:00, textmate-request(a)lists.macromates.com wrote:
>
> From: Steve Lianoglou <lists(a)arachnedesign.net>
> Date: August 13, 2007 14:03:56 EDT
> To: TextMate users <textmate(a)lists.macromates.com>
> Subject: Re: [TxMt] Re: Python bundle syntax highlighting bug
> Reply-To: TextMate users <textmate(a)lists.macromates.com>
>
>
>>>> I think you are probably right. Does anyone else have an
>>>> opinion on this?
>>>
>>> I agree this doesn't seem right, and can produce some confusing
>>> results. On the other hand, it's very nice to have regex
>>> highlighting.
>>
>> I prefer to trade-off false-positives for the nicety of regex
>> highlighting.
>>
>>> Wouldn't it be possible to have the first string located within a
>>> re.XXXXX('') pattern be highlighted as regex? Am I wrong, or are
>>> those the only places where regex appear?
>>
>> s = r"...."
>> pattern = re.compile(s)
>>
>> is always, possible, if contrived. I think re.XXXXX is an
>> interesting suggestion though.
>
> I'm in the same boat with Jay.
>
> I think it's kind of nice to have special highlighting for regex's.
> I'd settle for it only being switched on when we have re.*
> (r"regex" ... ) if the "always a regex w/ r" " really isn't
> suitable for others.
>
> -steve
>
>
>
>
> From: "Alexander Ross" <alex.j.ross(a)gmail.com>
> Date: August 13, 2007 14:35:16 EDT
> To: "TextMate users" <textmate(a)lists.macromates.com>
> Subject: Re: [TxMt] Re: Python bundle syntax highlighting bug
> Reply-To: TextMate users <textmate(a)lists.macromates.com>
>
>
> I agree that it's very nice to have highlighted re's if possible.
>
> What if we did something like matching r"(?#) … " as a regular
> expression string? The would give us something explicit to match,
> but it would also mean you'd have to add it to any of your preexisting
> re's.
That sounds like a very good idea. It would be pretty easy to find
regexes and sub in a '(?#)' comment marker (I had to look up what
that one was!) so one would have regex syntax highlighting in
existing code, while keeping the 'raw strings are just raw strings'
folks happy. For those who complain that r'(?# might just be the
beginning of some particular, non-regex raw string, well.... too
bad! ;)
On a side note, it may be nice to keep a documented list of such
'extra' features (above and beyond the straight language definition)
in the Python bundle somewhere; for instance, the appearance of
folding markers when a triple quote is followed by text, followed by
a <return>, followed by another triple quote. This regex
highlighting feature would also qualify - otherwise, it would not be
known to a new Python + TextMate user unless they stumbled across it
by accident or investigated the grammar in detail...
>
>
>
>
>> I'm more and more convinced as time goes on that we should just
>> stop trying to interpret raw strings as regexps.
>>
>>
>
> I think you are probably right. Does anyone else have an opinion
> on this?
>
>
Well - as you pointed out previously, raw strings were introduced
into Python for the specific purpose of making writing regexps
easier. If we don't interpret raw strings as regexes, what will we
interpret as regexes in Python, then? Or will we just ditch regex
syntax highlighting from Python altogether?
Perhaps we need some sort of obvious marker on the same line to
indicate that a raw string should be interpreted as a regex. Regexes
in Python are pretty obvious when being used - a very common way is
to compile a regex via re.compile([raw string]), and the other common
way is to call other functions in the regex module, ala re.findall
(r'\bFig\b'), for instance.
So, perhaps raw strings should only be interpreted as regexes when
directly preceded by re.[function]( - while this would not get
everything we might want to be interpreted as a regex, it would
capture some of the most common use cases.
Nick
Hello,
I ripped off RakeMate to make MavenMate. Same kind of deal, allows
you to run maven2 tasks from within TextMate. Should it be put in the
Bundles repo?
http://ldaley.com/downloads/Maven.zip
- LD.
Ciao Folks,
at first I would like to offer my thanks for the great work on the new LaTeX
bundle. It's a big step forward especially in the area of displaying the log
after compilation. I really missed that compared to TeXShop.
Tonight, while playing around with the new "%!TEX root" directives to define a
master file, I noticed that Auto-Completion for \cite{} etc. using ALT+ESC only
works recursively if the master file is still specified using the
TM_LATEX_MASTER variable either in a project or global. the %!TEX directive does
work for compilation but not for completion as it seems.
Is this a correct observation or rather a bug on my side. I am not sure, if it
would even be possible to enable recursive search using only the directives. If
that is the case, I guess it would be best to mention that in section 2.3 of the
bundle help as advantage of the TM_LATEX_MASTER variable.
Just my two cents ;-)
Best Wishes
Bastian
Hello, I when trying to commit using the latest version of the CVS bundle
and the latest version of TextMate as of August 14, 2007 I am getting the
following errors:
/Library/Application
Support/TextMate/Bundles/CVS.tmbundle/Support/cvs_commit.rb:99: undefined
method `keys' for []:Array (NoMethodError) from /Library/Application
Support/TextMate/Bundles/CVS.tmbundle/Support/cvs_commit.rb:99:in `call'
from
/Applications/TextMate.app/Contents/SharedSupport/Support/lib/Builder.rb:227:in
`_nested_structures' from
/Applications/TextMate.app/Contents/SharedSupport/Support/lib/Builder.rb:149:in
`method_missing' from /Library/Application
Support/TextMate/Bundles/CVS.tmbundle/Support/cvs_commit.rb:99 from
/Library/Application
Support/TextMate/Bundles/CVS.tmbundle/Support/cvs_commit.rb:97:in `call'
from
/Applications/TextMate.app/Contents/SharedSupport/Support/lib/Builder.rb:227:in
`_nested_structures' from
/Applications/TextMate.app/Contents/SharedSupport/Support/lib/Builder.rb:149:in
`method_missing' from /Library/Application
Support/TextMate/Bundles/CVS.tmbundle/Support/cvs_commit.rb:97 from
/Library/Application
Support/TextMate/Bundles/CVS.tmbundle/Support/cvs_commit.rb:25:in `call'
from
/Applications/TextMate.app/Contents/SharedSupport/Support/lib/Builder.rb:227:in
`_nested_structures' from
/Applications/TextMate.app/Contents/SharedSupport/Support/lib/Builder.rb:149:in
`method_missing' from /Library/Application
Support/TextMate/Bundles/CVS.tmbundle/Support/cvs_commit.rb:25 from
/Library/Application
Support/TextMate/Bundles/CVS.tmbundle/Support/cvs_commit.rb:19:in `call'
from
/Applications/TextMate.app/Contents/SharedSupport/Support/lib/Builder.rb:227:in
`_nested_structures' from
/Applications/TextMate.app/Contents/SharedSupport/Support/lib/Builder.rb:149:in
`method_missing' from /Library/Application
Support/TextMate/Bundles/CVS.tmbundle/Support/cvs_commit.rb:19
File(s) not modified; nothing to commit.
If anyone has experienced something similar or have any information that can
help me start using CVS, please let me know.
Regards,
--Matic Code
Hi,
would it be possible to change the definition
{ name = 'meta.escape-character.latex';
match = '\\$';
into
{ name = 'meta.escape-character.latex';
match = '\\$|(?<=\\)\n';
The problem is that a backslash followed by a newline
is not recognized by the first definition.
Piero
Looks like svn revert is broken in the last build. If I try to revert
a file there's an error that says require fails in line 3 of
revert_file.rb, which is:
require ENV['TM_SUPPORT_PATH'] + "/lib/ui"
-- fxn
Hi, only since early this morning, whenever I call for Bibdesk-
Citekey-Completion using "F5" TM freezes, shows the ball and I'm left
waiting without anything happening.
And I'm pretty sure I didn't change anything since last night, when
everything just worked fine.
Bibdesk-Completion works in other apps like before.
Any ideas?
Flo
Hi,
I'm developing a bundle for Stata/Mata, and I want to define a
grammar such that Ctrl-Alt-B can select an entire function. I would
appreciate any pointers.
Here's an example function:
real matrix y_null(real scalar rho, real scalar T) {
real matrix y
real colvector e
real scalar t
y = J(T, 2, 0)
// use the inverse CDF method to draw from N(0, 1)
e = invnormal(uniform(T, 1))
y[1, 2] = (1 - rho^2) * invnormal(uniform(1, 1))[1, 1]
for (t = 1; t < T; t++) {
y[t, 1] = rho :* y[t, 2] + e[t]
y[(t+1), 2] = y[t, 1]
}
y[T, 1] = rho :* y[T, 2] + e[T]
return(y)
}
And here are the relevant excerpts from the grammar:
patterns = (
{ name = 'meta.function.mata';
begin = '(?x)
(?=
^\s*
((transmorphic|numeric|real|complex|string|
pointer)\s+)? # eltype
((matrix|vector|colvector|rowvector|scalar)\s+)? #
orgtype
(\w+)\(.*\)\s
+ # function name
\{$
)';
end = '(?<=^\}$)';
beginCaptures = { 5 = { name = 'entity.name.function.mata'; }; };
patterns = ( { include = '#base'; } );
},
{ include = '#base'; },
);
repository = {
base = {
patterns = (
...
{ name = 'storage.type.eltype.mata';
match = '\b(transmorphic|numeric|real|complex|string|pointer)\b';
},
...
);
Now, in most regards, this works fine. The name of the
function--"y_null"--shows up in the symbol list, and the contained
scopes are identified correctly. Also if I cycle through Ctrl-Alt-B
when the cursor is not on "real" or at the beginning of the line, the
whole function is selected. However, if I hit Ctrl-Alt-B either at
the beginning of the first line or within "real", it fails to
recognize the meta.function.mata scope. That is, on the first
keypress, TextMate recognizes the storage.type.eltype.mata scope and
selects "real", but on the second, it skips right to the source.mata
scope and selects the whole program instead of just the function.
Here are the results from Ctrl-Shift-P:
With cursor at the beginning of "real"/beginning of line --
source.mata, meta.function.mata, storage.type.eltype.mata
With cursor within "real" -- source.mata, meta.function.mata,
storage.type.eltype.mata
With cursor anywhere else in the function body -- source.mata,
meta.function.mata, other scopes from the base repository if relevant
With "real" selected (by Ctrl-Alt-B or manually) -- source.mata
Any ideas on how to workaround this? It's annoying, because if you
navigate to a function via the symbol list, it puts the cursor at the
beginning of the line by default.
Thanks!
Michael