From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id WKw4BKuebV8fOwAA0tVLHw (envelope-from ) for ; Fri, 25 Sep 2020 07:39:23 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id GA96O6qebV+qLAAAB5/wlQ (envelope-from ) for ; Fri, 25 Sep 2020 07:39:22 +0000 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 B6D02940546 for ; Fri, 25 Sep 2020 07:39:21 +0000 (UTC) Received: from localhost ([::1]:36706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLiK8-0003Og-BI for larch@yhetil.org; Fri, 25 Sep 2020 03:39:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLiJM-0003OY-Cs for emacs-orgmode@gnu.org; Fri, 25 Sep 2020 03:38:32 -0400 Received: from mail-40134.protonmail.ch ([185.70.40.134]:39295) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLiJG-0004k1-0F for emacs-orgmode@gnu.org; Fri, 25 Sep 2020 03:38:28 -0400 Date: Fri, 25 Sep 2020 07:38:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=phfrohring.com; s=protonmail; t=1601019503; bh=mh0SKjecgKAMCmK0LuF/IjzH8jnmcq5pjj8I6H96jcg=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=HYDQ7YuP9DMXlkvd1T0nK3jUgKS7jEF54tGutq9o+apQ7hp4m4gCXkFebnsJfs4Zj dCN7f96I/LlH+kIQP7JcbTTA00K+NvkgZg19J5YJXLlQpMhsNXjF7y4EI34E62ATsq deBQHO5Ts2cshWoyrJ9dkztC0StVP+6kQ4rLpewo= To: Ihor Radchenko From: "Pierre-Henry F." Subject: Re: Help: how to extend org-mode markup? Message-ID: In-Reply-To: <871riq5nbe.fsf@localhost> References: <871riq5nbe.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.40.134; envelope-from=contact@phfrohring.com; helo=mail-40134.protonmail.ch X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/25 03:38:23 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: "Pierre-Henry F." Cc: "emacs-orgmode\\\\@gnu.org" Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=phfrohring.com header.s=protonmail header.b=HYDQ7YuP; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: 1.29 X-TUID: 4rTQVfzyOfc3 Thank you very much for your replies. Here is the use case: |-----------+--------| | something | :next: | |-----------+--------| I would like :next: to show up using an arbitrary face. As suggested by Ihor, I tried: (font-lock-add-keywords 'org-mode '(("\\W\\(:next:\\)\\W" 1 font-lock-warning-face prepend))) in my init.el It does not work either. @Christian yes, it's the same syntax as tags, I would like to extend it eve= ntually. Thanks, PHF =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original Me= ssage =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 On Friday, September 25, 2020 9:26 AM, Ihor Radchenko = wrote: > > (add-to-list 'org-font-lock-extra-keywords > > It is internal variable. You should not use it. > > Simply use font-lock-add-keywords instead. > > Best, > Ihor > > "Pierre-Henry F." contact@phfrohring.com writes: > > > Hello, > > I would like to extend the org-mode markup. > > For example, I would like to change the face of a keyword, say: :next: = . > > Whenever :next: is displayed from an org-mode buffer, it should show up= in using an arbitrary face. > > I tried this: > > (defun org-add-my-extra-markup () > > (add-to-list 'org-font-lock-extra-keywords > > '("[^\\w]\\(:next:\\)[^\\w]" > > (1 font-lock-warning-face t)))) > > (add-hook 'org-font-lock-set-keywords-hook #'org-add-my-extra-markup) > > But it does not work. > > So: how to extend org-mode markup? > > Many thanks, > > PHF