gnu-emacs-sources
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gds.el --- Emacs interface to Google Desktop Search


From: Francesco Potorti`
Subject: Re: gds.el --- Emacs interface to Google Desktop Search
Date: Sun, 12 Feb 2006 09:06:23 +0100

>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"))))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]