From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id kAKbHQWrbV+5SwAA0tVLHw (envelope-from ) for ; Fri, 25 Sep 2020 08:32:05 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id MCspFwWrbV8xeAAAbx9fmQ (envelope-from ) for ; Fri, 25 Sep 2020 08:32:05 +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 AAB309404D5 for ; Fri, 25 Sep 2020 08:32:04 +0000 (UTC) Received: from localhost ([::1]:34914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLj99-0003eW-LJ for larch@yhetil.org; Fri, 25 Sep 2020 04:32:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47930) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLj8l-0003eN-BL for emacs-orgmode@gnu.org; Fri, 25 Sep 2020 04:31:39 -0400 Received: from mail-40136.protonmail.ch ([185.70.40.136]:30797) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLj8i-0002nB-WD for emacs-orgmode@gnu.org; Fri, 25 Sep 2020 04:31:38 -0400 Date: Fri, 25 Sep 2020 08:31:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=phfrohring.com; s=protonmail; t=1601022694; bh=gASKkGoqL3L9MMo/O1coT8+Gu6ZSv+kLVskKgO2WXt4=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=ovlWY5cluFJJFjk9c7O0iAuRbO3gENLD/obVr4iW6rfICsYcnceOsVLDDEtMLd3k8 nZlFm/ZtA+Kux1AtyaPqtWsxcAfq2iFFtVQWW2Ps6sI5Gtz5v/xt86Joy+32pyhIh8 i4uWD+dYb0GpheGOttJ6i2Hq3Pq4gHxWn2pSCFes= To: Ihor Radchenko From: "Pierre-Henry F." Subject: Re: Help: how to extend org-mode markup? Message-ID: In-Reply-To: <87y2ky46l9.fsf@localhost> References: <871riq5nbe.fsf@localhost> <87y2ky46l9.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.136; envelope-from=contact@phfrohring.com; helo=mail-40136.protonmail.ch X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/25 04:31:34 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_H3=0.001, RCVD_IN_MSPIKE_WL=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=ovlWY5cl; 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: u1HCe1zxyEqB Thank you Ihor, It does work... too good now :-) all the other faces are gone Well, OK... I will check that an other time. Thank you all for your replies ! 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 10:13 AM, Ihor Radchenko = wrote: > > As suggested by Ihor, I tried: > > > (font-lock-add-keywords 'org-mode > > '(("\\W\\(:next:\\)\\W" 1 font-lock-warning-face prepend))) > > You need to fontify itafter all other org-mode font settings: > > (font-lock-add-keywords 'org-mode > '(("\\W\\(:next:\\)\\W" 1 font-lock-warning-face prepend) 'append)) > > Best, > Ihor > > "Pierre-Henry F." contact@phfrohring.com 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 > > =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Origina= l Message =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 yantar92@gmail.co= m 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: :ne= xt: . > > > > Whenever :next: is displayed from an org-mode buffer, it should sho= w 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-marku= p) > > > > But it does not work. > > > > So: how to extend org-mode markup? > > > > Many thanks, > > > > PHF