From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 4HJrDzZ2RmQL1wAASxT56A (envelope-from ) for ; Mon, 24 Apr 2023 14:29:42 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id cEl0DjZ2RmQDCAAAG6o9tA (envelope-from ) for ; Mon, 24 Apr 2023 14:29:42 +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 E2036177A3 for ; Mon, 24 Apr 2023 14:29:41 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pqvJb-0003su-HX; Mon, 24 Apr 2023 08:29:07 -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 1pqvJZ-0003sQ-63 for emacs-orgmode@gnu.org; Mon, 24 Apr 2023 08:29:05 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pqvJR-0003xg-Dg for emacs-orgmode@gnu.org; Mon, 24 Apr 2023 08:29:04 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id EC4BC240251 for ; Mon, 24 Apr 2023 14:28:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1682339336; bh=ux9HfPsQwRsA7tlX8o60470SK5wF0K3uKAyFGB2qCQ4=; h=From:To:Cc:Subject:Date:From; b=UpTmIWS5+dgyFI1p/GDSo+Jb5idP7opAo+D2UCWS0pclF0SfE9PAOIdx+gD+soVNC feEbDsSME+oB6XrZwIYhB/MMOnwV3sV2fwOt61rHyPy1638L87EjVY46VXYxYLWMVA pyZ9gOt2NmjUHj0GX8SA9R0PPs38E4Tk/GgXPmyYWQvSKg8IruAFyrJXfxua7RHlvb 1Lhzodo3vD8yK2zBpuT72XUjzJlQ8eBexSVcpI7bgJI5viO4EfdWbPa8HrWy8fFT2D 5gwI1jlHdt3thBBEflsXiA23HunKZW27tazxal4nzPyEWoBL+o5YTjzoxuK1ZEwtkc 9ods9MPUJwh5g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Q4kvW3swBz6txM; Mon, 24 Apr 2023 14:28:55 +0200 (CEST) From: Ihor Radchenko To: "DEBRY.Edouard" Cc: Edouard Debry , "emacs-orgmode@gnu.org" Subject: Re: *** BULK *** Re: How to set priority of a heading with the highest one among its children In-Reply-To: References: <868rem24s5.wl-edouard.debry@gmail.com> <87o7ne321r.fsf@localhost> Date: Mon, 24 Apr 2023 12:31:46 +0000 Message-ID: <87cz3ttqa5.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, 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-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1682339382; a=rsa-sha256; cv=none; b=AVWjJhqv6urhSgDDoQoOLT/vR61T0qFIv5qTJ2CZ+tdyJgKPNZz0nioSjgSNDykSBb51Vp CBCPvKtavLFO+BaCdej4D/6liSWDp0ltuVsy86mAOXg+5kfkXr8Kzyf3uRTbKNxyM2SyyR CLr1FC/j5bve3fcq63yWTF53zMBjzXiEE9wvxdxX7ASVJTySE3ww1mNRfy29ocDlN79pCh pKqwoKCZia/SSDG9hPsrx/hSLnHPRZSsvU82Z/7t98vqiEJGaGgBFLGbjgRK2H4JCB8Iht sByS/L/38Cf3/aeVLIQZ9TqPcqVMQ8As+2pYpaVVZQp8cLQoHnPIgDu15p4K5w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=UpTmIWS5; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1682339382; 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=W/b5EXBHMD1XIGMtPPuwLnRHyPwC7NSRQuk6NWGliW4=; b=Stx14ogSOQm0Z2FybfcJREpSt66DGLJnY5+Vv3VYSgNJAwTJ8PDp+F+ZZpTYx8SY91PHIW l7y6pjdtHKG6IFVm2AKJGZ1Q1VYdj+qPpvSMFp5KTnsUWHSnBesmONBWiyi/HOVEVPpaeH FMQDHLhX+2pqY6jd5VuSmyjL9Gq6lVCFJ65eVljaH7iWAhDaW14tW0Men30OWtca0K9GDD 6eGLAJr7eQgJigpi8a3XFd1LvEDmvodfP0uyqiaKPGf/DP98SlK8nFCkrg2jMHIGHFGaRa j9D+2JDZhnbTIbISk5quc7mSh/A4cx//yo0ncHwngF4FeFqs3IXYAaHpuH5wTw== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=UpTmIWS5; dmarc=pass (policy=none) header.from=posteo.net; 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: -6.21 X-Spam-Score: -6.21 X-Migadu-Queue-Id: E2036177A3 X-TUID: 4hv2VL5n/+hb DEBRY.Edouard writes: > Here is something working, probably not yet all cases proof > > (defun local/set-priority1 () > (org-with-wide-buffer > (when (org-goto-first-child) > (let ((ls (remove nil (cl-loop collect (local/set-priority1) while (org-goto-sibling))))) > (outline-up-heading 1) I recommend using org-* functions, when you can. outline-* functions are not always compatible with Org. > (defun local/set-priority2 () > (save-excursion > (outline-up-heading (- (org-element-property :level (org-element-at-point)) 1)) Note that parent heading may or may not be just one level lower. Consider * heading 1 ****** child -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at