Function: gnus-copy-article-buffer
gnus-copy-article-buffer is an autoloaded and byte-compiled function
defined in gnus-msg.el.gz.
Signature
(gnus-copy-article-buffer &optional ARTICLE-BUFFER YANK-STRING)
Source Code
;; Defined in /usr/src/emacs/lisp/gnus/gnus-msg.el.gz
(defun gnus-copy-article-buffer (&optional article-buffer yank-string)
;; make a copy of the article buffer with all text properties removed
;; this copy is in the buffer gnus-article-copy.
;; if ARTICLE-BUFFER is nil, gnus-article-buffer is used
;; this buffer should be passed to all mail/news reply/post routines.
(setq gnus-article-copy (gnus-get-buffer-create " *gnus article copy*"))
(with-current-buffer gnus-article-copy
(mm-enable-multibyte))
(let ((article-buffer (or article-buffer gnus-article-buffer))
end beg)
(if (not (gnus-buffer-live-p article-buffer))
(error "Can't find any article buffer")
(with-current-buffer article-buffer
(let ((gnus-newsgroup-charset (or gnus-article-charset
gnus-newsgroup-charset))
(inhibit-read-only t)
(gnus-newsgroup-ignored-charsets
(or gnus-article-ignored-charsets
gnus-newsgroup-ignored-charsets)))
(save-restriction
;; Copy over the (displayed) article buffer, delete
;; hidden text and remove text properties.
(widen)
(copy-to-buffer gnus-article-copy (point-min) (point-max))
(set-buffer gnus-article-copy)
(when yank-string
(message-goto-body)
(delete-region (point) (point-max))
(insert yank-string))
(gnus-article-delete-text-of-type 'annotation)
(gnus-article-delete-text-of-type 'multipart)
(gnus-remove-text-with-property 'gnus-prev)
(gnus-remove-text-with-property 'gnus-next)
(gnus-remove-text-with-property 'gnus-decoration)
(insert
(prog1
(buffer-substring-no-properties (point-min) (point-max))
(erase-buffer)))
;; Find the original headers.
(set-buffer gnus-original-article-buffer)
(goto-char (point-min))
(while (looking-at message-unix-mail-delimiter)
(forward-line 1))
(let ((mail-header-separator ""))
(setq beg (point)
end (or (message-goto-body)
;; There may be just a header.
(point-max))))
;; Delete the headers from the displayed articles.
(set-buffer gnus-article-copy)
(let ((mail-header-separator ""))
(delete-region (goto-char (point-min))
(or (message-goto-body) (point-max))))
;; Insert the original article headers.
(insert-buffer-substring gnus-original-article-buffer beg end)
;; Decode charsets.
(let ((gnus-article-decode-hook
(delq 'article-decode-charset
(copy-sequence gnus-article-decode-hook)))
(rfc2047-quote-decoded-words-containing-tspecials t))
(run-hooks 'gnus-article-decode-hook)))))
gnus-article-copy)))