Hello:)
Sorry for my bad english
After \catcode`{=1 nothing any more is recognized; syntax coloring is lost
and with (l'article) or {l'article} syntax highlighting is lost; the first symbol ( or { is not found any more
Thanks for your great soft
Alain Matthes
Hello Alain, On May 30, 2006, at 5:33 PM, Alain Matthes wrote:
Hello:) After \catcode`{=1 nothing any more is recognized; syntax coloring is lost
and with (l'article) or {l'article} syntax highlighting is lost; the first symbol ( or { is not found any more
Update to r3473, I just committed a fix. The problem here was that the backtick (`) has a very special meaning when preceded by \catcode, namely it does not signal the start of a "string". So TextMate assumes that you have started a string, and looks for the closing ('). So everything on its way is considered as part of the string. Since most people never use \catcode, it had not shown up as a problem so far. I changed TeX.plist so that it captures as a separate entity a phrase of the form:" \catcode followed by backtick followed by backslash followed by a character, then equal sign and then a number". So this should take care of most cases. Let me know if it doesn't.
Alain Matthes
Haris
Le 31 mai 06 à 06:23, Charilaos Skiadas a écrit :
Hello Alain, On May 30, 2006, at 5:33 PM, Alain Matthes wrote:
Hello:) After \catcode`{=1 nothing any more is recognized; syntax coloring is lost
and with (l'article) or {l'article} syntax highlighting is lost; the first symbol ( or { is not found any more
Update to r3473, I just committed a fix. The problem here was that the backtick (`) has a very special meaning when preceded by \catcode, namely it does not signal the start of a "string". So TextMate assumes that you have started a string, and looks for the closing ('). So everything on its way is considered as part of the string. Since most people never use \catcode, it had not shown up as a problem so far. I changed TeX.plist so that it captures as a separate entity a phrase of the form:" \catcode followed by backtick followed by backslash followed by a character, then equal sign and then a number". So this should take care of most cases. Let me know if it doesn't.
Thanks for the quick answer
Do you have an idea for the second problem when i use a ' between {....} ? it's not very important because cmd shift B works very well !!
I don't know why I use only the option of the caret's position to highlight parentheses pairs.
I develop a latex package and a latex class and I often use the apostrophe in parameters to define new commands.
It's a real pleasure to work with textmate and guys like Allan and you
Greetings
Alain Matthes
On May 31, 2006, at 12:23 AM, Alain Matthes wrote:
Do you have an idea for the second problem when i use a ' between {....} ? it's not very important because cmd shift B works very well !!
I am not sure I understand what the problem is. Can you give me a more specific example of what the text is, what the behavior you are seeing is, and what you expect to be seeing?
I don't know why I use only the option of the caret's position to highlight parentheses pairs.
I develop a latex package and a latex class and I often use the apostrophe in parameters to define new commands.
I think the simpler solution for you would be to disable the use of (`) and (') as special characters in LaTeX documents. To do that, open the Bundle editor, go to the LaTeX bundle and find the "Miscellaneous" preference item. In there you will see: highlightPairs = ( ( '"', '"' ), ( '(', ')' ), ( '{', '}' ), ( '[', ']' ), ( '“', '”' ), ( '$', '$' ), ( '`', "'" ), ); increaseIndentPattern = '^\s*\begin{.*}'; smartTypingPairs = ( ( '"', '"' ), ( '(', ')' ), ( '{', '}' ), ( '[', ']' ), ( '“', '”' ), ( '$', '$' ), ( '`', "'" ),
and remove the two lines that say: ( '`', "'" ), Then go inside the LaTeX syntax file and find the lines: { name = 'string.quoted.single.latex'; begin = '`'; end = "'"; },
and remove those as well. This should make backticks and apostrophes behave like regular symbols. as long as they don't appear two at a time.
To Allan and the other maintainers: The scope for the Miscellaneous item is text.latex. I am thinking it should perhaps also work in source.tex ? Also, perhaps we should consider not considering single quoted strings as such. Perhaps the same for the double quotes. The problem is that any arbitrary LaTeX construct is allowed between the quotes, in fact the quotes are not even required to close. They are treated by LaTeX just as regular characters, not as pairs, so perhaps we should treat them the same way. As it stands, the following is highlighted pretty badly, without noticing the math among other things: ``$\frac{x}{\sin(x)}$'' And if anyone ever decides they want just an opening quote without the corresponding closing quote, they would be in trouble.
It's a real pleasure to work with textmate and guys like Allan and you
Greetings
Alain Matthes
Haris
Le 31 mai 06 à 16:27, Charilaos Skiadas a écrit :
I think the simpler solution for you would be to disable the use of (`) and (') as special characters in LaTeX documents. To do that, open the Bundle editor, go to the LaTeX bundle and find the "Miscellaneous" preference item. In there you will see: highlightPairs = ( ( '"', '"' ), ( '(', ')' ), ( '{', '}' ), ( '[', ']' ), ( '“', '”' ), ( '$', '$' ), ( '`', "'" ), ); increaseIndentPattern = '^\s*\begin{.*}'; smartTypingPairs = ( ( '"', '"' ), ( '(', ')' ), ( '{', '}' ), ( '[', ']' ), ( '“', '”' ), ( '$', '$' ), ( '`', "'" ),
and remove the two lines that say: ( '`', "'" ), Then go inside the LaTeX syntax file and find the lines: { name = 'string.quoted.single.latex'; begin = '`'; end = "'"; },
and remove those as well. This should make backticks and apostrophes behave like regular symbols. as long as they don't appear two at a time.
Thanks
Yes it's the simpler solution !
Alain Matthes
On 31/5/2006, at 16:27, Charilaos Skiadas wrote:
[...] The scope for the Miscellaneous item is text.latex. I am thinking it should perhaps also work in source.tex ?
That sounds right.
Also, perhaps we should consider not considering single quoted strings as such. Perhaps the same for the double quotes. The problem is that any arbitrary LaTeX construct is allowed between the quotes, in fact the quotes are not even required to close. They are treated by LaTeX just as regular characters, not as pairs, so perhaps we should treat them the same way.
Interesting… well, I don’t do much LaTeX so I don’t have any strong feelings about this. But not coloring strings does seem a little strange, I think stand-alone double quotes would be rather rare.
So I think we should let go of the single quotes (in pairs), but still keep double quoted strings, but then include $base inside the string, to still get normal LaTeX parsing.
On May 31, 2006, at 11:47 PM, Allan Odgaard wrote:
On 31/5/2006, at 16:27, Charilaos Skiadas wrote:
[...] The scope for the Miscellaneous item is text.latex. I am thinking it should perhaps also work in source.tex ?
That sounds right.
So does this mean the scope should be text.latex, or source.tex, or both?
Interesting… well, I don’t do much LaTeX so I don’t have any strong feelings about this. But not coloring strings does seem a little strange, I think stand-alone double quotes would be rather rare.
So I think we should let go of the single quotes (in pairs), but still keep double quoted strings, but then include $base inside the string, to still get normal LaTeX parsing.
I went ahead and committed this change. The weird thing now however is that if I type a dollar sign inside the double-quoted string, it does not do smart inserting of the corresponding closing dollar sign. Is this just a problem in my installation somehow?
There was some weird matching of things of the form . where dot is anything taking place in the syntax for double-quoted strings, which I removed since I did not see what it was good for. It just messed with all commands. I just had the patterns include $base.
Btw, perhaps the double-quoted strings should be moved to source.tex? After all, they are valid in TeX.
Haris
On 1/6/2006, at 7:51, Charilaos Skiadas wrote:
[...] The scope for the Miscellaneous item is text.latex. I am thinking it should perhaps also work in source.tex ?
That sounds right.
So does this mean the scope should be text.latex, or source.tex, or both?
Both
[...] The weird thing now however is that if I type a dollar sign inside the double-quoted string, it does not do smart inserting of the corresponding closing dollar sign. Is this just a problem in my installation somehow?
Did it ever do this? The Source bundle alters smart-typing pairs for double quoted strings (to not have ' auto-paired) so the Miscellaneous should probably be:
source.tex, text.latex, string.quoted.double.(la)tex
That way it will override the general double-quoted string auto-pairs.
There was some weird matching of things of the form . where dot is anything taking place in the syntax for double-quoted strings, which I removed since I did not see what it was good for. It just messed with all commands. I just had the patterns include $base.
Likely this was just left over from copy’n’paste (most languages will need to match . as an escape sequence to allow: "this "is" a string")
Btw, perhaps the double-quoted strings should be moved to source.tex? After all, they are valid in TeX.
Okay, sounds like it should be moved then.