Function: nnml-request-article

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

Signature

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

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/nnml.el.gz
(deffoo nnml-request-article (id &optional group server buffer)
  (nnml-possibly-change-directory group server)
  (let* ((nntp-server-buffer (or buffer nntp-server-buffer))
	 (file-name-coding-system nnmail-pathname-coding-system)
	 path gpath group-num)
    (if (stringp id)
	(when (and (setq group-num (nnml-find-group-number id server))
		   (cdr
		    (assq (cdr group-num)
			  (nnheader-article-to-file-alist
			   (setq gpath (nnml-group-pathname (car group-num)
							    nil server))))))
	  (nnml-update-file-alist)
	  (setq path (concat gpath (if nnml-use-compressed-files
				       (cdr (assq (cdr group-num)
						  nnml-article-file-alist))
				     (number-to-string (cdr group-num))))))
      (setq path (nnml-article-to-file id)))
    (cond
     ((not path)
      (nnheader-report 'nnml "No such article: %s" id))
     ((not (file-exists-p path))
      (nnheader-report 'nnml "No such file: %s" path))
     ((file-directory-p path)
      (nnheader-report 'nnml "File is a directory: %s" path))
     ((not (save-excursion (let ((nnmail-file-coding-system
				  nnml-file-coding-system))
			     (nnmail-find-file path))))
      (nnheader-report 'nnml "Couldn't read file: %s" path))
     (t
      (nnheader-report 'nnml "Article %s retrieved" id)
      ;; We return the article number.
      (cons (if group-num (car group-num) group)
	    (string-to-number (file-name-nondirectory path)))))))