When I was watching Emacs Rocks, there was a feature showed, called sgml-close-tag
.
You can see an example here.
When called that command, he will close the tag for you if there is a tag missing. I bounded it to C-l
and was hooked with it.
Then I was wondering if I could apply this with another languages.
For example, like in PHP, you have the following
public function Foobar(){
echo "Foobar
I will get a syntax error, there is a double quote ("
) missing in order to close the string "Foobar", then a semicolon (;
) to end the line, and then a bracket (}
) to close the function Foobar.
I was wondering if I could develop the same functionality as in the screencast above, that you need to press only one key and he will close the syntax accordingly. Would be totally awesome and an immense productivity boost.
So I'm wondering if I could be able to develop a package with this feature. I couldn't figure out to which functions I need to look. Could anyone gives me a push in the right direction, or do another suggestion?
UPDATE: this issue got solved by Andreas: https://github.com/emacs-berlin/general-close