Function: newsticker--cache-contains
newsticker--cache-contains is a byte-compiled function defined in
newst-backend.el.gz.
Signature
(newsticker--cache-contains DATA FEED TITLE DESC LINK AGE &optional GUID)
Documentation
Check DATA whether FEED contains an item with the given properties.
This function returns the contained item or nil if it is not contained. The properties which are checked are TITLE, DESC, LINK, AGE, and GUID. In general all properties must match in order to return a certain item, except for the following cases.
If AGE equals feed the TITLE, DESCription and LINK do not
matter. If DESC is nil it is ignored as well. If
newsticker-desc-comp-max is non-nil, only the first
newsticker-desc-comp-max characters of DESC are taken into
account.
If GUID is non-nil it is sufficient to match this value, and the other properties are ignored.
Source Code
;; Defined in /usr/src/emacs/lisp/net/newst-backend.el.gz
(defun newsticker--cache-contains (data feed title desc link _age
&optional guid)
"Check DATA whether FEED contains an item with the given properties.
This function returns the contained item or nil if it is not
contained.
The properties which are checked are TITLE, DESC, LINK, AGE, and
GUID. In general all properties must match in order to return a
certain item, except for the following cases.
If AGE equals `feed' the TITLE, DESCription and LINK do not
matter. If DESC is nil it is ignored as well. If
`newsticker-desc-comp-max' is non-nil, only the first
`newsticker-desc-comp-max' characters of DESC are taken into
account.
If GUID is non-nil it is sufficient to match this value, and the
other properties are ignored."
;;(newsticker--debug-msg "Looking for %s guid=%s" title guid)
(condition-case nil
(catch 'found
(when (and desc newsticker-desc-comp-max
(> (length desc) newsticker-desc-comp-max))
(setq desc (substring desc 0 newsticker-desc-comp-max)))
(mapc
(lambda (this-feed)
(when (eq (car this-feed) feed)
(mapc (lambda (anitem)
(when (cond (guid
;; global unique id can match
(string= guid (newsticker--guid anitem)))
(t;;FIXME?
(or
;; or title, desc, etc.
(and
;;(or (not (eq age 'feed))
;; (eq (newsticker--age anitem) 'feed))
(string= (newsticker--title anitem)
title)
(or (not link)
(string= (newsticker--link anitem)
link))
(or (not desc)
(if (and desc newsticker-desc-comp-max
(> (length (newsticker--desc
anitem))
newsticker-desc-comp-max))
(string= (substring
(newsticker--desc anitem)
0
newsticker-desc-comp-max)
desc)
(string= (newsticker--desc anitem)
desc)))))))
;;(newsticker--debug-msg "Found %s guid=%s"
;; (newsticker--title anitem)
;; (newsticker--guid anitem))
(throw 'found anitem)))
(cdr this-feed))))
data)
;;(newsticker--debug-msg "Found nothing")
nil)
(error nil)))