Hi all,
jEdit has a plug-in for its HTML/XML mode that automatically closes the current markup block. For instance, if you have this:
<html> <body> <h1>
And then you hit the hotkey, "</h1>" will be inserted automatically.
I thought I remembered reading something in the TextMate manual about an identical feature, but I can't find it now. I know that there's an "Insert Open/Close Tag (with Current Word)" command, but that's not quite the same.
Thanks,
Trevor
On 08 Jan 2006, at 23:51, Trevor Harmon wrote:
Hi all,
jEdit has a plug-in for its HTML/XML mode that automatically closes the current markup block. For instance, if you have this:
<html> <body> <h1>
And then you hit the hotkey, "</h1>" will be inserted automatically.
I thought I remembered reading something in the TextMate manual about an identical feature, but I can't find it now. I know that there's an "Insert Open/Close Tag (with Current Word)" command, but that's not quite the same.
Thanks,
Trevor
You're looking for "Insert Closing Tag" in the Automation menu. "Cmd + Opt + ." by default.
-- Fred
On Jan 8, 2006, at 3:01 PM, Fred B. wrote:
You're looking for "Insert Closing Tag" in the Automation menu. "Cmd + Opt + ." by default.
Perfect; thanks! But why in the world is it on the Automation menu? It doesn't make any sense to me. Shouldn't it go in the Text menu or inside a bundle?
Trevor
On 09/01/2006, at 0:07, Trevor Harmon wrote:
On Jan 8, 2006, at 3:01 PM, Fred B. wrote:
You're looking for "Insert Closing Tag" in the Automation menu. "Cmd + Opt + ." by default.
Perfect; thanks! But why in the world is it on the Automation menu? It doesn't make any sense to me. Shouldn't it go in the Text menu or inside a bundle?
As for not being in a bundle, it's one of the rare hardcoded (for now) things in the editor :-p.
-- Sune.
On 08/01/2006, at 11:07 PM, Trevor Harmon wrote:
On Jan 8, 2006, at 3:01 PM, Fred B. wrote:
You're looking for "Insert Closing Tag" in the Automation menu. "Cmd + Opt + ." by default.
Perfect; thanks! But why in the world is it on the Automation menu? It doesn't make any sense to me. Shouldn't it go in the Text menu or inside a bundle?
They are all in bundles, but where are bundles displayed?
Answer: All the automation components of a bundle are displayed in the Automation menu.
More precisely, the commands, macros, and snippets associated with a bundle provide automation features, and are displayed under the automation menu, ordered by those three major groupings, and then accessible by bundle name within those groupings.
They are also available from the gear widget in the tool bar at the bottom of the window, which will preselect the current language (bundle) and display all automation features together.
cheers, tim
On Jan 8, 2006, at 6:15 PM, Timothy Bates wrote:
Answer: All the automation components of a bundle are displayed in the Automation menu. More precisely, the commands, macros, and snippets associated with a bundle provide automation features, and are displayed under the automation menu, ordered by those three major groupings, and then accessible by bundle name within those groupings.
I'm not seeing this in my installation of TextMate 1.5. I only see a single item ("Insert Closing Tag") under the Automation menu. Other macros, such as Generic Completion in the LaTeX bundle, aren't there, even though they're definitely available because I see them in the Bundle Editor.
They are also available from the gear widget in the tool bar at the bottom of the window, which will preselect the current language (bundle) and display all automation features together.
Yes, I see the various macros and snippets for bundles in the gear menu, but the Insert Closing Tag macro (or whatever it is) doesn't seem to be there. So I don't understand why Insert Closing Tag is some special thing that belongs in the Automation menu by itself, and not in any bundle.
Trevor
I see what you are saying now: my answer was incorrect (when will i learn :-), and complete tag is anomalously )
So, my guess is this is an inconsistency introduced by Allen in responding to people thinking "this is no good for html, i can't even close tags. So he is trying to expose some more "built-in" and obvious functionality.
But it is not rational, I agree. I guess the logical thing to do would be to break out all the functionality pertaining to the current scope (i.e, add the "gear" menu on the bottom of the automation menu)
That way the things you probably want (pertinent to your context) will be in the menu, and other stuff as accessible as ever. Trouble is that this would make the menu clumsy and highly visually confusing (changing often).
Still, i agree that sticking close-tag on the end is not consistent: especially when "cmd-shift-<" and other common items are not there: makes you think you have seen all that is on offer.
Ahh well. tim
On Jan 8, 2006, at 6:15 PM, Timothy Bates wrote:
Answer: All the automation components of a bundle are displayed in the Automation menu. More precisely, the commands, macros, and snippets associated with a bundle provide automation features, and are displayed under the automation menu, ordered by those three major groupings, and then accessible by bundle name within those groupings.
I'm not seeing this in my installation of TextMate 1.5. I only see a single item ("Insert Closing Tag") under the Automation menu. Other macros, such as Generic Completion in the LaTeX bundle, aren't there, even though they're definitely available because I see them in the Bundle Editor.
They are also available from the gear widget in the tool bar at the bottom of the window, which will preselect the current language (bundle) and display all automation features together.
Yes, I see the various macros and snippets for bundles in the gear menu, but the Insert Closing Tag macro (or whatever it is) doesn't seem to be there. So I don't understand why Insert Closing Tag is some special thing that belongs in the Automation menu by itself, and not in any bundle.
Trevor
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On Jan 8, 2006, at 7:00 PM, Timothy Bates wrote:
So, my guess is this is an inconsistency introduced by Allen in responding to people thinking "this is no good for html, i can't even close tags. So he is trying to expose some more "built-in" and obvious functionality.
But is the Insert Closing Tag function truly "built-in"? I don't know why it needs to be. Couldn't it be implemented as part of the HTML bundle?
But it is not rational, I agree. I guess the logical thing to do would be to break out all the functionality pertaining to the current scope (i.e, add the "gear" menu on the bottom of the automation menu)
That way the things you probably want (pertinent to your context) will be in the menu, and other stuff as accessible as ever. Trouble is that this would make the menu clumsy and highly visually confusing (changing often).
I don't think it's as bad as you make it out to be. All that's required is to move Insert Closing Tag from the Automation menu into the HTML bundle. That would be a simple change (interface-wise, at least) and would fix all the confusion.
Still, i agree that sticking close-tag on the end is not consistent: especially when "cmd-shift-<" and other common items are not there: makes you think you have seen all that is on offer.
Yes, that's exactly why I couldn't find it and had to ask here for help. It's a very confusing placement of the command.
Trevor
Trevor Harmon wrote:
But is the Insert Closing Tag function truly "built-in"? I don't know why it needs to be. Couldn't it be implemented as part of the HTML bundle?
Allan hardcoded the Insert Closing Tag command into TextMate and it can't easily be moved into a bundle. I think it will be sometime in the future, but it hasn't really been high on the priority list.
LaTeX already has a command like it in its bundle, so you could perhaps already cook something up and move it there yourself..
Jeroen.
On 09/01/2006, at 9:33, Trevor Harmon wrote:
But is the Insert Closing Tag function truly "built-in"? I don't know why it needs to be. Couldn't it be implemented as part of the HTML bundle?
I'm sure it could. We have one in LaTeX.
I don't think it's as bad as you make it out to be. All that's required is to move Insert Closing Tag from the Automation menu into the HTML bundle. That would be a simple change (interface- wise, at least) and would fix all the confusion.
Hardcoded, hence can't be moved. End of story :-).
-- Sune.
On Jan 9, 2006, at 3:09 AM, Sune Foldager wrote:
I don't think it's as bad as you make it out to be. All that's required is to move Insert Closing Tag from the Automation menu into the HTML bundle. That would be a simple change (interface- wise, at least) and would fix all the confusion.
Hardcoded, hence can't be moved. End of story :-).
But we were only talking about the interface. Timothy suggested adding bundle commands to the Automation menu and doing context- sensitive things, and I said all that stuff wouldn't be necessary. The only *user-interface* change needed is to move Insert Closing Tag to a bundle.
Trevor
Trevor Harmon wrote:
Hardcoded, hence can't be moved. End of story :-).
But we were only talking about the interface.
That doesn't solve this problem, but raises another one: it would become the only bundle item that can't be editted.
We need to write a new command that will duplicate the behavior, so that the hardcoded one can be retired.
Jeroen.
On Jan 9, 2006, at 1:13 PM, Jeroen van der Ham wrote:
That doesn't solve this problem, but raises another one: it would become the only bundle item that can't be editted.
As I said, I was talking ONLY about the interface. Rewriting the underlying implementation of Insert Closing Tag is a separate issue, and it would certainly have to be dealt with before changes to the interface can happen.
We need to write a new command that will duplicate the behavior, so that the hardcoded one can be retired.
Certainly, but that's not a user interface issue. Timothy, if I understand him correctly, was proposing to change the interface all around with context-sensitive menus, and that's what I was disputing: The only INTERFACE (not implementation) change necessary is to move Insert Closing Tag into a bundle.
Trevor
Certainly, but that's not a user interface issue. Timothy, if I understand him correctly, was proposing to change the interface all around with context-sensitive menus, and that's what I was disputing: The only INTERFACE (not implementation) change necessary is to move Insert Closing Tag into a bundle.
step up and write a command that behaves like the hardcoded "insert closing tag" in perl/python/erlang/brainf*ck, make a command out of it and put it into the HTML bundle. you can just have macros, snippets and commands in bundles, and "insert closing tag" at the moment is just black magic.
(or you could do it the silly way: insert into the html bundle a macro that just calls "Insert Closing Tag", a bit pointless if you ask me.)
On 9/1/2006, at 22:35, Trevor Harmon wrote:
We need to write a new command that will duplicate the behavior, so that the hardcoded one can be retired.
Certainly, but that's not a user interface issue. Timothy, if I understand him correctly, was proposing to change the interface all around with context-sensitive menus, and that's what I was disputing: The only INTERFACE (not implementation) change necessary is to move Insert Closing Tag into a bundle.
The Insert Closing Tag should indeed be re-implemented as a command and placed in the HTML/XML bundle, also because the current implementation fails for some of the mixing of HTML with embedded languages (PHP) that some users do (having it as a command would mean at least these users could modify it).
But currently it hasn't been a priority.
On 09/01/2006, at 4:00, Timothy Bates wrote:
So, my guess is this is an inconsistency introduced by Allen in responding to people thinking "this is no good for html, i can't even close tags. So he is trying to expose some more "built-in" and obvious functionality. But it is not rational, I agree. I guess the logical thing to do would be to break out all the functionality pertaining to the current scope (i.e, add the "gear" menu on the bottom of the automation menu)
This feature predates much of the other automation stuff, including the gear icon. I am sure we can all live with it for a while, and I am also sure Allan would prefer it not to be hardcoded as now :-p.
-- Sune.
On 09/01/2006, at 3:45, Trevor Harmon wrote:
I'm not seeing this in my installation of TextMate 1.5. I only see a single item ("Insert Closing Tag") under the Automation menu.
Like I already said 0:10 in this thread, this is a --hardcoded feature for HTML/XML--, thus it's not in a bundle. A similar feature exist for some other languages (such as LaTeX), in which case it resides in its bundle and overrides the key.
-- Sune.