X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=fix-nonstandard-chars.el;h=2f558cbde30b50ceae325ac5ae4dd12142f6e755;hb=7df8a490816d54f7d87638bd4ec17f04f86d86ab;hp=52f42df6c2b8d565eb80d191604ef8932648bc2b;hpb=75b76032baa809cde05b5b54ea6611a15b1b840a;p=emacs.d.git diff --git a/fix-nonstandard-chars.el b/fix-nonstandard-chars.el index 52f42df..2f558cb 100644 --- a/fix-nonstandard-chars.el +++ b/fix-nonstandard-chars.el @@ -2,11 +2,19 @@ "Replace some typical nonstandard characters that result from copy-and-pasting word processor text into XHTML documents." - (interactive "P") + (interactive "p") - (replace-string "’" "'") - (replace-string "“" "“") - (replace-string "”" "”") - (replace-string "–" "-") - (replace-string "—" "—") + (setq replacements '( ("’" "'") + ("“" "“") + ("”" "”") + ("–" "-") + ("—" "—") + ("°" "°") )) + + (dolist (replacement replacements nil) + ;; The mark gets all fucked up here. It's easiest to + ;; just return to the beginning of the buffer each time. + (beginning-of-buffer) + (replace-string (nth 0 replacement) (nth 1 replacement)) + ) )