Re: [PATCH] Skip entries with no ID when updating ID locations
A note related to duplicate IDs, the messages only shows one of the duplicate, so it is not easy to know which one to change. This have implication when creating links to headline using their IDs. And does the current algorithm for finding duplicates check their reference through the "org db"? Regards, Roland. Bastien writes: > Hi Eric, > > Eric Abrahamsen writes: > >> 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. > > A welcome enhancement - applied, thanks! -- Luke, use the FOSS Sent from Emacs
Re: [PATCH] Skip entries with no ID when updating ID locations
Bastien writes: > Hi Eric, > > Eric Abrahamsen writes: > >> 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. > > A welcome enhancement - applied, thanks! Cool, thanks.
Re: [PATCH] Skip entries with no ID when updating ID locations
Hi Eric, Eric Abrahamsen writes: > 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. A welcome enhancement - applied, thanks! -- Bastien
[PATCH] Skip entries with no ID when updating ID locations
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 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