Created
November 11, 2014 08:45
-
-
Save m-ueno/074229e5f62da819a9e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 保存の度に「、」「。」を「,」「.」に置換する | |
;; fork of: http://xr0038tech.hatenadiary.jp/entry/2014/05/06/182956 | |
(defun local-replace-all-punctuations () | |
"Replace all \"。\" with \".\"" | |
(interactive) | |
(when (derived-mode-p 'yatex-mode) | |
(save-excursion | |
(beginning-of-buffer) | |
(while (re-search-forward "。" nil t) | |
(replace-match ".") | |
(beginning-of-buffer) | |
(while (re-search-forward "、" nil t) | |
(replace-match ",")))))) | |
(add-hook 'before-save-hook 'local-replace-all-punctuations) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment