From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id sCjYDaebEmdxsQAA62LTzQ:P1 (envelope-from ) for ; Fri, 18 Oct 2024 17:32:23 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id sCjYDaebEmdxsQAA62LTzQ (envelope-from ) for ; Fri, 18 Oct 2024 19:32:23 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=OiYa9KSU; 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=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1729272743; 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=pSyQY0e9LMfE2Rs6JAsh+1e5RYOHhQ0QO1KsA4JS+YE=; b=KhqgAbn1DCCDkfOH8sAlAHwPu4s8CxiMwh7AN+GnX+UVVxeBsnrSBlxLaeL3CciIfciTVa Cgrrew0ON+uWZXRFJWk/RXeWUK/uNY2iIgJ5RSny4xUoTfd274eb90Fi9hvJhNopeu/29Q 8dUPr/giSyCmzBaVgJH4HWfuEo3fnLtIy2hwIHmkVoIWZAOZVKXAUw44ftRjOXcPYfukC1 2NYTRQfVkxC8yzctNBeIKdfKle0/OhlDqFmyie+kYD/CrxgRzfpI8h4moQpfb6bj7yajpG vuzSmXh6w3pBIxE2khGHtB0GkGeUCfhhNOjrEBP+6Um8NVJOr0Ef2BykgmHLeA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=OiYa9KSU; 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=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1729272743; a=rsa-sha256; cv=none; b=qrveAse7/CYajVj55HHyuDUbZd2bCJhIgYc6OZFvr3jwib3FpRuv6RzIFpYgFPuVCVkflj dsk7EkMtkobbnEJzBCcxQRgC0ED+TgvkCPlifje3UVLmbqKcd5lVwNp8LNCvvYaHXglB7W gd8ccHUjTND0JjIekae2bdqGKgQNtwt4ETVaBpz8etOtNXUqVhzdltaKRbMG+05szeT1y3 /QJgVv2P9p2e4pskiwbRq+J50gF4imVxjl7LzTZz3Q9N0Eaq/VJb6HUkizPh0Knk1qIwV3 0Zi7ovWUM+kAkbjbG24gbvu68gEXeUSQGkICpN+ijBbK4WdEBY06j5Q7iyPKYw== 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 D1C6747A06 for ; Fri, 18 Oct 2024 19:32:22 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t1qoy-0006AY-JE; Fri, 18 Oct 2024 13:31:28 -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 1t1qov-0006AJ-6S for emacs-orgmode@gnu.org; Fri, 18 Oct 2024 13:31:25 -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 1t1qor-0004GL-F4 for emacs-orgmode@gnu.org; Fri, 18 Oct 2024 13:31:24 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 22005240101 for ; Fri, 18 Oct 2024 19:31:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1729272679; bh=tPzaKLvrgqHeufFV0/pdwnX6Sh+33YRu/SNAsbvRFwg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=OiYa9KSUQsRm/kSW2+Uzw6w6KNkgd9H/xiUzYwe8AOkbuAzjtS1W3rSqutTlQzAD9 ORLX8RoBut9unObY1SZNp0a7F6cAXS4bu4gw7/HxrBmL+16Dc90J27k0xGX042b61k Q3yLAmQoyoNXoKaQH4+6xIlHn9ZigWh2j4p57JR2WcCL3JXTZ/jgKNOxj4tutZHu23 0fehOWtM0mj1SKXFHwfmTUyn3JnLUUrGN7BZQVVLlQp/X94Bhq/nUX/Ac7zmWJFRQ0 T2txp3hr0f+5A75EHh8yT3P3fJjFxyYq0l8yrjYl53sV7AxOfnrMXuyOVfHEnkY8el StAWHtz3E5sHw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4XVWvp5033z6twr; Fri, 18 Oct 2024 19:31:18 +0200 (CEST) From: Ihor Radchenko To: daisysky@tuta.io Cc: Emacs Orgmode Subject: Re: [BUG] `org-format-outline-path` returns inproper `org-level-N` face for a heading if its level is not consequent from its parent heading. In-Reply-To: References: Date: Fri, 18 Oct 2024 17:33:06 +0000 Message-ID: <87ed4dxqnh.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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx11.migadu.com X-Migadu-Spam-Score: -1.19 X-Spam-Score: -1.19 X-Migadu-Queue-Id: D1C6747A06 X-TUID: P9ZPemZshTSF daisysky--- via "General discussions about Org-mode." writes: > For example, in an org-mode buffer > ``` > * Heading level 1 > *** Heading level 3 ; where the point is at > > ``` > > Run `(org-format-outline-path (org-get-outline-path t nil))` in > `eval-expression`. > > The output is `#("Heading level 1/Heading level 3" 0 15 (face org-level-1) > 16 31 (face org-level-2))`. > > Which doesn't work as expected, it should add face of `org-level-3` instead of > `org-level-2`. I can see why it is unexpected, but it is not a bug. You are calling `org-format-outline-path' on the output of `org-get-outline-path'. And `org-get-outline-path', does not actually return the real headline depth. What is does return is ... a list of ancestors for current headline, as a list of strings In other words, if some ancestors skip certain outline levels, this fact is not recorded by `org-get-outline-path'. If you want to apply correct faces according the actual headline depth, you will need to use a different function, similar to `org-get-outline-path', that will put "" in place of "missing" outline levels. You will also need to filter out //. Or you may implement a custom version of `org-format-outline-path' as well. TL;DR: Org mode APIs do not provide what you are trying to achieve. Not a bug. Canceled. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at