Hi everyone. I just started using TextMate today and I've run into a
little problem. I've noticed that my Shell Variables (as set in the
Preferences) aren't loaded properly when I use templates. For
example, I'd kind of like to mimic Xcode's built-in templates. To do
this, I've modified the Java Class template to look more like:
//
// ${TM_NEW_FILE_BASENAME}.java
//
// Created by ${TM_USERNAME} on ${TM_DATE}.
// Copyright (c) ${TM_YEAR} ${TM_ORGANIZATION_NAME}. All rights
reserved.
//
...
and I've updated the script associated with that template to look
like this:
export TM_YEAR=`date +%Y`
export TM_DATE=`python -c 'import datetime
now = datetime.datetime.now()
print "%s/%s/%s" % (now.day, now.month, now.year)
'`
export TM_USERNAME=`niutil -readprop / /users/\$USER realname`
perl -pe 's/\$\{([^}]*)\}/$ENV{$1}/g' \
< class-insert.java > "$TM_NEW_FILE"
All of this works fine, except ${TM_ORGANIZATION_NAME} isn't being
replaced correctly. It works fine for Code Snippets, but not in
Templates. If I add
env >> "$TM_NEW_FILE"
to the end of the script, TM_ORGANIZATION_NAME isn't listed. Is this
a bug or a known issue? I've searched Google, TextMate's bug list,
and the list archives, but I can't find any mention of the issue. I
would appreciate any help in resolving the problem... it's a minor
nuisance to an otherwise great application.
-Prachi
>===== Original Message From Prachi Gauriar <pgauriar(a)mac.com> =====
[...]
>BTW, TextMate is an amazing app. I've been telling my friends about
>it: "It's like Emacs, if it were designed today with a GUI in mind
>and without Emacs Lisp or the cruft of 20 years of development."
Except even TextMate can convert vi-addicts. :)
--
Sami Samhuri
sjs(a)uvic.ca
Seems that there still is some odd problem with syntaxes depending on
other syntaxes. I just got this:
2006-06-05 13:16:55.842 TextMate[5366] didn't find rule named
source.open-gl
2006-06-05 13:16:55.842 TextMate[5366] didn't find rule source.open-gl
Odd thing is to my knowledge I never edited anything that had
anything to do with open-gl...
Gerd
Hi all, I just started using TextMate (long time emacs user), and
thought I would post to let people know that I'm developing a bundle
for IDL (Interactive Data Language http://www.ittvis.com/idl/index.asp).
Current features :
Syntax Highlighting : Keywords, builtin routines, system
variables, system commands
Folding
Indenting
Recognizes a program's function names and parameters
IDL documentation search :
open IDL's builtin HTML help libraries
search IDL's builtin HTML help libraries
run DOC_LIBRARY to build help files
tab completion for common control forms
new program template
I've posted it at http://aster.colorado.edu/software/IDL.tmbundle.zip
and if I can get subversion access, I'll put it in the repository, or
somebody else can, but I'm not done with it yet... which brings me to
my next point...
I wonder if it is possible to keep a persistent process open in the
background and send commands to it. I'm not sure how IDLWAVE http://
www.idlwave.org does this for emacs, I'm afraid that emacs runs a
complete shell of its own... I suppose this could be done with a
separate program that just passes information back and forth, but
that seems inelegant (and more difficult than it needs to be). All I
need to do is start a process, pass strings to it as standard in, and
read standard out and error from it. I could see this kind of
groundwork being useful to far more than just IDL, it should work
with any interpreted language that has an interactive mode (ruby,
matlab, ...), and many debuggers for that matter (gdb at least).
If this turns out to be relatively easy to do, I would also like to
inquire about the status of a plugin API. The web page says more is
likely to be done here, has anything been done? Eventually I might
want to write a simple plugin that talks to the IDL process and
highlights associated lines in the editor window (and possibly add a
GUI for querying and displaying variables). Again, this seems like
something that a wide array of programming languages would benefit
from having a framework for (hint, hint :-) ).
Ethan
Allan,
Here is an updated version of the "AES Encrypt Document / Selection With
Password..." command. It uses secure-inputboxs and asks to verify the
entered password.
Decrypt version also needs secure-inputbox, but obviously not the
verification.
Q
---
res=$(CocoaDialog secure-inputbox --title "Encrypt Text With AES 128" --
informative-text "What password should be used?" --text "" --button1
"Continue" --button2 "Cancel")
[[ $(head -n1 <<<"$res") == "2" ]] && exit_discard
passwd=$(tail -n1 <<<"$res")
res=$(CocoaDialog secure-inputbox --title "Encrypt Text With AES 128" --
informative-text "Enter password again to verify." --text "" --button1
"Encrypt" --button2 "Cancel")
[[ $(head -n1 <<<"$res") == "2" ]] && exit_discard
passwd2=$(tail -n1 <<<"$res")
if [[ $passwd == $passwd2 ]]; then
openssl enc -e -aes128 -base64 -pass "pass:$passwd"
else
exit_show_tool_tip "Password mismatch! Please play again."
fi
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
Before I run into the risk of damaging my files, I couldn't really
figure out what to enter in the dialog box, when I open it from the
drawers info button on the tool bar.
I have a folder which I want to exclude from updating which is below the
root of my project folder.
Do I have to enter the name of that folder in the name box , and then
alter the RE ?
According to the manual, if I alter the default pattern from:
!.*/(\.[^/]*|CVS|_darcs|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle))$
To :
!.*/(\.[^/]*|CVS|_darcs|\{arch\}|blib|.*~\.nib|.*\.(MY_EXCLUDED_FOLDER|framework|app|pbproj|pbxproj|xcode(proj)?|bundle))$
Can I be sure, that the Folder will not be altered ?
(I know, I could test against, it, by doing "find in project, but I'd
like to know also, what the other dialog options mean, and what it does
behind the scenes, when I concurrently move files and Folders around,
and update in the meanwhile.)
What function does the "Save as absolute path" check box have in this
context ?
Sorry for bothering again,
best regards, and many thanks in advance, marios
I am using a TM Project because I need to set a few project-local
variables. Projects files, “.tmproj”s, are serialized to a single xml
file, and included is information about window settings (position,
size, drawer open?). For example, when you move the project window,
your VCS will mark it as changed. This is very annoying.
Xcode solves this problems my separating the “project” and the
project window settings, all contained inside a directory/
XcodeProject.xcodeproj/
project.pbxproj <----- The _real_ project file.
myusername.mode1 <---- other stuff.
myusername.pbxuser <---- more stuff.
-- Daniel
Hi,
I using the latest build, and I just noticed something. If I close a
file and don't want to make changes, I usually just hit CMD-W then
CMD-D for Don't Save. Now, when I hit CMD-D, instead of choosing the
button in the dialog sheet, a menu is popped up:
Push to default repository 1
Diff 2
What's New 3
etc. Looks like something for a version control, but I can't find the
key shortcut (hmm.. would be nice to be able to search for a
keystroke... there's a lot of commands in that bundle menu :)
Thanks. (I will enter a ticket if need be.
jt
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> textmate-request(a)lists.macromates.com wrote:
> [snip]...............[snip]
>
>
>
> Hi,
>
> Regarding my previous post, I'd like to mention, that I kind of solved
> one of my previous problems to escape from a nested snippet, relying
> solely mostly on snippets and macros,
> For the purpose of easy post maintenance, and since I'm a complete Idiot
> when it comes to scripts and UNIX I found a workaround on a bundle, that
> I called GrammarTech and sort of stepped out as a side project for the
> TXP Language Grammar.
>
> The only purpose of this bundle is to generate the Grammar within
> minutes and ease the maintenance of the Language.
>
> To finally return the caret to the \n position of the last variable of
> the first snippet, I have two macros.
>
> One that swaps the last include reference around(where the previous last
> include reference is a place-holder item, that never changes it's
> name),and one that returns the caret to it's initial position.
> Although it pretty much works the way I wanted, I ran in to a couple of
> Issues.
>
> To execute the macros that do the 2 previous jobs described above, I
> initially assigned them the + and - keys of the numeric keypad,
> while the scope of the Language item, (which is a conventional plist
> bundle language item by itself) of the Grammar-tech Bundle was set to
> grammartech.plist.
>
> Changing my mind afterwards and assigning them a scope of source.plit
> broke the key bindings (Changing them after to something else, also does
> not trigger the macros anymore).
> The macros are still working, but trigger only from the gear popup menu
> on the toolbar.
>
> I also found, that I could only reliably nest the one snippet in the
> other, when I place the Zero tab variable right after the last variable
> of the first snippet.
>
> I don't know if this is a bug, but I thought it would be better to
> mention it here.
>
>
> Sorry again for this long post, and many thanks in advance,
>
> regards, marios
>
>
>