]> gitweb.michael.orlitzky.com - emacs.d.git/commitdiff
Added a new function, fix-nonstandard-chars.
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 2 Feb 2010 20:30:45 +0000 (15:30 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Tue, 2 Feb 2010 20:30:45 +0000 (15:30 -0500)
.emacs
fix-nonstandard-chars.el [new file with mode: 0644]

diff --git a/.emacs b/.emacs
index 87d2eb905bc4a2f7751a5f9fa06a55c35054e0b0..4732256f31692726080c24d0cb7e6f76bc5c649a 100644 (file)
--- a/.emacs
+++ b/.emacs
@@ -76,6 +76,8 @@
 (load-library "diff-buffer-against-file")
 (global-set-key "\C-cd" 'diff-buffer-against-file)
 
+(load-library "fix-nonstandard-chars")
+
 
 ;; These next functions override the defaults provided by emacs. They
 ;; prevent warning messages related to file modification times,
diff --git a/fix-nonstandard-chars.el b/fix-nonstandard-chars.el
new file mode 100644 (file)
index 0000000..e5c3464
--- /dev/null
@@ -0,0 +1,9 @@
+(defun fix-nonstandard-chars
+  "Replace some typical nonstandard characters that result from
+   copy-and-pasting word processor text into XHTML documents."
+
+  (replace-string "’" "'")
+  (replace-string "“" "&ldquo;")
+  (replace-string "”" "&rdquo;")
+  (replace-string "–" "-")
+)