[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SDCV and indian diacritics
From: |
Rustom Mody |
Subject: |
Re: SDCV and indian diacritics |
Date: |
Sun, 6 Oct 2013 08:24:46 -0700 (PDT) |
User-agent: |
G2/1.0 |
On Sunday, October 6, 2013 5:47:05 PM UTC+5:30, Rustom Mody wrote:
>
> I could pass on that code to you. [Not on that machine now]
Heres the code
To use:
0. Load this code
1. Visit a file (cant be a file-less buffer) that has ITrans devanagari
2. Press f4
(should open a new frame having the devanagari)
Notes:
1. You can keep pressing f4 to check the two views are in sync
2. If your diacritics are done by an emacs input method, then all you have to
do is replace the defvar input-method by whatever you are using.
Of course if you are using something at OS or h/w level (like a different
keyboard) then sorry you are not in luck (for this method)
----------------------------
(defvar input-method "devanagari-itrans")
(defun rpm-apply-input-method () ; buffer version
(interactive)
(let* ((inp (buffer-substring-no-properties (point-min)(point-max)))
(filename (file-name-nondirectory (buffer-file-name)))
(out-buf-name (concat (file-name-sans-extension filename)
"-hi" (file-name-extension filename t)))
(p))
(switch-to-buffer-other-frame out-buf-name)
(save-excursion
(save-window-excursion
(setq p (point))
(erase-buffer)
(setq buffer-file-coding-system 'utf-8)
(set-input-method input-method t)
(execute-kbd-macro inp)
))
(goto-char p)
(other-frame 1)
))
(global-set-key [f4] 'rpm-apply-input-method)