As an ArgoUML contributor I'm going to blog my activities here, so that they may draw interest by other developers or help other developers when doing tasks similar to what I've done. AND(!) the grand vision that makes an Argonaut what he is, TO THRIVE IN THE BIG DANGEROUS WORLD, TAKING THE Argo TO A GOOD SHORE ;-))

Thursday, December 16, 2010

Improve Emacs HTML mode by adding an automatic translator between accented chars and their HTML / Unicode entities

I would like to improve Emacs HTML mode so that when I enter an accented character it would replace it with the corresponding HTML Unicode entity. I don't know if this would have to be some kind of hook which captures the entrance of specific characters or if I could implement if as a gigantic search and replace operation. The later option isn't so attractive because it gets into the flow of writing. But the former would also...

Currently Emacs HTML mode provides the sgml-name-char (C-c C-n) command that almost enables the same thing, but, it gets a bit in the way of my flow of thought. (Actually, writing directly in HTML also gets in my thought process anyway... Maybe I should write first and then edit. But I digress...)

So, how could this be implemented? A way would be a minor mode for HTML for automatic translation which mainly defines a minor mode key map that overrides the global and major mode keymaps for accented characters and invalid HTML characters. Is this an interesting idea?

How to implement an Emacs minor mode? A good example is flyspell-mode, which source is available just C-h f flyspell-mode and following the link to the source.

No comments:

Reader Shared items