Skip to content

Instantly share code, notes, and snippets.

@m-ueno
Created December 14, 2012 02:57
Show Gist options
  • Save m-ueno/4282268 to your computer and use it in GitHub Desktop.
Save m-ueno/4282268 to your computer and use it in GitHub Desktop.
(defun replace-regexp-in-file (regexp to-str)
(save-excursion
(goto-char (point-min))
(while (re-search-forward regexp nil t) ;; idiom
(replace-match to-str)))
"replace done")
(defun replace-japanese-periods-and-commas ()
(interactive)
(mapcar (lambda (pair)
(replace-regexp-in-file (car pair) (cadr pair)))
'(("。" ".") ("、" ",")))
"replaced japanese periods and commas")
;; (gdefkey "C-c C-s" 'replace-japanese-periods-and-commas)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment