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 oHAmMg2nbV9LHQAA0tVLHw (envelope-from ) for ; Fri, 25 Sep 2020 08:15:09 +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 aL/mLQ2nbV/bTAAAB5/wlQ (envelope-from ) for ; Fri, 25 Sep 2020 08:15:09 +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 1A5649404D5 for ; Fri, 25 Sep 2020 08:15:09 +0000 (UTC) Received: from localhost ([::1]:46072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLisl-000400-DR for larch@yhetil.org; Fri, 25 Sep 2020 04:15:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43540) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLisA-0003ze-MU for emacs-orgmode@gnu.org; Fri, 25 Sep 2020 04:14:30 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]:40657) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kLis8-0000gV-Se for emacs-orgmode@gnu.org; Fri, 25 Sep 2020 04:14:30 -0400 Received: by mail-pf1-x429.google.com with SMTP id x123so2422242pfc.7 for ; Fri, 25 Sep 2020 01:14:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=CWkDIvvx0JHQhHjSnFHQsn/mvSFN9yTH5H8mtfVsVm0=; b=l7eaTpnSDk0crIT9LTc2THoLuJkBryx3IT77daFGlw93JqRpeuHFCXhvt4xCcugkY3 fuebWC7iCZY4VE4eW++yDfkJtrggETCyI0AR0HWodMnuX+B2aYcfBtlapOzTODn8UhIo rST1qvE7x7H4QSCUz9F7JlipNj6/LiW/Aii0iMfjU9x3gNga+vn8igyOOoVNlEbk/an6 pOajDKqofZ0n8m/A+Sr5iiat1oH+mr7T71nsfrfRB0H3PIe3ejMYlt+JXcVD4od4TdP8 gdlrmYl+Pfiy/HXj9g18RDDP3erl/rCOA9vqP5W0acOyanR0LVZAHPvBlOKF97/WTS7M 3pJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=CWkDIvvx0JHQhHjSnFHQsn/mvSFN9yTH5H8mtfVsVm0=; b=l/wlFNNZ0Wd19rbhljw64GKyAN6UcMZmLEk/yD1AZ4oreNXAaPVnI8G805w1IKf2Pv Jb5mA6OhUHweJGkYiRBiur/UiPnCdNidlRK4b6TfvJx9NHRe4c2LzxOpz533I74cg3qx 6qn4MU5na8wFEczSKHH2IOW4sskS1iybS2GHjSR9DChlFHvZvlkZaaGz4PT9NW+01jXY DE3hUPK2aVTMdxBLYxwXFWd/m8JBoespb/Es2F/L57IpLYEfOQ+1ZnAUiZpjryOAJKzk Z1fh1Mfp8x47p3PKiutyck2AavGBP6HZlC5zSzPNhHld5nmJtyK+Z7TSEVInu30uM81i A1uw== X-Gm-Message-State: AOAM530J3Tq8FQlpQSdzdqNlCBg1lW4WaF2CuwcgUxcQnNKKP1dm12+t lxFhx41lziAsixOsc3jnoSM= X-Google-Smtp-Source: ABdhPJxSJqz4hdBz5r0pGYk41Ouz4u/LMuQ8SlIlEwdHhuu3wxmzL2Liii6ND9Aq+aJjQ55JNGP4MA== X-Received: by 2002:a63:3856:: with SMTP id h22mr2519277pgn.451.1601021667251; Fri, 25 Sep 2020 01:14:27 -0700 (PDT) Received: from localhost ([104.250.131.79]) by smtp.gmail.com with ESMTPSA id d128sm1837740pfc.8.2020.09.25.01.14.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 01:14:26 -0700 (PDT) From: Ihor Radchenko To: "Pierre-Henry F." Subject: Re: Help: how to extend org-mode markup? In-Reply-To: References: <871riq5nbe.fsf@localhost> Date: Fri, 25 Sep 2020 16:13:22 +0800 Message-ID: <87y2ky46l9.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=yantar92@gmail.com; helo=mail-pf1-x429.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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=pass header.d=gmail.com header.s=20161025 header.b=l7eaTpnS; dmarc=pass (policy=none) header.from=gmail.com; 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: 5h33t0ihm9+q > 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 it _after_ 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." 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 e= ventually. > > > Thanks, > 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 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 u= p 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