Selaa lähdekoodia

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.
Eric Abrahamsen 5 vuotta sitten
vanhempi
commit
6de5bcee87
1 muutettua tiedostoa jossa 5 lisäystä ja 4 poistoa
  1. 5 4
      lisp/org-id.el

+ 5 - 4
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