From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: [PATCH] Skip entries with no ID when updating ID locations Date: Wed, 19 Feb 2020 13:26:38 -0800 Message-ID: <87r1yqb75d.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:57617) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4Wrr-0006De-Bt for emacs-orgmode@gnu.org; Wed, 19 Feb 2020 16:26:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j4Wrq-0002WQ-9c for emacs-orgmode@gnu.org; Wed, 19 Feb 2020 16:26:51 -0500 Received: from ciao.gmane.io ([159.69.161.202]:40474) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j4Wrq-0002VC-24 for emacs-orgmode@gnu.org; Wed, 19 Feb 2020 16:26:50 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1j4Wrm-0009bY-2p for emacs-orgmode@gnu.org; Wed, 19 Feb 2020 22:26:46 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Skip-entries-with-no-ID-when-updating-ID-locations.patch >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 --=-=-=--