]> gitweb.michael.orlitzky.com - emacs.d.git/blob - fix-nonstandard-chars.el
Autoload octave-mode for *.m files.
[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 ("®" "®")
15 ("™" "™")
16 )
17 )
18
19 (dolist (replacement replacements nil)
20 ;; The mark gets all fucked up here. It's easiest to
21 ;; just return to the beginning of the buffer each time.
22 (beginning-of-buffer)
23 (replace-string (nth 0 replacement) (nth 1 replacement))
24 )
25 )