X-Git-Url: http://cgit.sxemacs.org/?p=gnus;a=blobdiff_plain;f=lisp%2Fgnus-art.el;h=0e354dc84f34e67634c6eb75861f3ebc48aeba5f;hp=97e8ccc1e86d7936b768367b3e19a81848914943;hb=8ef4156a0cf1c997e99aed34d0e5a606b61af4e5;hpb=18beec17cd7896a3e747e253f4fc704f4494232d diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 97e8ccc1e..0e354dc84 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -2114,6 +2114,27 @@ try this wash." (interactive) (article-translate-strings gnus-article-dumbquotes-map)) +(defun article-treat-non-ascii () + "Translate many Unicode characters into their ASCII equivalents." + (interactive) + (require 'org-entities) + (let ((table (make-char-table nil))) + (dolist (elem org-entities) + (when (and (listp elem) + (= (length (nth 6 elem)) 1)) + (set-char-table-range table + (aref (nth 6 elem) 0) + (nth 4 elem)))) + (save-excursion + (when (article-goto-body) + (let ((inhibit-read-only t) + replace) + (while (not (eobp)) + (if (not (setq replace (aref table (following-char)))) + (forward-char 1) + (delete-char 1) + (insert replace)))))))) + (defun article-translate-characters (from to) "Translate all characters in the body of the article according to FROM and TO. FROM is a string of characters to translate from; to is a string of @@ -4248,6 +4269,7 @@ If variable `gnus-use-long-file-name' is non-nil, it is article-date-lapsed article-emphasize article-treat-dumbquotes + article-treat-non-ascii article-normalize-headers ;;(article-show-all . gnus-article-show-all-headers) )))