Make the "dumbquotes" translation work again.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Mon, 18 Oct 2010 18:31:55 +0000 (20:31 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Mon, 18 Oct 2010 18:31:55 +0000 (20:31 +0200)
lisp/ChangeLog
lisp/gnus-art.el

index 0e9fad3..f151d29 100644 (file)
@@ -1,3 +1,9 @@
+2010-10-18  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * gnus-art.el (gnus-article-dumbquotes-map): Make into a char/string
+       alist, so that we can look for non-Unicode chars.
+       (article-translate-strings): Allow both character and string maps.
+
 2010-10-18  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * shr.el (shr-insert): Don't insert space behind a wide character
 2010-10-18  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * shr.el (shr-insert): Don't insert space behind a wide character
index 3241106..20ba0b3 100644 (file)
@@ -916,25 +916,25 @@ image type in XEmacs if it is built with the libcompface library."
   "Function used to decode addresses.")
 
 (defvar gnus-article-dumbquotes-map
   "Function used to decode addresses.")
 
 (defvar gnus-article-dumbquotes-map
-  '(("\200" "EUR")
-    ("\202" ",")
-    ("\203" "f")
-    ("\204" ",,")
-    ("\205" "...")
-    ("\213" "<")
-    ("\214" "OE")
-    ("\221" "`")
-    ("\222" "'")
-    ("\223" "``")
-    ("\224" "\"")
-    ("\225" "*")
-    ("\226" "-")
-    ("\227" "--")
-    ("\230" "~")
-    ("\231" "(TM)")
-    ("\233" ">")
-    ("\234" "oe")
-    ("\264" "'"))
+  '((?\200 "EUR")
+    (?\202 ",")
+    (?\203 "f")
+    (?\204 ",,")
+    (?\205 "...")
+    (?\213 "<")
+    (?\214 "OE")
+    (?\221 "`")
+    (?\222 "'")
+    (?\223 "``")
+    (?\224 "\"")
+    (?\225 "*")
+    (?\226 "-")
+    (?\227 "--")
+    (?\230 "~")
+    (?\231 "(TM)")
+    (?\233 ">")
+    (?\234 "oe")
+    (?\264 "'"))
   "Table for MS-to-Latin1 translation.")
 
 (defcustom gnus-ignored-mime-types nil
   "Table for MS-to-Latin1 translation.")
 
 (defcustom gnus-ignored-mime-types nil
@@ -2138,9 +2138,18 @@ MAP is an alist where the elements are on the form (\"from\" \"to\")."
     (when (article-goto-body)
       (let ((inhibit-read-only t))
        (dolist (elem map)
     (when (article-goto-body)
       (let ((inhibit-read-only t))
        (dolist (elem map)
-         (save-excursion
-           (while (search-forward (car elem) nil t)
-             (replace-match (cadr elem)))))))))
+         (let ((from (car elem))
+               (to (cadr elem)))
+           (save-excursion
+             (if (stringp from)
+                 (while (search-forward from nil t)
+                   (replace-match to))
+               (while (not (eobp))
+                 (if (eq (following-char) from)
+                     (progn
+                       (delete-char 1)
+                       (insert to))
+                   (forward-char 1)))))))))))
 
 (defun article-treat-overstrike ()
   "Translate overstrikes into bold text."
 
 (defun article-treat-overstrike ()
   "Translate overstrikes into bold text."