Function: nneething-request-article

nneething-request-article is a byte-compiled function defined in nneething.el.gz.

Signature

(nneething-request-article ID &optional GROUP SERVER BUFFER)

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/nneething.el.gz
(deffoo nneething-request-article (id &optional group _server buffer)
  (nneething-possibly-change-directory group)
  (let ((file (unless (stringp id)
		(nneething-file-name id)))
	(nntp-server-buffer (or buffer nntp-server-buffer)))
    (and (stringp file)		   ; We did not request by Message-ID.
	 (file-exists-p file)		; The file exists.
	 (not (file-directory-p file))	; It's not a dir.
	 (save-excursion
	   (let ((nnmail-file-coding-system 'raw-text))
	     (nnmail-find-file file))	; Insert the file in the nntp buf.
	   (unless (nnheader-article-p)	; Either it's a real article...
	     (let ((type
		    (unless (file-directory-p file)
		      (or (cdr (assoc (concat "." (file-name-extension file))
				      mailcap-mime-extensions))
			  "text/plain")))
		   (charset
		    (mm-detect-mime-charset-region (point-min) (point-max)))
		   (encoding))
	       (unless (string-match "\\`text/" type)
		 (base64-encode-region (point-min) (point-max))
		 (setq encoding "base64"))
	       (goto-char (point-min))
	       (nneething-make-head file (current-buffer)
				    nil type charset encoding))
	     (insert "\n"))
	   t))))