Re: Help: how to extend org-mode markup?

2020-09-25 Thread Pierre-Henry F.
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)

Re: Help: how to extend org-mode markup?

2020-09-25 Thread Pierre-Henry F.
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 wrote: > > As suggested by Ihor, I

Re: Help: how to extend org-mode markup?

2020-09-25 Thread Ihor Radchenko
Sorry, misplaced the argument. 'append should be the last argument to font-lock-add-keywords: (font-lock-add-keywords 'org-mode '(("\\W\\(:next:\\)\\W" 1 font-lock-warning-face prepend)) 'append) Ihor Radchenko writes: >> As suggested by Ihor, I tried: >> >> (font-lock-add-keywords

Re: Help: how to extend org-mode markup?

2020-09-25 Thread Ihor Radchenko
> 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)

Re: Help: how to extend org-mode markup?

2020-09-25 Thread Christian Moe
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: | >

Re: Help: how to extend org-mode markup?

2020-09-25 Thread Eric S Fraga
One alternative, that I use for specific org files, is ~hi-lock-mode~. Based on regular expressions, you can highlight any bits you want without affecting the underlying org font lock settings. -- : Eric S Fraga via Emacs 28.0.50, Org release_9.4-29-gbc9664

Re: Help: how to extend org-mode markup?

2020-09-25 Thread Pierre-Henry F.
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

Re: Help: how to extend org-mode markup?

2020-09-25 Thread Ihor Radchenko
> (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." writes: > Hello, > > I would like to extend the org-mode markup. > > For example, I would like to change the face of a keyword,

Re: Help: how to extend org-mode markup?

2020-09-25 Thread Christian Moe
Hello, In your example, `:next:' is a tag. Tags and keywords are different entities. https://orgmode.org/worg/dev/org-syntax.html You should be able to do what you want by customizing `org-tag-faces'. Yours, Christian Pierre-Henry F. writes: > Hello, > > I would like to extend the org-mode

Help: how to extend org-mode markup?

2020-09-25 Thread Pierre-Henry F.
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