>The article seemed quite clear on how Google Desktop Search threatens
>the user's privacy.
Well, I think that this is not the point, but only now do I realize
that we are completely off topic!
So here is my snippet of code, usful mostly for Italians, but adaptable
for other people needing to convert to and from accented letters.
(defun do-accent (subst-list)
(dolist (pair subst-list)
(save-excursion
(while (re-search-forward (car pair) nil t)
(replace-match (cdr pair) t)))))
(defun accent-en-ascii ()
(interactive)
(do-accent '(("a`" . "\340") ("e`" . "\350") ("e'" . "\351")
("E`" . "\310") ("i`" . "\354")
("o`" . "\362") ("u`" . "\371")
("ch\350\\>" . "ch\351") ("\\<n\350\\>" . "n\351"))))
(defun accent-en-ascii-reverse ()
(interactive)
(do-accent '(("a'" . "\340") ("e'" . "\350")
("E'" . "\310") ("i'" . "\354")
("o'" . "\362") ("u'" . "\371")
("\\<ch\350\\>" . "ch\351") ("\\<n\350\\>" . "n\351"))))
(defun accent-de-ascii ()
(interactive)
(do-accent '(("\340" . "a`") ("\350" . "e`")
("\310" . "E`") ("\351" . "e`")
("\354" . "i`") ("\362" . "o`")
("\371" . "u`"))))
(defun accent-en-utf8 ()
(interactive)
(do-accent '(("\303\240" . "\340") ("\303\250" . "\350")
("\303\210" . "\310") ("\303\254" . "\354")
("\303\262" . "\362") ("\303\271" . "\371"))))
(defun accent-en-windows ()
(interactive)
(do-accent '(("\205" . "..") ("\226" . "--") ("\200" . "\244")
("\221" . "`") ("\222" . "'")
("\223" . "\"") ("\224" . "\""))))
(defun accent-en-mistery ()
(interactive)
(do-accent '(("àÜܨÜî¿ÜÜ©" . "\340") ("èÜܨÜî¿ÜÜ©" .
"\350")
("ìÜܨÜî¿ÜÜ©" . "\354") ("òÜܨÜî¿ÜÜ©" .
"\362")
("éÜܨÜî¿ÜÜ©" . "\351") ("»ÜܨÜî¿ÜÜ©" . "»")
("ÜÜ«ÜܨÜî¿ÜÜ©" . "«") ("ùÜܨÜî¿ÜÜ©" .
"\371"))))
_______________________________________________
Gnu-emacs-sources mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources