Function: rmail-decode-region

rmail-decode-region is a byte-compiled function defined in rmail.el.gz.

Signature

(rmail-decode-region FROM TO CODING &optional DESTINATION)

Source Code

;; Defined in /usr/src/emacs/lisp/mail/rmail.el.gz
;; Decode the region specified by FROM and TO by CODING.
;; If CODING is nil or an invalid coding system, decode by `undecided'.
(defun rmail-decode-region (from to coding &optional destination)
  (if (or (not coding) (not (coding-system-p coding)))
      (setq coding 'undecided))
  ;; Use -dos decoding, to remove ^M characters left from base64 or
  ;; rogue qp-encoded text.
  (decode-coding-region
   from to (coding-system-change-eol-conversion coding 1) destination)
  ;; Don't reveal the fact we used -dos decoding, as users generally
  ;; will not expect the RMAIL buffer to use DOS EOL format.
  (cond
   ((null destination)
    (setq buffer-file-coding-system
	  (setq last-coding-system-used
		(coding-system-change-eol-conversion coding 0))))
   ((bufferp destination)
    (with-current-buffer destination
      (setq buffer-file-coding-system
	    (setq last-coding-system-used
		  (coding-system-change-eol-conversion coding 0)))))))