Hello,
I'm a complete newbie concerning TextMate customization, but there is something I'd like to do that I would find very useful which I don't know how to tackle.
The latest beta of MailTags allows one to create urls pointing to Mail messages in a very robust way: the url works across several macs synchronized to the same imap account and when the message is moved or tagged. I'm now using these urls to refer to emails in my GTDAlt file.
How would one proceed to add a command that opens such a message (in Mail) when called on a url. The way I proceed now is select and copy the url (which looks like message://454F0376.2010005@ens-lyon.fr), and type "open " and paste the url in a terminal, which opens it. I found one improvement, which is adding "open " before the url in TextMate, selecting it, and calling ^R. What I would like is a way, when the cursor is inside the url, to call a command that opens it, but I don't know how to do it.
Thank you for any suggestion,
Alan
-- Alan Schmitt http://alan.petitepomme.net/
The hacker: someone who figured things out and made something cool happen. .O. ..O OOO
On 9. Nov 2006, at 00:00, Alan Schmitt wrote:
[...] How would one proceed to add a command that opens such a message (in Mail) when called on a url. The way I proceed now is select and copy the url (which looks like message:// 454F0376.2010005@ens-lyon.fr) [...]
Ask Harris to markup these URLs in the GTDAlt grammar (as markup.underline.link) then you will be able to hit enter (⌅) on the URL to open it.
Of course if Harris do not think these URLs should be underlined in GTDAlt, you can add the rule locally.
On Nov 8, 2006, at 10:15 PM, Allan Odgaard wrote:
On 9. Nov 2006, at 00:00, Alan Schmitt wrote:
[...] How would one proceed to add a command that opens such a message (in Mail) when called on a url. The way I proceed now is select and copy the url (which looks like message:// 454F0376.2010005@ens-lyon.fr) [...]
Ask Harris to markup these URLs in the GTDAlt grammar (as markup.underline.link) then you will be able to hit enter (⌅) on the URL to open it.
Of course if Harris do not think these URLs should be underlined in GTDAlt, you can add the rule locally.
Actually, they are already there, pressing ctrl-L with the caret on the note line will make TM run the "open" command on any text contained in <...>. So if the note contains: <message:// 454F0376.2010005@ens-lyon.fr>, then this should work just fine. Also, pressing ENTER in it should work just fine. Though ctrl-L will work from anywhere in the line, and it will open all links showing up in that line.
In other words, the only expectation from the bundle is that you will enclose such links in <...>, instead of having them lying around free. This might be a good moment to remind you, that you can create such a link to a local file by simply dragging it into the right location in the gtd file.
Haris
On 9 nov. 06, at 04:31, Charilaos Skiadas wrote:
Actually, they are already there, pressing ctrl-L with the caret on the note line will make TM run the "open" command on any text contained in <...>. So if the note contains: <message:// 454F0376.2010005@ens-lyon.fr>, then this should work just fine. Also, pressing ENTER in it should work just fine. Though ctrl-L will work from anywhere in the line, and it will open all links showing up in that line.
Ooh, really nice. Thanks a lot, it works great.
In other words, the only expectation from the bundle is that you will enclose such links in <...>, instead of having them lying around free. This might be a good moment to remind you, that you can create such a link to a local file by simply dragging it into the right location in the gtd file.
I always forget to do this, thanks for the reminder.
Alan
-- Alan Schmitt http://alan.petitepomme.net/
The hacker: someone who figured things out and made something cool happen. .O. ..O OOO
On 9 nov. 06, at 04:31, Charilaos Skiadas wrote:
This might be a good moment to remind you, that you can create such a link to a local file by simply dragging it into the right location in the gtd file.
I just discovered that this does not work with folders, I had to manually create a link.
I also discovered that if there are several links in the same line (in a footnote of a gtd file) then they get all opened, independently of where the cursor is.
Alan
-- Alan Schmitt http://alan.petitepomme.net/
The hacker: someone who figured things out and made something cool happen. .O. ..O OOO
On Nov 10, 2006, at 11:42 AM, Alan Schmitt wrote:
On 9 nov. 06, at 04:31, Charilaos Skiadas wrote:
This might be a good moment to remind you, that you can create such a link to a local file by simply dragging it into the right location in the gtd file.
I just discovered that this does not work with folders, I had to manually create a link.
Yes, unfortunately that's a bit beyond my control, since folders are not treated like files for drop purposes (at least they don't seem to).
I also discovered that if there are several links in the same line (in a footnote of a gtd file) then they get all opened, independently of where the cursor is.
When using ctrl-L, indeed, as I said in my previous response ;) :
Actually, they are already there, pressing ctrl-L with the caret on the note line will make TM run the "open" command on any text contained in <...>. So if the note contains: <message:// 454F0376.2010005@ens-lyon.fr>, then this should work just fine. Also, pressing ENTER in it should work just fine. Though ctrl-L will work from anywhere in the line, and it will open all links showing up in that line.
The main difference of course is that pressing ENTER works anywhere in textmate, provided it is not overwritten in the bundle, while ctrl- L only works in GTDAlt (and of course on the dozens of bundles that include GTDAlt in them ;) ).
Alan
Haris
On 10 nov. 06, at 19:05, Charilaos Skiadas wrote:
I also discovered that if there are several links in the same line (in a footnote of a gtd file) then they get all opened, independently of where the cursor is.
When using ctrl-L, indeed, as I said in my previous response ;) :
Actually, they are already there, pressing ctrl-L with the caret on the note line will make TM run the "open" command on any text contained in <...>. So if the note contains: <message:// 454F0376.2010005@ens-lyon.fr>, then this should work just fine. Also, pressing ENTER in it should work just fine. Though ctrl-L will work from anywhere in the line, and it will open all links showing up in that line.
The main difference of course is that pressing ENTER works anywhere in textmate, provided it is not overwritten in the bundle, while ctrl-L only works in GTDAlt (and of course on the dozens of bundles that include GTDAlt in them ;) ).
Oops, sorry, I guess I skimmed this bit. I just tried ENTER and everything is perfect.
Thanks a lot,
Alan
-- Alan Schmitt http://alan.petitepomme.net/
The hacker: someone who figured things out and made something cool happen. .O. ..O OOO