From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id iJsSFSO+bV9mOwAA0tVLHw (envelope-from ) for ; Fri, 25 Sep 2020 09:53:39 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id EIUxESO+bV/TJAAA1q6Kng (envelope-from ) for ; Fri, 25 Sep 2020 09:53:39 +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 686379407C8 for ; Fri, 25 Sep 2020 09:53:38 +0000 (UTC) Received: from localhost ([::1]:53814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLkQ4-0000NB-0R for larch@yhetil.org; Fri, 25 Sep 2020 05:53:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37174) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLkPg-0000Mn-CZ for emacs-orgmode@gnu.org; Fri, 25 Sep 2020 05:53:12 -0400 Received: from mail-40133.protonmail.ch ([185.70.40.133]:59755) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLkPe-0004KK-B7 for emacs-orgmode@gnu.org; Fri, 25 Sep 2020 05:53:12 -0400 Date: Fri, 25 Sep 2020 09:52:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=phfrohring.com; s=protonmail; t=1601027587; bh=6ELKlVcuVPeelMj7AtR0VdvUWc7A8vTktOe/jHLJoSQ=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=y3YT20XoNnbyIZhF8Zl8OjSJQhjKKvh6J1RXlpQjpfiL7srwq2aieqTVaapLTrH5b NF7kgPPh6MCdLnAEZ2oHdAmTOBQGPpCE77jyl2LsmFm11jmXHU8rpK7iTJWn2slKaL mmfmtlSYwZS1KODkbCS1fwAs0A64bsby+8npC43o= To: Ihor Radchenko From: "Pierre-Henry F." Subject: Re: Help: how to extend org-mode markup? Message-ID: In-Reply-To: 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.133; envelope-from=contact@phfrohring.com; helo=mail-40133.protonmail.ch X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/25 05:53:07 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=y3YT20Xo; 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: -0.21 X-TUID: o6l9YmyL104v Well, this works! Thank you all! (defun user-custom-keywords () ;; M-x list-faces-display (let ((user-custom-keywords '((":next:" . 'org-habit-clear-face) (":wait:" . 'org-habit-alert-face) (":failed:" . 'org-habit-overdue-face) (":success:" . 'org-habit-ready-face) (":unscheduled:" . 'avy-lead-face-0)))) (dolist (elt user-custom-keywords) (let ((regex (car elt)) (face (cdr elt))) (font-lock-add-keywords nil `((,regex 0 ,face t)) 'append))))) Cordialement, Pierre-Henry FR=C3=96HRING +33 6 34 48 17 57 contact@phfrohring.com Skype: pierre.henry.frohring =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:31 AM, Pierre-Henry F. wrote: > 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 = 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 10:13 AM, Ihor Radchenko yantar92@gmail.com= 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 Origi= nal 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.= com 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 s= how 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-mar= kup) > > > > > But it does not work. > > > > > So: how to extend org-mode markup? > > > > > Many thanks, > > > > > PHF