Function: nntp-decode-text

nntp-decode-text is a byte-compiled function defined in nntp.el.gz.

Signature

(nntp-decode-text &optional CR-ONLY)

Documentation

Decode the text in the current buffer.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/nntp.el.gz
(defun nntp-decode-text (&optional cr-only)
  "Decode the text in the current buffer."
  (goto-char (point-min))
  (while (search-forward "\r" nil t)
    (delete-char -1))
  (unless cr-only
    ;; Remove trailing ".\n" end-of-transfer marker.
    (goto-char (point-max))
    (forward-line -1)
    (when (looking-at ".\n")
      (delete-char 2))
    ;; Delete status line.
    (goto-char (point-min))
    (while (looking-at "[1-5][0-9][0-9] .*\n")
      ;; For some unknown reason, there is more than one status line.
      (delete-region (point) (progn (forward-line 1) (point))))
    ;; Remove "." -> ".." encoding.
    (while (search-forward "\n.." nil t)
      (delete-char -1))))