[XeTeX] Velthuis to Roman translit
François Patte
francois.patte at mi.parisdescartes.fr
Thu Feb 3 19:45:24 CET 2011
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Le 03/02/2011 19:01, Neal Delmonico a écrit :
> Yes. I am using Emacs. How does your system work? I already use the
> ,emacs file for shortcut keys. Adding more should not be a problem.
;;; programme permettant la tranformation d'un fichier codé selon le
;;; schéma Velthuis en en fichier unicode
(defun veltunic (start end)
(interactive "r")
(save-excursion
(save-restriction
(narrow-to-region start end)
(goto-char (point-min))
(replace-string ".n" "ṇ")
(goto-char (point-min))
(replace-string ".r" "ṛ")
(goto-char (point-min))
(replace-string ".R" "ṝ")
(goto-char (point-min))
(replace-string ".l" "ḷ")
(goto-char (point-min))
(replace-string ".L" "Ḹ")
(goto-char (point-min))
(replace-string "\"n" "ṅ")
(goto-char (point-min))
(replace-string "~n" "ñ")
(goto-char (point-min))
(replace-string ".t" "ṭ")
(goto-char (point-min))
(replace-string ".d" "ḍ")
(goto-char (point-min))
(replace-string "\"s" "ś")
(goto-char (point-min))
(replace-string ".s" "ṣ")
(goto-char (point-min))
(replace-string ".m" "ṃ")
(goto-char (point-min))
(replace-string ".h" "ḥ")
(goto-char (point-min))
(replace-string "aa" "ā")
(goto-char (point-min))
(replace-string "ii" "ī")
(goto-char (point-min))
(replace-string "uu" "ū")
(goto-char (point-min))
(replace-string ".a" " \'"))))
Put this in your .emacs file, then load a Velthuis coded file, select a
region (or the whole buffer) and press
M-X
type veltunic in the mini-buff <ENTER>
This translate the selected region into unicode characters.
You can call it as you wish: just change the name at the beginning:
defun veltunic
Or put any keyboard shortcut you wish:
(global-set-key [f7] 'veltunic)
for instance....
You can add new entries if I had forgotten some... beware of
parenthesis! lisp is crazy about them!
- --
François Patte
UFR de mathématiques et informatique
Université Paris Descartes
Tél. +33 (0)1 8394 5849
http://www.math-info.univ-paris5.fr/~patte
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iEYEARECAAYFAk1K98MACgkQdE6C2dhV2JUghgCg0pJqHRZ0T9yUkLbatvpTWSVF
SmEAn13L6RCzPGSEnZk9lW+bmab/obV3
=lTK2
-----END PGP SIGNATURE-----
More information about the XeTeX
mailing list