Compatibility: define sha1-string for Emacs 22.

This commit is contained in:
Carsten Dominik 2009-04-08 08:54:31 +02:00
parent 627eaa32e6
commit e083a14086
2 changed files with 9 additions and 3 deletions

View File

@ -319,7 +319,12 @@ that can be added."
(setq n (1- n)))
n))
(defun org-sha1-string (s &optional binary)
(if (fboundp 'sha1-string)
(sha1-string s binary)
(with-temp-buffer
(insert s)
(sha1-region (point-min) (point-max) binary))))
(provide 'org-compat)

View File

@ -306,7 +306,8 @@ it can be a list structured like an entry in `org-feed-alist'."
(push e new)
(setq olds (nth 2 (assoc (plist-get e :guid) old-status)))
(if (and olds
(not (string= (sha1-string (plist-get e :item-full-text))
(not (string= (org-sha1-string
(plist-get e :item-full-text))
olds)))
(push e changed))))
@ -339,7 +340,7 @@ it can be a list structured like an entry in `org-feed-alist'."
;; or if they were handled previously
(if (assoc guid guid-alist) t (plist-get e :handled))
;; A hash, to detect changes
(sha1-string (plist-get e :item-full-text))))
(org-sha1-string (plist-get e :item-full-text))))
entries))
;; Handle new items in the feed