Function: nnrss-order-hrefs
nnrss-order-hrefs is a byte-compiled function defined in nnrss.el.gz.
Signature
(nnrss-order-hrefs BASE-URI HREFS)
Documentation
Given a list of hrefs, sort them using the following priorities:
1. links ending in .rss
2. links ending in .rdf
3. links ending in .xml
4. links containing the above
5. offsite links
BASE-URI is used to determine the location of the links and
whether they are offsite or onsite.
Source Code
;; Defined in /usr/src/emacs/lisp/gnus/nnrss.el.gz
(defun nnrss-order-hrefs (base-uri hrefs)
"Given a list of hrefs, sort them using the following priorities:
1. links ending in .rss
2. links ending in .rdf
3. links ending in .xml
4. links containing the above
5. offsite links
BASE-URI is used to determine the location of the links and
whether they are `offsite' or `onsite'."
(let (rss-onsite-end rdf-onsite-end xml-onsite-end
rss-onsite-in rdf-onsite-in xml-onsite-in
rss-offsite-end rdf-offsite-end xml-offsite-end
rss-offsite-in rdf-offsite-in xml-offsite-in)
(dolist (href hrefs)
(cond ((null href))
((string-match "\\.rss$" href)
(nnrss-match-macro
base-uri href rss-onsite-end rss-offsite-end))
((string-match "\\.rdf$" href)
(nnrss-match-macro
base-uri href rdf-onsite-end rdf-offsite-end))
((string-match "\\.xml$" href)
(nnrss-match-macro
base-uri href xml-onsite-end xml-offsite-end))
((string-match "rss" href)
(nnrss-match-macro
base-uri href rss-onsite-in rss-offsite-in))
((string-match "rdf" href)
(nnrss-match-macro
base-uri href rdf-onsite-in rdf-offsite-in))
((string-match "xml" href)
(nnrss-match-macro
base-uri href xml-onsite-in xml-offsite-in))))
(append
rss-onsite-end rdf-onsite-end xml-onsite-end
rss-onsite-in rdf-onsite-in xml-onsite-in
rss-offsite-end rdf-offsite-end xml-offsite-end
rss-offsite-in rdf-offsite-in xml-offsite-in)))