From: Peter Graves <peter@ar...> - 2004-04-22 19:49:08
This morning's development snapshot (j 0.20.2.11, ABCL 0.0.3.9) is up:
http://armedbear.org/j-jar.zip (just j.jar)
Feature request 935531 (from Pete Kirkham):
In addition to the command
which then shows a dialog which requires the user to
enter the tag name, for fast editing of XML and HTML it
would be useful to have a command
so that insertion of a tag can be mapped to a single
This requires a single line inserted into CommandTable
and a method in HtmlMode that is a cut down version of
the htmlInsertTag one.
This is a great suggestion, and I've implemented it in the current
snapshot, albeit a tad differently: you don't really need the new
Instead, the commands htmlInsertTag and xmlInsertTag have been extended
to take an optional string argument, which is the tag to be inserted.
So you can now put a line like this in ~/.j/init.lisp (or
(map-key-for-mode "Alt F11" "htmlInsertTag a " "Html")
And henceforth, in HTML mode, Alt F11 will insert the specified tag (in
this case "a").
Note the space after the 'a' (and before the closing quote of the
If the argument to htmlInsertTag ends with a space, as shown, the
assumption is that you plan to type something else after the space,
depending on the context, so the caret is placed after the space and
before the closing '>' of the start tag.
If, on the other hand, the argument doesn't end with a space, the
assumption is that you won't be adding text there, so the caret is left
(generally speaking) wherever it was before you did htmlInsertTag.
(I say "generally speaking" because this won't be the case if a region
is selected when you do htmlInsertTag, since the region will end up
being deselected, but close enough.)
Now that I'm writing this up, I realize that maybe it would make sense
to have the same caret behavior if the argument to htmlInsertTag ends
with '"' or even with '/', so you could do something like:
(map-key-for-mode "Alt F11" "htmlInsertTag a href=\"http://"; "Html")
and the caret would end up after "http://";, where it obviously belongs.
But that isn't implemented in this snapshot... (Is this a good idea?)
All of the above should also apply to xmlInsertTag.
Please let me know if you discover any anomalies with this new feature,
or if you have any suggestions for further improvement.
This snapshot also contains Pete's XML mode indentation fix, mentioned
in my message earlier this morning.
Thanks for your support.