From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id KLQOCx6dxWBAIgAAgWs5BA (envelope-from ) for ; Sun, 13 Jun 2021 07:52:30 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id aPC5Bh6dxWApEwAAbx9fmQ (envelope-from ) for ; Sun, 13 Jun 2021 05:52:30 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 99E7112A58 for ; Sun, 13 Jun 2021 07:52:29 +0200 (CEST) Received: from localhost ([::1]:50688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lsJ2q-00082b-KC for larch@yhetil.org; Sun, 13 Jun 2021 01:52:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsJ20-00082L-SI for emacs-orgmode@gnu.org; Sun, 13 Jun 2021 01:51:36 -0400 Received: from smtp04-ext3.udag.de ([62.146.106.41]:59482) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsJ1z-0000Yi-0V for emacs-orgmode@gnu.org; Sun, 13 Jun 2021 01:51:36 -0400 Received: from [192.168.8.105] (ip5f5bde14.dynamic.kabel-deutschland.de [95.91.222.20]) by smtp04-ext3.udag.de (Postfix) with ESMTPA id C0294E01A5 for ; Sun, 13 Jun 2021 07:51:32 +0200 (CEST) Subject: Re: [PATCH] choices in org-id-find for handling missing ids From: Marc Ihm To: "emacs-orgmode@gnu.org" References: <1607921150.924467.1623507388932@www.ud-mail.de> Message-ID: <518afd8c-c1e3-3250-6d84-92f46d1d4a2b@ihm.name> Date: Sun, 13 Jun 2021 07:51:31 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <1607921150.924467.1623507388932@www.ud-mail.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: none client-ip=62.146.106.41; envelope-from=marc@ihm.name; helo=smtp04-ext3.udag.de X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1623563549; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=aYhyvl0njooSCCu85+iUvyjltX0SpxPcrVXaV8moBbo=; b=cHZWjwxHJl4eNGQhmP8xm6+Lk038Z+5+SVUL199mebDJr5bn1T6p2xpHKudTERu8SCB1ve 8wXnAzCTuuG2jvzf3mylxqys5iXqqQ425F/ZRPcDOiXYvyg2kDquYG7UWUS7pRsvGKro1e 3a3aqNTXw2R4Q0yHNvRDlsII6GfMcBNXGo3aSwhA8tjwe/47xTqEA+0lbf4qmIEv7eIkX1 a/u+uPDAiCsjt/TzPwBW36gTGRwRSZtQCUUrqrZvNHDQIyciz1ZQbBKTGnBhEFtqV6HqsT 7orYhNuxpb0viSx1facYz62N+VP22vVDpIb0X1i5ayWBCs6vaQlxAcBPCzTpaQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1623563549; a=rsa-sha256; cv=none; b=ZxrzPBetDnTMvGPciQBAKWu6KAGYWE+aLJeYtETN1xraK4XelfCqecvQ+V0aqJTcu7mv9r A8+ijcLEQPZzvYtW1bl3YBqjpHueqJ1/+szpTLQhEazyr/z9Hcqg5UyZ8t7UnF5xKotgmg 86m+AERb930EAS6N1Db+Gw9Pg+0XLQ4UUycG5Pp6i5qlhJ7LpMnK7wyE0BV/srN/mAIjuM 0wT/hnBvUT1LCL/qTWEF04/0n8KMFG/rOQazDStbG4UjIevRTKhhOU2PIxhkfZbowC135Q suR/C0LTIm394l22ULdT0lwEoddHk5HudySaNZRuRnd5+7NSriI4KeKzHOOmFg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -0.92 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 99E7112A58 X-Spam-Score: -0.92 X-Migadu-Scanner: scn0.migadu.com X-TUID: E/1f7Hcq+rvh Hi once more, well after sending this patch I noticed, that org-id-update-id-locations has become orders of magnitude faster on my system; with org 9.4 it takes seconds instead of minutes as with org 9.3. Which is great news :-) This alone may dratically reduce the need for changing the behaviour of org-id-find as contained in my patch. So you may feel free to ignore it ... Best Marc Am 12.06.2021 um 16:16 schrieb Marc-Oliver Ihm: > Hi, > > please find attached a patch to allow more flexible handling of missing ids in org-id-find; some people (like me) tend to lose ids now and then and may benefit from more choices. > > The current behaviour of calling org-id-update-id-locations is pretty perfect for situations where the id has been moved to another file (which will be the case in most situations, I guess). However, sometimes an id has simply been deleted and then searching for it in all files can not be helpful. Especially lisp-code calling org-id-find might want to handle things on its own. > > To this goal, a new custom org-id-action-on-missing-id has been added; reproducing its description from the patch: > >> (defcustom org-id-action-on-missing-id 'update >> "Special action to be taken, if `org-id-find' cannot find an id. >> >> With 'update (default), org-id-find will silently call >> `org-id-update-id-locations' and try again; this will help, >> e.g. if you have moved the id to another file. >> >> With 'exception, the exception 'not-found will be thrown, which >> can be useful, if `org-id-find' is called from within lisp and >> the caller wants to handle the situation. >> >> With 'error, a descriptive error will be raised, causing the >> current command to terminate." >> :group 'org-id >> :type '(choice >> (const :tag "Run `org-id-update-id-locations' if an id cannot be found" update) >> (const :tag "Throw exception `not-found'" exception) >> (const :tag "Raise an error" error) >> )) > > the handling in org-id-find is straightforward. > > The default corresponds to the current behaviour. > > I would like to ask for opinions/discussion on this patch and maybe see it applied if found fit. > > Best regards > Marc Ihm >