Thanks Andrew!<div class="gmail_extra"><br clear="all"><div><div>Elia</div><div><br></div><div><div><font color="#9fc5e8">☁</font><font color="#cccccc"> </font><a href="http://twitter.com/elia" target="_blank"><font color="#999999">@elia</font></a> <font color="#93c47d">✎</font><font color="#cccccc"> </font><a href="mailto:elia@schito.me" target="_blank"><font color="#999999">elia@schito.me</font></a></div>

<div><font color="#f1c232">☎</font><font color="#cccccc"> </font><a><font color="#999999">(+39) 348/9051393</font></a></div></div></div><br>
<br><br><div class="gmail_quote">On Wed, Dec 12, 2012 at 11:23 PM, Andrew Dupont <span dir="ltr"><<a href="mailto:andrew@andrewdupont.net" target="_blank">andrew@andrewdupont.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div style="word-wrap:break-word"><div>Riki,</div><div><br></div><div>Perhaps I can elaborate on Elia's behalf:</div><div><br></div><div>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.)</div>

<div><br></div><div>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.</div>

<div><br></div><div>If you still want to show a tooltip, you could try the approach I explain below. But I wouldn't recommend it.</div><div><br></div><div>2. There's no simple way to do this in TextMate 2.</div><div>

<br></div><div>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.</div>

<div><br></div><div>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.</div>

<div><br></div><div>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].</div><div><br></div><div>(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.)</div>

<div><br></div><div>Cheers,</div><div>Andrew</div><div><br></div><div>[1] <a href="http://manual.macromates.com/en/language_grammars#language_grammars" target="_blank">http://manual.macromates.com/en/language_grammars#language_grammars</a></div>

<div>[2] <a href="https://gist.github.com/0d6ce8625cf371f22734" target="_blank">https://gist.github.com/0d6ce8625cf371f22734</a></div><div>[3] <a href="http://reinteractive.net/posts/4-stripping-whitespace-out-of-textmate-2" target="_blank">http://reinteractive.net/posts/4-stripping-whitespace-out-of-textmate-2</a></div>

<div><div class="h5"><div><br></div><div><div>On Dec 7, 2012, at 7:42 AM, riki wrote:</div><br><blockquote type="cite">Dear Elia,<br>
<br>
Thank you very much for your kind response.<br>
<br>
BTW I am not expert in TextMate grammar.  So could you please elaborate your suggestions? <br>
<br>
Kind Regards,<br>
Riki<br>
<br>
<br>
On Fri, 07 Dec 2012 15:04:26 +0530  wrote<br>
>1) yes, you can setup the language grammar to catch and highlight those keywords in a given scope (e.g. data decl)2) I <br>
don't think you can do that while you type, but probably you can create a command that does the transformation on <br>
demand (or hook it to the saving)<br>
<br>
Elia<br>
☁ @elia ✎ <a href="mailto:elia@schito.me" target="_blank">elia@schito.me</a><br>
<br>
☎ <a href="tel:%28%2B39%29%20348%2F9051393" value="+393489051393" target="_blank">(+39) 348/9051393</a><br>
<br>
<br>
<br>
On Thu, Nov 29, 2012 at 1:37 PM, riki <u></u> wrote:<br>
<br>
<br>
Hi all,<br>
<br>
<br>
<br>
How to accomplish the following things within TextMate 2 for Fortran language:<br>
<br>
<br>
<br>
1) Is it possible to appear warning in a tool tip if we type Fortran keywords in data declarations? I am asking because if <br>
<br>
somehow or by mistake we are using those ones as variables and we know that Fortran does not complain about it. <br>
<br>
<br>
<br>
2) The second thing is related to code formatting. Suppose we are writing a program in lower case letters and whenever we <br>
<br>
type any Fortran keyword we wish that it always came in upper case letters. Is there any way to do it?<br>
<br>
<br>
<br>
Kind Regards,<br>
<br>
Riki<br>
<br>
<br>
<br>
Catch India as it happens with the Rediff News App. To download it for FREE, click here<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
<br>
textmate mailing list<br>
<br>
<a href="mailto:textmate@lists.macromates.com" target="_blank">textmate@lists.macromates.com</a><br>
<br>
<a href="http://lists.macromates.com/listinfo/textmate" target="_blank">http://lists.macromates.com/listinfo/textmate</a><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
<br>
textmate mailing list<br>
<br>
<a href="mailto:textmate@lists.macromates.com" target="_blank">textmate@lists.macromates.com</a><br>
<br>
<a href="http://lists.macromates.com/listinfo/textmate" target="_blank">http://lists.macromates.com/listinfo/textmate</a><br><table border="0" width="100%" height="57" cellspacing="0" cellpadding="0" style="font-family:Verdana;font-size:11px;line-height:15px">

<tbody><tr><td><a href="http://sigads.rediff.com/RealMedia/ads/click_nx.ads/www.rediffmail.com/signatureline.htm@Middle?" target="_blank"><img></a></td></tr></tbody></table><table width="578" border="0" cellspacing="0" cellpadding="0">

<tbody><tr><td><span style="font-family:Arial,Helvetica,sans-serif;font-size:12px;color:#393939">Follow <span style="color:#0000cc"><b><u><a href="http://track.rediff.com/click?url=___http://dealhojaye.rediff.com?sc_cid=rediffmailsignature___&cmp=signature&lnk=rediffmailsignature&newservice=deals" target="_blank">Rediff Deal ho jaye!</a></u></b></span> to get exciting offers in your city everyday.</span></td>

</tr></tbody></table><br>_______________________________________________<br>textmate mailing list<br><a href="mailto:textmate@lists.macromates.com" target="_blank">textmate@lists.macromates.com</a><br><a href="http://lists.macromates.com/listinfo/textmate" target="_blank">http://lists.macromates.com/listinfo/textmate</a><u></u></blockquote>

</div><br></div></div></div><br><br>
_______________________________________________<br>
textmate mailing list<br>
<a href="mailto:textmate@lists.macromates.com">textmate@lists.macromates.com</a><br>
<a href="http://lists.macromates.com/listinfo/textmate" target="_blank">http://lists.macromates.com/listinfo/textmate</a><br></blockquote></div><br></div>