On Wed, 2011-05-11 at 06:21 +0000, Vijay Kumar B. wrote:
> Add the following code (simple and not so accurate code) to your
> ~/.emacs file,
> and restart emacs. Open up a Python module, move the cursor to a
> string and
> press C-c t.
> 
> ------
> (defun py-mark-trans ()
>   (interactive)
>   (save-excursion
>     (search-backward "\"")
>     (insert "_(")
>     (search-forward "\"")
>     (search-forward "\"")
>     (insert ")")))
> 
> (defun my-python-hook ()
>         (define-key python-mode-map [?\C-c?t] 'py-mark-trans))
> 
> (add-hook 'python-mode-hook 'my-python-hook) 

thanks - works well, but one more thing - sometimes the strings are
marked with '' and not "" - how to handle this case?
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc

Reply via email to