Skip to content

Instantly share code, notes, and snippets.

@handlename
Created February 5, 2011 21:39
Show Gist options
  • Save handlename/812818 to your computer and use it in GitHub Desktop.
Save handlename/812818 to your computer and use it in GitHub Desktop.
replace katakana characters with hankaku katakana characters.
(defun ktai-hankaku-katakana-region (start end)
(interactive "r")
(while (string-match
"[0-9A-Za-zァ-ンー:;$]+\\|[!?][!?]+"
(buffer-substring start end))
(save-excursion
(japanese-hankaku-region
(+ start (match-beginning 0))
(+ start (match-end 0))
))))
(defun ktai-hankaku-katakana-buffer ()
(interactive)
(ktai-hankaku-katakana-region (point-min) (point-max)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment