From 8ffae59ce301ba77e470bf3ff415b97aef6e4e0a Mon Sep 17 00:00:00 2001
From: Hiroshi Saito <saidie@saidie.info>
Date: Wed, 23 Sep 2015 16:58:09 +0900
Subject: [PATCH] org-feed.el: Use a value of <link> as guid if <guid> is
 missing

* lisp/org-feed.el (org-feed-parse-rss-feed): Set a value of <link>
element to `:guid' property of an entry if <guid> element is missing.

If a RSS feed does not provide <guid> to entries, `:guid' property of an
entry is always `nil'. In such a case, new feed entries are no longer
added because the property is used to detect duplication.

TINYCHANGE
---
 lisp/org-feed.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/org-feed.el b/lisp/org-feed.el
index e511be0..7be803e 100644
--- a/lisp/org-feed.el
+++ b/lisp/org-feed.el
@@ -615,8 +615,10 @@ containing the properties `:guid' and `:item-full-text'."
 		       (match-beginning 0)))
 	(setq item (buffer-substring beg end)
 	      guid (if (string-match "<guid\\>.*?>\\(.*?\\)</guid>" item)
+		       (org-match-string-no-properties 1 item))
+	      link (if (string-match "<link\\>.*?>\\(.*?\\)</link>" item)
 		       (org-match-string-no-properties 1 item)))
-	(setq entry (list :guid guid :item-full-text item))
+	(setq entry (list :guid (or guid link) :item-full-text item))
 	(push entry entries)
 	(widen)
 	(goto-char end))
-- 
2.5.3

