]> gitweb.michael.orlitzky.com - emacs.d.git/blob - fix-nonstandard-chars.el
Remove the dired mode-hook; it turned out to be annoying.
[emacs.d.git] / fix-nonstandard-chars.el
1 (defun fix-nonstandard-chars (context)
2 "Replace some typical nonstandard characters that result from
3 copy-and-pasting word processor text into XHTML documents."
4
5 (interactive "p")
6
7 (setq replacements '( ("’" "'")
8 ("“" "“")
9 ("”" "”")
10 ("–" "-")
11 ("—" "—")
12 ("°" "°") ))
13
14 (dolist (replacement replacements nil)
15 ;; The mark gets all fucked up here. It's easiest to
16 ;; just return to the beginning of the buffer each time.
17 (beginning-of-buffer)
18 (replace-string (nth 0 replacement) (nth 1 replacement))
19 )
20 )