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 ms5.migadu.com with LMTPS id mDoAAOJXz2MaoAAAbAwnHQ (envelope-from ) for ; Tue, 24 Jan 2023 05:00:34 +0100 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 QDW+OuFXz2N4QAEAG6o9tA (envelope-from ) for ; Tue, 24 Jan 2023 05:00:33 +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 9E048F6DE for ; Tue, 24 Jan 2023 05:00:33 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pKATR-0004pL-DR; Mon, 23 Jan 2023 22:59:53 -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 1pKATP-0004ow-Qr for emacs-orgmode@gnu.org; Mon, 23 Jan 2023 22:59:51 -0500 Received: from netyu.xyz ([152.44.41.246] helo=mail.netyu.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pKATO-00057G-2x for emacs-orgmode@gnu.org; Mon, 23 Jan 2023 22:59:51 -0500 Received: from fw.net.yu.netyu.xyz ( [223.94.109.149]) by netyu.xyz (OpenSMTPD) with ESMTPSA id 78125de8 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 24 Jan 2023 03:59:42 +0000 (UTC) References: User-agent: mu4e 1.8.13; emacs 29.0.60 To: Philipp Kiefer Cc: emacs-orgmode@gnu.org Subject: Re: [Bug] 'org-font-lock-extra-keywords' appear next to the parent heading when its subtree is folded. Date: Tue, 24 Jan 2023 11:52:57 +0800 In-reply-to: Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=152.44.41.246; envelope-from=ruijie@netyu.xyz; helo=mail.netyu.xyz X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FROM_SUSPICIOUS_NTLD=0.498, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Reply-to: Ruijie Yu From: Ruijie Yu via "General discussions about Org-mode." 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=none; 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=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1674532833; a=rsa-sha256; cv=none; b=F0GdWKJtJuSHUBm5sTsZV3pAuTe70L3HAv4pI36EtuXBHhsXqLNwILjFxjVGnAtDdh1o6K a5jPxQpgnHIoRDxn+TeQjLXGnmdmDQYFztqlTF7bnun4rQc8T/vf+qDCmSQhZWbpHRTrro bL1EyZ2b/6uF5hvMRIZlQ5VPxSOCSxaHN/VzdG8+Ib6eA7vtc3kjXVZLAQDnX9NKomuGs9 VEYq4ZXVLGLMfXkauqN6oYLdsy0ck4FaiJWMF1+pV9LSiyJ/ZM8qz4EHfzRY3MmwNAOjwt vJFEh45rQUYVckOi3pfOSLri/CtJ5u+QJ/rakmZBWSYGpLH44DsFwqg4nTh/NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1674532833; h=from:from:sender:sender:reply-to: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; bh=AnMQ2BHDd+dx07Lve6xgKspvYFiq2rUEdYpRsMV0ZWk=; b=bE6OAiWn+wMVTvdE5ts0QpCREPmJyaBF5UiVXEY3sV9t1ZLDBml3H7+FCQr4QSweop8QAj mui+aIgRoUysnAau4Ibpb7QftVURaMYZU4jG3fFyI3pEE6QRNeshWdrYdQSL3nfqbOcHSA DDhWSCNdE6goBPlYmGDW4HnoQVUatS6DtoERJiEG6sv1vk1/GBUO9P+XLsm4KTNXhArmBP 8kHhqxzIW7ZJqViuOFLEsPSSbNTJGVZUB1RNVegA0jKMZVWYvQgyQwOmQY1G3gTS1LKMnC 7hFKTP3T0LoRdb2sdhx7IKc159g64lHRrMAK4UeEi6dg9kRtsHIujxtWc0jhZw== X-Spam-Score: -3.49 X-Migadu-Queue-Id: 9E048F6DE X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=none; 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=gnu.org X-Migadu-Spam-Score: -3.49 X-TUID: Yd84DYQjDGB0 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-mai= l attachments to the list?) > > This is the relevant code from my init.el that seems to be causing this i= ssue: > > (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 '("\\(=C2=B3\\)\\([^\n\r\t]+= \\)\\(=C2=B3\\)" (1 '(face org-habit-alert-face invisible nil)) (2 'org-hab= it-alert-face t) (3 '(face > org-habit-alert-face invisible nil))) t) > (add-to-list 'org-font-lock-extra-keywords '("\\(=C2=A7\\)\\([^\n\r\t]+= \\)\\(=C2=A7\\)" (1 '(face org-habit-overdue-face invisible nil)) (2 'org-h= abit-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-f= ace 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? 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. Thoughts? Best, RY