Function: article-treat-non-ascii

article-treat-non-ascii is an interactive and byte-compiled function defined in gnus-art.el.gz.

Signature

(article-treat-non-ascii)

Documentation

Translate many Unicode characters into their ASCII equivalents.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-art.el.gz
(defun article-treat-non-ascii ()
  "Translate many Unicode characters into their ASCII equivalents."
  (interactive nil gnus-article-mode)
  (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 props)
	  (while (not (eobp))
	    (if (not (setq replace (aref table (following-char))))
		(forward-char 1)
	      (if (prog1
		      (setq props (text-properties-at (point)))
		    (delete-char 1))
		  (add-text-properties (point) (progn (insert replace) (point))
				       props)
		(insert replace)))))))))