Hello, everyone.
As you may know I have written a basic code completion system and
documentation-lookup command for TextMate(^M and^H). I have also finished
a definition look up system for Cocoa(suggestion for key-trigger
appreciated).
The solution I have used is to look up every method in a gzipped
list and
accessing it from ruby via the shell command zgrep. Since I want the
system to work with more than just cocoa I thought I tell anyone
interrested so that they can give me their opinions. Currently the list
is formatted in the following way:
[methodName][tab][framework][tab][behavior][tab][Class][tab][methodtype][tab][returnType]([tab][arg])[newline]
ofcourse if there are more args, then the parenthesis is repeated, and if
there is no arg the whole parenthesis is omitted. hopefully the following
ruby dict explains the various abbreviations.
{:AppKit => "AK",
:CoreData => "CD",
:CoreImage => "CI",
:Foundation => "F",
:instancemethods=> "im",
:classmethods => "cm",
:classes=> "Cl",
:protocols => "Pr",
:delegatemethods => "dm",
:notifications => "no"}
behaviours are either classes or protocols, methodtypes are either
instancemethods delegatemethods notifications or classmethods.
displayMode AK Cl NSToolbar im
NSToolbarDisplayMode
propertyForKey: F Cl NSStream im
id NSString *
textUnfilteredFileTypes F Cl NSAttributedString
cm NSArray *
textUnfilteredPasteboardTypes F Cl NSAttributedString
cm NSArray *
textView:clickedOnLink:atIndex: AK Cl NSTextView
dm BOOL NSTextView
* id unsigned
when looking up methods for completion and documentation this is all the
information I need for my uses. The problem comes when doing declaration
lookup, since not all classes are declared in a file with the same name
and there are categories and so on. Currently I am using an xml dump from
AppKido converted into a ruby dict using crazy gsub commands.
Unfortunately the appkido parser is a little wacky, so I thought that I
would ask the list for help.
What is needed is a file or a script that generates the file
according to
the spec above, but when a method is declared in a file that does not
correspond to the class name, the filename should be written after the
Class using a separator that is not a tab (; perhaps).
If anyone see a problem coming up with this approach please say
so, if
you have any other critisism feel free to add it. Hopefully this layout
contains enough parameters should someone want to write completion and
lookup commands for pyobjc or rubycocoa. Perhaps it would be smart to
come up with a name for an index file, containing your own indexed
methods, that will be automatically picked up by the various completion
and look-up tmCommands.
Joachim MÃ¥rtensson
It was bothering me that the cleanup command in GTD2 wasn't
preserving whitespace before projects. I.e. this...
* Foo
- bar
* Baz
- bob
- fred
Would be turned into:
* Foo
- bar
* Baz
- bob
- fred
This "fixes" it in a way that'll likely be laughed at. Point and
laugh away, it works for me... :-)
b.bum
Index: GTD2.tmbundle/Commands/Cleanup.tmCommand
===================================================================
--- GTD2.tmbundle/Commands/Cleanup.tmCommand (revision 5658)
+++ GTD2.tmbundle/Commands/Cleanup.tmCommand (working copy)
@@ -17,7 +17,11 @@
if (myTest.pre_match != "+" and myTest.pre_match.length > 0)
puts line
else
- myDone = myDone + line
+ if (line != "\n")
+ myDone = myDone + line
+ else
+ puts "\n"
+ end
end
end
puts myDone</string>
Dear Allan:
On Oct 27, 2006, at 6:45 PM, Allan Odgaard wrote:
> On 28. Oct 2006, at 03:32, William Scott wrote:
>
>> It may be a system shortcoming but it breaks the default OS X
>> behavior.
>> Personally I always launch X11 apps from the command line like any
>> other
>> unix program, but OS X has been specifically designed to make these
>> binaries double-clickable or openable with the "open" command (as
>> well as
>> the defective open-x11 command).
>
> Which application would handle the double click of such unix binary?
The Finder. If you don't have textmate, you can navigate in the
Finder to /usr/X11R6/bin and double-click on a file, and it runs. I
don't use the system that way -- I'm basically a unix geek, but it is
the default system behavior.
>
> Can you open it with: open -a «the application which the system
> seems to have a hardcoded fallback for» «application»? If that is
> doable, you could do a wrapper for open, which added the -a
> argument for these binaries.
Apple has a program that does this it calls open-x11. I guess it is
useful if one doesn't have /usr/X11/bin in the $PATH, but apart from
that, it seems kind of silly (and has some odd limitations).
>
>> Is there not a way to simply exclude binary executable files from
>> those
>> textmate claims as its own?
>
> There is not, as said, this is a system shortcoming.
I wrote a simple-minded shell-script wrapper for "mate" that tests
files and excludes them if they are binary data files, mainly to
allow creating projects on the command-line that exclude files I
can't edit (and pass them off to other programs). FWIW: http://
xanana.ucsc.edu/Library/init/zsh/local-functions/darwin/edit
>
>> Other editors don't seem to do this.
>
> And other editors does not open README, INSTALL, Makefile, etc.
> when double-clicked. I got requests for that on a weekly basis
> before I added the plist entry.
Sorry, I thought it would be easy to exclude specific directories
like /usr/X11R6/bin and /sw/bin.
I'm not complaining, just curious (and largely ignorant of how these
things work).
All the best,
Bill
I installed DarwinPorts (now MacPorts) several weeks ago, and installed
TextMate today. When I click on a Unix app found in /opt/local/bin, such
as /opt/local/bin/kmail, instead of the app opening using Apple's X11,
which it was doing previously, it now opens in TextMate.
If I Get Info, I cannot change the file association back to X11 due to
permissions.
Is there a solution that I'm simply not seeing? So far, the only thing
that works is uninstalling TextMate, which I obviously don't want to do.
Thanks.
Scott
--
R. Scott Granneman
scott(a)granneman.com ~ www.granneman.com
Full list of publications @ http://www.granneman.com/publications
My new book: Linux Phrasebook @ http://www.granneman.com/books
Read the Download Squad Blog @ http://www.downloadsquad.com
"A man cannot be too careful in the choice of his enemies."
---Oscar Wilde
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I had a specific need for a snippet, that would have current word (with
fall back to selected text) to generate either a container tag or a
single tag, depending on whether the ending forward slash was removed in
the tab stop variable or not.
I use this for the TXP bundle to generate a plugin tag, since those tags
would not get matched by the insert open/close tag command, (ctrl shift
<) since it is impossible to know about all of them.
It uses the following snippet(with capture register 1 to decide weather
the closing container tag should be inserted or not :
tag="${TM_CURRENT_WORD:-TM_SELECTED_TEXT}"
tags="<txp:\${1:$tag}\${2: />}\$3\${2/ \/>|(.+)/(?1:<\/txp\:$tag> )/}"
echo "$tags"
The macro then selects the current word, triggers the command, which has
output set as "Insert as Snippet" and tabs over the second tab stop
variable.
Not knowing right now where to put it, I assigned it to :( ctrl shift >
) and named it simply: Tag/s
Here is how to use it:
write the tag name, trigger the macro, which will insert a single tag.
If that is intended, then pressing one more time tab will leave the
caret at the end of the single tag.
When the tag is no single tag, the you just type : >
and it will mirror itself inserting the corresponding closing
tag,leaving a tab stop variable in between.
This is perfect, since I can then just press return and it will do the
special HTML return behavior.
You can easily adapt this to your needs, for HTML or anything else.
(I forgot to encounter for attributes though)
regards, marios
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
Comment: This might change in the future
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFQgGY8tSzPOYuZvQRApgJAKDRs0Z31MkhBxxLxrsfgvmm738T+wCgiwLz
AdkkOl7b6eB+vv2CozbK220=
=ZtwD
-----END PGP SIGNATURE-----
>From the Terminal:
matt-neuburgs-imac-g5:~ mattneub$ ruby -e "Object.new.hello"
-e:1: undefined method `hello' for #<Object:0x3257bc> (NoMethodError)
Very good. Now let's try it in TextMate. Make a TextMate doc, set it to
Ruby, put Object.new.hello into it, and run it. The RubyMate window appears
and says:
NoMethodError: undefined method 'hello' for #
I'm guess that the loss of <Object:xxx> is because of an HTML problem. Hmmm,
I suppose I *could* try to fix this instead of just talking about it. :)
Anyway, a fix would be nice to have. Thx - m.
--
matt neuburg, phd = matt(a)tidbits.com, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
Is there any way to make textmate save, without a dialog, the
frontmost document, from a command?
I tried `osascript -e 'tell application "TextMate" to save document
1'`, but I got a file dialog. Thanks for your assistance.
Jeremy
Good morning.
I think something similar has been brought up previously on the
mailing list, but I didn't see a resolution so I thought I'd check in.
I've got a script that I've got triggering on Cmd-S to create a
backup file each time I save. However, the problem is that if I have
an unsaved document and click Cmd-W and hit Enter to save, my script
does not execute because Cmd-S was never pressed.
What I would love is to be able to trigger on an event like the
"save" event in this example. Another subscriber to this list had a
few other events that he thought would be useful, too.
Any chance something like this is in the pipeline, Allan?
Thanks.
--
Michael Lehmkuhl <michael(a)electricpulp.com>
Partner, Electric Pulp
1.605.988.0177 : 1.888.722.PULP
electricpulp.com