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 ms5.migadu.com with LMTPS id YHMiD6kX0GM6RwAAbAwnHQ (envelope-from ) for ; Tue, 24 Jan 2023 18:38:49 +0100 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 UGQeD6kX0GPcGwAA9RJhRA (envelope-from ) for ; Tue, 24 Jan 2023 18:38:49 +0100 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 DABE03F084 for ; Tue, 24 Jan 2023 18:38:48 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pKNF8-0003D3-HU; Tue, 24 Jan 2023 12:37:58 -0500 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 1pKNF7-0003Cn-8l for emacs-orgmode@gnu.org; Tue, 24 Jan 2023 12:37:57 -0500 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pKNF5-0001g8-3d for emacs-orgmode@gnu.org; Tue, 24 Jan 2023 12:37:56 -0500 Received: by mail-ed1-x535.google.com with SMTP id w11so3819050edv.0 for ; Tue, 24 Jan 2023 09:37:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=7F6SebnoGGJjXvGWcmUC/SeNlCURDzrTyOvItIMUAhw=; b=Yjxu38LP+lM6cNL1yH/tn8mjgkgovlOA8IXeKSDBTo13C7YEiaipK9HBdzlQKRa6OX /5Kh78dWWGPpZElNkPrcTTnRJIsKQ9V2U+vPLqJlyEzPQTKnRB43NyJhLTlRuD+UOnYD Li3sLiRpoiksRry/YGazFvNpc2rcOYQ5T6uBTPLYllTM/3Y3O9E/ztbm7yeNA9cmomjV J5wrCEOoTox+mft+u7VLn7poEcprO+lRv5iPCzaGVul9eRdcsR7mG4ucCzTTC6/i4754 7b3AGdOu7RhFWnfBoE5RVqV70GHwA0AbfrS+QtUEmGPVn0Ae16GNyjx8aK5ZdLgIuGkB yjFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7F6SebnoGGJjXvGWcmUC/SeNlCURDzrTyOvItIMUAhw=; b=QU88HF5nTUFtSgPm7DQ9zoz7nNUClsReJ470M4KWLOSkOzoiOxPl6TBvxk0UH7eK/s Uqjz5MuRj0i6H/PwMaQV51obmNASqHOsguU1/E5XaCpH4yXkgCp3JitVYLNhStYl7BRM 9jhS1RenCjeqlq8pRFpIdJWnvsVgglSptOhb3Qr1y44VXz3ZHQT95NiU/0i9PDUxmrF5 6fxzLFdSYPueYWgDxpOong/+ZGUQ4Xy3J8DJgbKuJ4LD/MoIu7PAfa7vFEZfdcb6LTRf 5Arya2YOENuTP2qNgJPN5XfvKKKl7+nSQpbmcu4DfCvHfL90i4jiLVohOShnrBzYIt+b PfPQ== X-Gm-Message-State: AFqh2krJDfi4HW5GeaBHaAxRDBKLOlcf+xCAdNPrPU5tglPWYBhrMCeX rIYxqRVXiyq5QwEeJ2I57CG+0NlKFEY= X-Google-Smtp-Source: AMrXdXtG9Qvu30lyVVXS/TnmP++LprXCIZILTJnlys7j58vIZPlXBh98NyFk0GA/4Sfv0ec/Cq/x+g== X-Received: by 2002:a05:6402:1bdd:b0:499:376e:6b35 with SMTP id ch29-20020a0564021bdd00b00499376e6b35mr28933834edb.25.1674581873144; Tue, 24 Jan 2023 09:37:53 -0800 (PST) Received: from [192.168.178.58] (55d4696a.access.ecotel.net. [85.212.105.106]) by smtp.gmail.com with ESMTPSA id h26-20020aa7c95a000000b0049019b48373sm1291578edt.85.2023.01.24.09.37.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 Jan 2023 09:37:52 -0800 (PST) Message-ID: <3875d398-9cb1-02a1-4b8d-5f71fcb111fe@gmail.com> Date: Tue, 24 Jan 2023 15:13:17 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [Bug] 'org-font-lock-extra-keywords' appear next to the parent heading when its subtree is folded. Content-Language: de-DE To: Ruijie Yu Cc: emacs-orgmode@gnu.org References: From: Philipp Kiefer In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=phil.kiefer@gmail.com; helo=mail-ed1-x535.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_03_06=1.592, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, NICE_REPLY_A=-1.148, RCVD_IN_DNSWL_NONE=-0.0001, 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 ARC-Seal: i=1; s=key1; d=yhetil.org; t=1674581928; a=rsa-sha256; cv=none; b=dnuEs2FnvaI8UufHPoT9FltQxWcQyILvYEyGNSpywN66fxwKi27KLxtZxytSVj2bUaQkls pK/V8MpF56u2V/Bfm7STrzo3fOlqyGcbHT9xuUjJOARyPBeCaICeYJa1n3kanIlww+uRNY fa4CqYBibo//WreaWufiiiN9DWqwaq+zzQTYoRuKCmbdZePVF5+EB/Tf7MqPEIOgd6o4wc vPwfTpIkK/Ihp2i9Xq3jZzV6pJjKtLdiR4T7+rjQslQvjVf3hT+kkL+nnUhrFvkB86TB8Z wh5swZWV0N1JjxezvgfMpBMhSBC7hpdUHFF0SAwVW79A2Jf2AmWETWNWd7xW5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1674581928; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=7F6SebnoGGJjXvGWcmUC/SeNlCURDzrTyOvItIMUAhw=; b=joyPjhNULSTQPeCIncT/FR78NeJMzCBeAnQaKKWD0zxXdBoZ5T7OXIVP09YsNkp5q58e+f nz2XRK5t0SHQfUG0n7IfYdyV+QN+F9I8SGL2PzxQMk3+q+wcD/H3lvR3K7d3ev9Fo/K9vi HNGDwPG0dqiEIHCITBX4HOWMRR1PtnWtGZqYHefXtv3XFoaVpGCgBtND+LfWNQISGs+d4k GfVBhnfCUoAxDt/Lc/Lj+xZ8wD8mUU3l/Ky0inmas1AaVThSq8z8NOmXGwYWdArclVRO47 1YOC0HE6mkqYvdWHS5PR70eP7K9vYsMTN4T2rhzzVTBqS+vcudZrPgrYYk2ISQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Yjxu38LP; 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-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -8.26 X-Spam-Score: -8.26 X-Migadu-Queue-Id: DABE03F084 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Yjxu38LP; 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: A4P6MbUQrx1r On 24.01.2023 04:52, Ruijie Yu wrote: > Philipp Kiefer writes: > >> Org mode version 9.6.1, GNU Emacs 27.2 (build 1, x86_64-w64-mingw32) >> >> Please see the two screenshots here for illustration: >> >> https://imgur.com/a/7EuUi0J >> >> (I'm assuming it's not a good idea - or not even possible - to send e-mail attachments to the list?) >> >> This is the relevant code from my init.el that seems to be causing this issue: >> >> (require 'org-habit nil t) ; relevant? >> (defun org-add-my-extra-fonts () >> "Add alert and overdue fonts." >> (add-to-list 'org-font-lock-extra-keywords '("\\(³\\)\\([^\n\r\t]+\\)\\(³\\)" (1 '(face org-habit-alert-face invisible nil)) (2 'org-habit-alert-face t) (3 '(face >> org-habit-alert-face invisible nil))) t) >> (add-to-list 'org-font-lock-extra-keywords '("\\(§\\)\\([^\n\r\t]+\\)\\(§\\)" (1 '(face org-habit-overdue-face invisible nil)) (2 'org-habit-overdue-face t) (3 >> '(face org-habit-overdue-face invisible nil))) t) >> (add-to-list 'org-font-lock-extra-keywords '("\\(@\\)\\([^\n\r\t]+\\)\\(@\\)" (1 '(face org-habit-clear-face invisible nil)) (2 'org-habit-clear-face t) (3 '(face >> org-habit-clear-face invisible nil))) t)) >> (add-hook 'org-font-lock-set-keywords-hook #'org-add-my-extra-fonts) >> >> Can you reproduce it? >> >> Thanks! > I am in a region where imgur is unavailable -- can you attach a minimal > org file where the issue manifests, and briefly describe what happens > and should happen? Sorry, will attach such an org file in my reply to Ihor later. > Also, while looking into your init code, I noticed that > `org-font-lock-extra-keywords' seems to be public-facing (as there is no > double-dashes in the name), but has no docstring. Either this variable > was intended to be private, or someone forgot to put a docstring to this > variable. Thanks for making me realize that much of what is in my init.el is miles from 'best practice'. At the time I cobbled it together, I was just happy when things eventually worked the way I wanted them to and did not bother overmuch with proper procedure. No surprise then that it is coming back to bite me. Will put in a 'defvar' statement with a docstring and rename all my private functions from 'org-xxx' to 'org--xxx'.