Hi all,

Would the attached patch be acceptable? It's no big deal, just skips
entries with no ID property when updating all ID locations. I couldn't
figure out why I had several thousand "Duplicate ID "nil"" warnings in
the *Messages* buffer after updating ID locations.

Thanks,
Eric

>From d3262aafe1afef3875de83ff46096d54c5c086fe Mon Sep 17 00:00:00 2001
From: Eric Abrahamsen <e...@ericabrahamsen.net>
Date: Wed, 19 Feb 2020 13:23:40 -0800
Subject: [PATCH] Skip entries with no ID when updating ID locations

* lisp/org-id.el (org-id-update-id-locations): Saves a little chatter
about duplicate "nil" IDs.
---
 lisp/org-id.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/org-id.el b/lisp/org-id.el
index 91142917a..369b494ab 100644
--- a/lisp/org-id.el
+++ b/lisp/org-id.el
@@ -503,10 +503,11 @@ When FILES is given, scan also these files."
                        i nfiles file))
 	    (when (file-exists-p file)
 	      (insert-file-contents file nil nil nil 'replace)
-	      (setq ids (org-map-entries
-			 (lambda ()
-			   (org-entry-get (point) "ID"))
-			 "ID<>\"\""))
+	      (setq ids (delq nil
+			      (org-map-entries
+			       (lambda ()
+				 (org-entry-get (point) "ID"))
+			       "ID<>\"\"")))
 	      (dolist (id ids)
 		(if (member id seen-ids)
 		    (progn
-- 
2.25.1

Reply via email to