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 6OPYNyambV+JBAAA0tVLHw (envelope-from ) for ; Fri, 25 Sep 2020 08:11:18 +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 ADiPMyambV+nSgAAB5/wlQ (envelope-from ) for ; Fri, 25 Sep 2020 08:11:18 +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 65CED9404D5 for ; Fri, 25 Sep 2020 08:11:18 +0000 (UTC) Received: from localhost ([::1]:40726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLip3-0001Xj-C5 for larch@yhetil.org; Fri, 25 Sep 2020 04:11:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLinT-0001Xb-AB for emacs-orgmode@gnu.org; Fri, 25 Sep 2020 04:09:39 -0400 Received: from mailer-211-194.hitrost.net ([91.185.211.194]:4787) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLinR-0008Mv-4y for emacs-orgmode@gnu.org; Fri, 25 Sep 2020 04:09:38 -0400 Received: from lk.84.20.244.182.dc.cable.static.lj-kabel.net ([84.20.244.182] helo=Tauriel) by b1.hitrost.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1kLinO-007ZBe-Go; Fri, 25 Sep 2020 10:09:34 +0200 References: <871riq5nbe.fsf@localhost> User-agent: mu4e 0.9.19; emacs 25.3.2 From: Christian Moe To: "Pierre-Henry F." Subject: Re: Help: how to extend org-mode markup? In-reply-to: Date: Fri, 25 Sep 2020 10:07:38 +0200 Message-ID: <877dsii8j9.fsf@christianmoe.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-GeoIP: Country [IP], SI [84.20.244.182] X-Antivirus-Scanner: Clean mail though you should still use an Antivirus Received-SPF: pass client-ip=91.185.211.194; envelope-from=mail@christianmoe.com; helo=mailer-211-194.hitrost.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/25 03:26:34 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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=none; 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.49 X-TUID: gIEZ4xwoYW5j Please disregard my response. I misunderstood both your intention and the use of font-lock keywords. Sorry for the noise. :-( Yours, Christian Pierre-Henry F. writes: > 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 eventually. > > > Thanks, > PHF > > ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ > 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