From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id kLTSAWR1OmMgNAEAbAwnHQ (envelope-from ) for ; Mon, 03 Oct 2022 07:38:44 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id AEPUAWR1OmPUwQAAauVa8A (envelope-from ) for ; Mon, 03 Oct 2022 07:38:44 +0200 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 9BCD712DC8 for ; Mon, 3 Oct 2022 07:38:43 +0200 (CEST) Received: from localhost ([::1]:40376 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofEA5-0007vi-8T for larch@yhetil.org; Mon, 03 Oct 2022 01:38:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofE8i-0007va-47 for emacs-orgmode@gnu.org; Mon, 03 Oct 2022 01:37:16 -0400 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]:51966) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ofE8Y-00006w-Gj for emacs-orgmode@gnu.org; Mon, 03 Oct 2022 01:37:15 -0400 Received: by mail-pj1-x102d.google.com with SMTP id b15so928459pje.1 for ; Sun, 02 Oct 2022 22:37:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date; bh=WI5zhCvNAK/zI2cvdcjIFN9flTcWw92dxaejO62KixY=; b=M+QlHE2Z9G4yenk+UWv7T+BONY1fcNj7yTYF/yPDouJ9lsmF7aQZTp7BWFctstO7uP vTT3KK9owzpiIRG6D7WcWIGYn8dlNbiYo/r9YABhc6Gf5nHBklBOQgA1XlMght9UbVKX LZXBy8O5JhxgSEejcWsQ8nkRoSyS5GAjvU9OscHiEM0PiGgIbeOnaah1VMTONB55Vt5G ElpIsQMkloxfI6Cb7rKRoCO3Wu4o8wI9y2kVYC0V/ELAt/PlKVnXnFomyTQABBWVmopA 7cimPViyLFvHINYTO3laCOCtm3ZJjg2ALH267Z9wmvwZ2PKxfXSnYW94IONwloEaWh29 xFNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date; bh=WI5zhCvNAK/zI2cvdcjIFN9flTcWw92dxaejO62KixY=; b=LY3a1zyMGTZAIBFvD51kWBP8EpXyJOup7ldSapybg+bd3onTeEjP7Pt+bmG9IjjdKk QgfF45eeGxOrOUmRKRZW+bZ28PniWPL2j8jgXcT6wuXyHq0/MgZtXnP+GKdnw9dPQy1O kt4IB5no4i2xfNOXP/ywjgn5Xj84Ij9LlTXIIQDjGC36v6RsDgs2rOwvcm0MOOw6bS4W SAutJKuuGJn4i1kPHcvyER46xUm5w0C6fphGNkr2ITDggUZBNh1V28iCmfa9hGqjJahm 1YEEfk2xZn7RC6VwidhV/v0GfoQyS7MeFkPiMDoYNyCeDHu7+0St8feiQpf6YMyyJzzT 2bEw== X-Gm-Message-State: ACrzQf1n81cxe/QNRglTosAWbviDRd885cDhh2rdq3/f8uSKmRlyEdGN +kcNZmkjhgetplqjpFXARpQ1IOcTYNldwgKn X-Google-Smtp-Source: AMsMyM7HqYTXIdeOgcqk5Pr31DqqOLTaf4tBuFV1gkOPqTNzY0xg+73MOXR7sftS/6SBY+U/O933Bw== X-Received: by 2002:a17:90b:38ca:b0:203:64d2:dac5 with SMTP id nn10-20020a17090b38ca00b0020364d2dac5mr10470323pjb.209.1664775424589; Sun, 02 Oct 2022 22:37:04 -0700 (PDT) Received: from localhost ([1.83.154.214]) by smtp.gmail.com with ESMTPSA id i124-20020a62c182000000b0054a15345162sm6388637pfg.207.2022.10.02.22.37.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Oct 2022 22:37:03 -0700 (PDT) From: Ihor Radchenko To: Eduardo Suarez Cc: emacs-orgmode@gnu.org Subject: Re: Planning links to tasks In-Reply-To: <20221002193038.GA12424@itccanarias.org> References: <20221002193038.GA12424@itccanarias.org> Date: Mon, 03 Oct 2022 13:37:56 +0800 Message-ID: <87o7utxya3.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=yantar92@gmail.com; helo=mail-pj1-x102d.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 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 X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1664775523; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=WI5zhCvNAK/zI2cvdcjIFN9flTcWw92dxaejO62KixY=; b=cgUvQYJqp5tALs1HqHfJoyXR0T+HQ1jk1vcQe4BhxHaLdTJoQ2tW7LzL6vDZITvt4zhU1O 9uRxwDrbt6ULUmRpbA9IMNJgVjBiFmLAr6U7BHAJ7t8dKF6MjJTWjjCPod5lYg7CrqD0aj qM0fO5iSQnSFjkp25OSW0N/tXLUW8J2/z9bcl4gi1O2vm/BiGfjToOEPU7f8fbhNhm9iZi jokALV5HiP/Glk5b8n9uGcjXI0DWXyPbGavoV3tQl3oOzGNylk2w9ST9HF+pKPRETQ4hMp u00csg9XJKYRe5P1X6VrbMteXYYGZT68y5+AGypIMDAmiUhTJdrK6wUVC9xPWQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1664775523; a=rsa-sha256; cv=none; b=NIKiEDOsnOR5nmG9c8ei1jtWfHps+ZNLxyKj3VuC/9QjJc48nhMIawv5Z2gb2aqyhSZf6b TVA8Ft4RrmxpyEVzBcppT71rzJoQZP0dDLHZyfFgraDja57HZzMKXoy6srTmRivLKPJ7f9 fRytmZ2ngVbyeIf1if7CvnxA6c2fJaTo6yjoZrdnC4fCpR8djfXvZyzbjJXEl+ODkQf4HY H5lq5qFWxm2Vb9c1p0lswVMYzC6ektFPDuLzxmAiJkFPMOz+fzJy6xrAFZwSRq4uqGl/ms nW4X2uM8vSS9Iiuev8TVz4UiZ0ocuRpewh98omRj6xJlCPGcwHBAdqLLuKlbjg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=M+QlHE2Z; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.35 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=M+QlHE2Z; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 9BCD712DC8 X-Spam-Score: -3.35 X-Migadu-Scanner: scn1.migadu.com X-TUID: 5AEmxTqrFHKE Eduardo Suarez writes: > Hi, I have just implemented an approach to creating a hierarchy of links to > tasks, so the hierarchy can be thought of a dependency tree (something like a > Gantt but with no dates). This approach may be suitable if your org hierarchy > is not already based on todo dependencies, and there are too many tasks to > review them often. > > The idea is to be able to: > > - easily add an item to a plain list in a section named (e.g.) > "Planning/Unplanned tasks", consisting of a link to a task in the same > buffer (=org-plk-insert=), > > - move by text editing this list item into a hierarchy of items in a section > named (e.g.) "Planning/Planned tasks", so hierarchy means dependency > (somehow). Have you been using your code for some time now or is it just an experiment implementing your idea? > Some improvements would be great: > - update link description at point, > - nice looking planning links (fontify?, have no idea), > - use another flag for planning link instead of suffix, > - check for planning links duplicates. It would be helpful if you provide a more detailed demonstration of your approach. I imagine something similar (in terms of presentation) to https://blog.jethro.dev/posts/capturing_inbox/ It is hard to comment anything on your ideas without seeing how your code actually works. Also, if you want to hear suggestions about particular parts of the code, please provide those parts instead of throwing the whole code - it will make things easier for people who are only interested to answer a specific question of yours. > (defun edu/org-plk-description-from-id (target-id) > "Planning link description from Link ID" > (catch 'found > (org-map-entries > ;; break on first element found > #'(throw 'found (edu/org-plk-format-description)) This is not a valid Elisp syntax. Check out 13.7 Anonymous Functions section of Elisp manual. > (let ((shift 0)) > ;; map over all links in the buffer > (org-element-map (org-element-parse-buffer) 'link > (lambda (link) > (when (edu/org-plk-p link shift) ;; filter-in plk's > (let* ((new-desc-text > (edu/org-plk-description-from-id (org-element-property :path link))) > ;; shifted because of previous description updates in this run > (old-desc-start (+ shift (org-element-property :contents-begin link))) > (old-desc-end (+ shift (org-element-property :contents-end link)))) You can also use a simple re-search-forward and not bother with `shift'. Or use org-element-cache-map from the latest main. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at