Function: gnus-parse-news-url

gnus-parse-news-url is a byte-compiled function defined in gnus-art.el.gz.

Signature

(gnus-parse-news-url URL)

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-art.el.gz
(defun gnus-parse-news-url (url)
  (let (scheme server port group message-id articles)
    (with-temp-buffer
      (insert url)
      (goto-char (point-min))
      (when (looking-at "\\([A-Za-z]+\\):")
	(setq scheme (match-string 1))
	(goto-char (match-end 0)))
      (when (looking-at "//\\([^:/]+\\)\\(:?\\)\\([0-9]+\\)?/")
	(setq server (match-string 1))
	(setq port (if (stringp (match-string 3))
		       (string-to-number (match-string 3))
		     (match-string 3)))
	(goto-char (match-end 0)))

      (cond
       ((looking-at "\\(.*@.*\\)")
	(setq message-id (match-string 1)))
       ((looking-at "\\([^/]+\\)/\\([-0-9]+\\)")
	(setq group (match-string 1)
	      articles (split-string (match-string 2) "-")))
       ((looking-at "\\([^/]+\\)/?")
	(setq group (match-string 1)))
       (t
	(error "Unknown news URL syntax"))))
    (list scheme server port group message-id articles)))