From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id CE4wBpUcQWRlegAASxT56A (envelope-from ) for ; Thu, 20 Apr 2023 13:05:57 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id yMkrBpUcQWTtTAAA9RJhRA (envelope-from ) for ; Thu, 20 Apr 2023 13:05:57 +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 C3D2F3BF64 for ; Thu, 20 Apr 2023 13:05:56 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ppS5y-0001GA-3F; Thu, 20 Apr 2023 07:04:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ppS5s-0001FI-H1 for emacs-orgmode@gnu.org; Thu, 20 Apr 2023 07:04:52 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ppS5r-0006pn-1P for emacs-orgmode@gnu.org; Thu, 20 Apr 2023 07:04:52 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-63b7096e2e4so810113b3a.2 for ; Thu, 20 Apr 2023 04:04:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681988688; x=1684580688; h=content-transfer-encoding:mime-version:user-agent:subject:to:from :message-id:date:from:to:cc:subject:date:message-id:reply-to; bh=yXumAocML3dSMzAnYaBAgAgqwSoAwfu6bylqXxmJWWQ=; b=ZSEfBxB/jdlUGRflRaVFdvVEhdtx/D0OHxlzgCAIPxhh2rnetLYH941HBWlPyGsz+p +bA7OkrVs9x+y/Sq8bB/H+sywNSMfCQmr0aSvAH7IOUk7bzENXl0u7irfOrh4w1EBrdE aUzo6b3vNQ4QxCVpuvfuRJDKmrzykhRUpMYp3x01PiPr/iD0RAE6+caxeXV9g6rjGzwP VQ9lXVCA8z8qzyF/vqFKMPWNUKNUpaODyegDuCtvgEfYZbqP3fiZe9a2wRkCg2Vy3LYv 0Ckp0hfrjkGPieO5Vj5MDmfC11+YTp5IE1kzQ3pXu0p4PQnEpYe3A7G5kYVovfP/yeoe nswA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681988688; x=1684580688; h=content-transfer-encoding:mime-version:user-agent:subject:to:from :message-id:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=yXumAocML3dSMzAnYaBAgAgqwSoAwfu6bylqXxmJWWQ=; b=VHrX+sDky0EwSyNJFDl2KNZlcmREJYEob76ua/SWx6IUbvBcory1seYirCE2UYg3G1 VZj0Rl4AHfjKAl+4l/FLApZTUylwr7m9QapcK0N33Z/lNPGQaRgnVs2jahw4yG668Y1r lP0W0U4rkYiwr5Gko9Kr0NTVsHzj6cEQpv7KFc1Swxz1Zq0qEox0hhLDa2vm2YCBfvcZ zf4IMQt8pK1n9awYc5qE5Kqc1TJWkLVWecPcuwR8R73PCjon3+JRlOxQ+sME99jhekuA eWrWK8DJOc1id0kCIpUIJje/RPyOmfwyq9ifDumMjlUBe8DtF0GarXwo9BOUCs/YtLZh hm7A== X-Gm-Message-State: AAQBX9d9xoYwcMejF3yL1ux285U1k1ePEZTzvY7uOXJBxZhHfeUvQ7Dg hvgPsKZ3r6IgB+EnzmVq9/yfr8Vc+3o= X-Google-Smtp-Source: AKy350Z9+aYTilAHEFNtENeNWPixwhydTR73sHiR4WcHANSE1p3ly5mB7uIlFg4F6Nhxkjx0lmBSBA== X-Received: by 2002:a05:6a20:9150:b0:f0:dfe2:2483 with SMTP id x16-20020a056a20915000b000f0dfe22483mr1824824pzc.2.1681988688599; Thu, 20 Apr 2023 04:04:48 -0700 (PDT) Received: from paquerette.gmail.com ([2001:861:4284:db70:951a:4d8c:d63c:e0ba]) by smtp.gmail.com with ESMTPSA id z2-20020a63d002000000b0050bcf117643sm942553pgf.17.2023.04.20.04.04.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 04:04:48 -0700 (PDT) Date: Thu, 20 Apr 2023 13:04:42 +0200 Message-ID: <868rem24s5.wl-edouard.debry@gmail.com> From: Edouard Debry To: emacs-orgmode@gnu.org Subject: How to set priority of a heading with the highest one among its children User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.0.50 (x86_64-w64-mingw32) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-7 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=edouard.debry@gmail.com; helo=mail-pf1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b="ZSEfBxB/"; 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"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1681988756; a=rsa-sha256; cv=none; b=M9T5U2JWLdIUBg/93l3sIEzJ4S5GuyYEah2cKyCvzIO9LOZpO9IgvjHR4s6WnM7/yxbrAU 93lZYG9zaIPSAQ/xvWK/wWN/4G7BmKFDLw9S8LJZ4XqmqLHAb1mlkA8eWUqY1cPDBVihi5 SuAMTyzd/4n2BF3L2a0hCq/eW46lw1QgmrTcNN21ndC8LNoS8JtAPF1MLFF2ONKTUefPOQ aoWQao2mPfRQmWnlcTiWyWP+ko7TjRHX0qE7CF8tkdxLStfk6lrQhmjMdMSw/P/jpzHlj1 UHYOuBqV4SmbxiJRmCg/M72QRg+dckCbto4IDPhuegkP0llh/iPEE/VCkGajHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1681988756; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=yXumAocML3dSMzAnYaBAgAgqwSoAwfu6bylqXxmJWWQ=; b=NtduXUkaf3tqY77McqC4HvyMz7u/tbdF2QZMIBevLSnrJo7TZ8Ge1nUG+e+J2KWRsIWrf5 rL9lLPNmY2ey3Fsat9lvbTK0oIl0zT5Ui3Mbor8zx8c1FDKqoyKI8wCoaCxxrj8l35t9MC S+GEkzvQThdC/hLCoiCXlfhn5misgBMNkWN02rNjv5izxA9UMBv9HiYhUj7NdstnxtcQym oZRyOAJ2kZnH2doYP/vaF+WgWdbmsycgPSkTSbTKI5cQRrbHpN7WCynN0/DYB7pVOJkO19 5gBPXD/nfbL6rSsYBCN+TD5nsvzxXEZAS5TL1ZX1qbyaApcbpynjuRF2nWY5bA== X-Migadu-Spam-Score: -10.45 X-Spam-Score: -10.45 X-Migadu-Queue-Id: C3D2F3BF64 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b="ZSEfBxB/"; 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"; dmarc=pass (policy=none) header.from=gmail.com X-TUID: YxR0c5drxUXa Given this tree : * TODO Main [#2] ** DONE Child1 [#0] ** TODO Child2 [#3] ** TODO Child3 [#4] *** TODO Subchild1 [#1] *** TODO Subchild2 [#2] I would like that the priority of parent headings be automatically set to t= he highest priority among its note done children. So, in previous example, as soon as Subchild1 priority is set to 1 (0=3Dhig= hest, 5=3Dlowest), then priority of Child3 should be replaced by 1 (instead of 4) and priority= of Main should also be changed to 1 as this became the priority of its child Child3, but i= t would not be set to 0, priority of Child1, as this task is done. The reason for this it that usually a project is a main heading, which is s= plit in subtasks and, I want the overall project priority to reflect the highest pr= iority of its not done tasks. To do so, I need to create a recursive function : (adjust-priority () (apply-on-child #'adjust-priority) (set-priority (if-child (collect highest-priority)))) and apply this function to the top level heading whenever a change in prior= ity occurs in its children. But this involves org skills a bit beyond my understanding, I wonder if you= could give me some piece of advices on how to do that : - is there a suitable hook for this function ? - when in a given tree, how can I select the top level heading ? - when at a given heading, how can I change programmatically the priority ? For this latter question, I tried (org-entry-put nil "PRIORITY" "2"), but i= t replied that org-priority: Priority must be between =A10=A2 and =A15=A2 Regards