emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Pierre-Henry F." <contact@phfrohring.com>
To: Ihor Radchenko <yantar92@gmail.com>
Cc: "emacs-orgmode\\\\\\\\@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Help: how to extend org-mode markup?
Date: Fri, 25 Sep 2020 08:31:30 +0000	[thread overview]
Message-ID: <AXQc5W8R02Tccqm4D5_bJj1dKoK0qyfXs5fQqn1ZQhe2t7PO-dgOI4Pu-Wy3kjdy55YoL8wq36mk2szkREaw5XWahl7KQnLIEG9Qzny2wUo=@phfrohring.com> (raw)
In-Reply-To: <87y2ky46l9.fsf@localhost>

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

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
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
> > ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> > 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 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




  parent reply	other threads:[~2020-09-25  8:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25  6:51 Pierre-Henry F.
2020-09-25  7:24 ` Christian Moe
2020-09-25  7:26 ` Ihor Radchenko
2020-09-25  7:38   ` Pierre-Henry F.
2020-09-25  8:07     ` Christian Moe
2020-09-25  8:13     ` Ihor Radchenko
2020-09-25  8:14       ` Ihor Radchenko
2020-09-25  8:31       ` Pierre-Henry F. [this message]
2020-09-25  9:52         ` Pierre-Henry F.
2020-09-25  7:55 ` Eric S Fraga

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AXQc5W8R02Tccqm4D5_bJj1dKoK0qyfXs5fQqn1ZQhe2t7PO-dgOI4Pu-Wy3kjdy55YoL8wq36mk2szkREaw5XWahl7KQnLIEG9Qzny2wUo=@phfrohring.com' \
    --to=contact@phfrohring.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@gmail.com \
    --subject='Re: Help: how to extend org-mode markup?' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).