hi,
you can save some typing by using an alist. Here is what i use to
convert
accented-letters into html and back.
(defun accent-html (prefix)
"Accented letter translation é -> é.
With an argument, reverse é <- é.
Works on the whole buffer"
(interactive "P")
(save-excursion
(let ((association
'(("É" . "É") ("á" . "á") ("à" . "à")
("â" . "â") ("ä" . "ä") (""" . "ã")
("é" . "é") ("è" . "è") ("ê" . "ê")
("ë" . "ë") ("í" . "í") ("ì" . "ì")
("î" . "î") ("ï" . "ï") ("ñ" . "ñ")
("ó" . "ó") ("ò" . "ò") ("ô" . "ô")
("ö" . "ö") ("ı" . "õ") ("ú" .
"ú")
("ù" . "ù") ("û" . "û") ("ü" . "ü")
("ç" . "ç")))
(case-fold-search nil))
(dolist (paire association)
(when prefix
(setq paire (cons (cdr paire) (car paire))))
(goto-char (point-min))
(while (search-forward (car paire) nil t)
(replace-match (cdr paire) nil t))))))