[TxMt] Txp Grammar and couple of questions

marios tmtxpstuff at consking.com
Mon Jun 5 10:05:05 UTC 2006


Hello, to all,

I haven't been able to continue my threads due to some serious Issues in
TB mail client
In fact the only solution was to subscribe again.

That's why I am opening a new thread.
Sorry for that.

In the meanwhile I had the chance to scan the archives for valuable
information on this subject  and I indeed found most of the missing
pieces of the puzzle.
I finally came to understand, the syntax used in those plist files.

I have started a second version of the grammar that is mostly derived
from the syntax model used in the experimental Html Bundle, except it
doesn't use a full tree, that resolves to an exclusive root node with
recursive
references.
Instead it requires an include value for each tag in the repository  ,
while the custom attributes and values are only referenced from the
repository items (I'll see if I can group them later).



I have done it that way, since I came to realize, that any attempt to
follow the example in the experimental XHTML Grammar, would have been:

1)Unsuitable for the current meta language

2)Too complex for this purpose.

Yes I have been scanning those thousands of lines of code over and over
again and Tm makes that very convenient with all it's search
functionality, bookmarks and so on.
I like that modularity approach of the syntax and try to see, if I can
adapt it to my needs.

Before I proceed to finally construct the Language from the core module
that I have, I started asking myself, weather I have followed the right
strategy ,and if not, well. there is always enough time to adapt.



There are however a couple of questions that turned up, that I hope,
some of you might be able to answer.

1)How do I insert a snippet inside a snippet ?

I'd like to tab through a code block, that I have, at certain variable
insertion points, I have other snippets, that I call through tab
triggers,that again have variables that need to get inserted
into the first snippet, and after the last variable of the second
snippet the cursor shall return one newline after the last insertion
point of the last variable of the first snippet,or the zero variable.
How do I do that ?
(Command ?, macro?)

EDIT.: I've had a couple of inconsistencies with using snippets in snippets,
sometimes it didn't trigger if the Insertion point was a nested variable
with two placeholders itself, then backspacing would swallow the last
character of the
tabtrigger keyword of the second snippet.

Oh, well, it worked after a couple of keystrokes.

2)Key bindings

After realizing that certain key bindings are lost after the previous
update, I am not able to use certain custom key bindings,
I'm not able to recall right now, which ones they are.

How can I reset the key bindings for TM system wide ?


3)FoldingStopmarkers and FoldingStartmarkers not working.

I can't get those going, I use the following code (All most Identical
with the html bundle):

foldingStartMarker = '(?x)

(<txp:(?i:comment_permlink|file_download_link|if_article_author|if_article_category|if_article_list|if_article_section|if_author|if_category|if_comments|if_comments_allowed|if_comments_disallowed|if_comments_error|if_custom_field|if_different|if_excerpt|if_first_article|if_individual_article|if_last_article|if_plugin|if_search|if_section|if_status|link_to_home|link_to_next|link_to_prev|newer|older|permlink|php)\b.*?>

|(<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)\b.*?>
		|<!--(?!.*--\s*>)
		|\{\{?(if|foreach|capture|literal|foreach|php|section|strip)
		|\{\s*($|\?>\s*$|//|/\*(.*\*/\s*$|(?!.*?\*/)))
		)';
	foldingStopMarker = '(?x)

(</txp:(?i:comment_permlink|file_download_link|if_article_author|if_article_category|if_article_list|if_article_section|if_author|if_category|if_comments|if_comments_allowed|if_comments_disallowed|if_comments_error|if_custom_field|if_different|if_excerpt|if_first_article|if_individual_article|if_last_article|if_plugin|if_search|if_section|if_status|link_to_home|link_to_next|link_to_prev|newer|older|permlink|php)>

|(</(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)>
		|^(?!.*?<!--).*?--\s*>
		|\{\{?/(if|foreach|capture|literal|foreach|php|section|strip)
		|^[^{]*\}
		)';




4)Bookmarks: How can I make them consistent after closing and reopening
a file?(on my Install id didn't work)


Again I apologize for not answering my previous topics and I thank
anyone who answers this post in advance.


best regards, marios




More information about the textmate mailing list