Are the r-tags in github 'release'-worthy in terms of recommended-to-use?
I was wondering, because my TM2 is on r9309, while the github repo is
already several revisions further, but my TM2 doesn't want to update:
''
TextMate 9307 is the latest version available—you have 9309.
"
Best regards,
Michael
Riki,
Perhaps I can elaborate on Elia's behalf:
1. If you want to abide by TextMate conventions, don't pop up a tooltip; edit the Fortran grammar so that keywords are given a scope that begins with `invalid.illegal`. Most themes apply a style to `invalid.illegal` that makes it stand out as an error, and many bundles have rules to mark things that are known to be invalid or cause syntax errors. (For example: in the HTML grammar, the sequence `<>` is scoped as `invalid.illegal.incomplete.html` because it isn't valid HTML.)
In order to add this rule, you will need to know a little about language grammars [1]. In particular, read about the `begin, end` keys in section 12.3. A begin/end pattern is the best way to create patterns that apply only in certain places, rather than document-wide. Unfortunately, I don't know anything about Fortran, so I can't give you further guidance on how the rule would look.
If you still want to show a tooltip, you could try the approach I explain below. But I wouldn't recommend it.
2. There's no simple way to do this in TextMate 2.
You could write a command like this [2]. This would activate whenever a user typed a keyword, then pressed the space bar. It would replace the input with an uppercase version, then insert the space key as the user expects.
But this would only work in that specific instance. If Fortran does not mandate that a keyword must follow a space (as in C-style syntax, where both `if {` and `if{` are valid), then you'd have to figure out which other characters can follow identifiers, and then give each one its own command. Even so, this wouldn't work on code that is pasted into the editor.
Better to take Elia's advice and create a command that does the transformation when the document is saved. Here's an example of how to create such a command [3].
(Unfortunately, in your case, this would involve parsing the Fortran code so that you could be sure that you were uppercasing only keywords and nothing else.)
Cheers,
Andrew
[1] http://manual.macromates.com/en/language_grammars#language_grammars
[2] https://gist.github.com/0d6ce8625cf371f22734
[3] http://reinteractive.net/posts/4-stripping-whitespace-out-of-textmate-2
On Dec 7, 2012, at 7:42 AM, riki wrote:
> Dear Elia,
>
> Thank you very much for your kind response.
>
> BTW I am not expert in TextMate grammar. So could you please elaborate your suggestions?
>
> Kind Regards,
> Riki
>
>
> On Fri, 07 Dec 2012 15:04:26 +0530 wrote
> >1) yes, you can setup the language grammar to catch and highlight those keywords in a given scope (e.g. data decl)2) I
> don't think you can do that while you type, but probably you can create a command that does the transformation on
> demand (or hook it to the saving)
>
> Elia
> ☁ @elia ✎ elia(a)schito.me
>
> ☎ (+39) 348/9051393
>
>
>
> On Thu, Nov 29, 2012 at 1:37 PM, riki wrote:
>
>
> Hi all,
>
>
>
> How to accomplish the following things within TextMate 2 for Fortran language:
>
>
>
> 1) Is it possible to appear warning in a tool tip if we type Fortran keywords in data declarations? I am asking because if
>
> somehow or by mistake we are using those ones as variables and we know that Fortran does not complain about it.
>
>
>
> 2) The second thing is related to code formatting. Suppose we are writing a program in lower case letters and whenever we
>
> type any Fortran keyword we wish that it always came in upper case letters. Is there any way to do it?
>
>
>
> Kind Regards,
>
> Riki
>
>
>
> Catch India as it happens with the Rediff News App. To download it for FREE, click here
>
>
>
>
> _______________________________________________
>
> textmate mailing list
>
> textmate(a)lists.macromates.com
>
> http://lists.macromates.com/listinfo/textmate
>
>
>
>
> _______________________________________________
>
> textmate mailing list
>
> textmate(a)lists.macromates.com
>
> http://lists.macromates.com/listinfo/textmate
>
> Follow Rediff Deal ho jaye! to get exciting offers in your city everyday.
>
> _______________________________________________
> textmate mailing list
> textmate(a)lists.macromates.com
> http://lists.macromates.com/listinfo/textmate
Hello everyone,
I have a text file that is indented properly, but instead of tabs, the indentation has been done with spaces. Is it possible to replace the spaces with tabs only at the beginning of the line?
In this case, 1 space -> 1 tab.
Thanks!
Anthony
Hi all,
How to accomplish the following things within TextMate 2 for Fortran language:
1) Is it possible to appear warning in a tool tip if we type Fortran keywords in data declarations? I am asking because if
somehow or by mistake we are using those ones as variables and we know that Fortran does not complain about it.
2) The second thing is related to code formatting. Suppose we are writing a program in lower case letters and whenever we
type any Fortran keyword we wish that it always came in upper case letters. Is there any way to do it?
Kind Regards,
Riki
I can switch from Japanese text input to Roman letter input just fine using the keyboard shortcut Shift-Control-; . It doesn't seem to be possible, however, to switch back to Japanese input using the usual keyboard shortcut, Shift-Control-J. This works in all other programs. Mousing to the menu bar and switching manually does work.
Using the TM 2.0.0-alpha.9323
Hi,
I'm sure this will sound like a very simple question, but I am trying to
save a macro using Textmate2. I can record it, I can run it immediately,
but there is no macro submenu with saving options. As I say, I guess I am
being stupid, but where can I go to save it?
Thanks
Dom Guinness
How about add a 'Go to bookmark' popup window just like the 'Go to Symbol'
window, and can navigate bookmarks of current window and current project.
--
Yuan Jiang
http://blog.vetcafe.nethttp://twitter.com/sleetdrop
Hi,
I was wondering whether it would be possible to include some more info when
latex complains about errors. The main point is that the line number that
latex gives you (and what is displayed in the Textmate error window) can
sometimes be way off, especially when you have a lot of code and the error
is many lines above this line.
For example, if I compile the following beamer document
-----
\documentclass{beamer}
\begin{document}
\begin{frame}
a
b
c
\unknown
d
e
\end{frame}
\end{document}
-----
then Textmate tells me
-----
Latex Error: ./test.tex:17 Undefined control sequence.
-----
which corresponds to "\end{frame} ". The error is obviously in line 12
because of the unkown command \unknown.
It is not hard to see that when you have a lot of complicated math,
tracking down a single typo can sometimes be very painful...
I realize that getting the exact line number for such an error is
difficult, but since the latex log already indicates that \unknown is
unknown,
-----
...
./test.tex:17: Undefined control sequence.
\beamer@doifinframe ...par b \par c \par \unknown
\par d \par e \end
{beamer...
l.17 \end{frame}
-----
it would make life a lot easier if this is visible in the log window of
Textmate too.
So, would it be possible to include, for example, these last two lines in
the Textmate error window too?