unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Colourising emphasized text in org-mode
@ 2022-01-11 23:37 fatiparty--- via Users list for the GNU Emacs text editor
       [not found] ` <MtAVGSN--3-2@tutanota.com-MtAVOsm----2>
  2022-01-12  0:16 ` Michael Heerdegen
  0 siblings, 2 replies; 5+ messages in thread
From: fatiparty--- via Users list for the GNU Emacs text editor @ 2022-01-11 23:37 UTC (permalink / raw)
  To: Help Gnu Emacs


I want to colourise emphasized text in org-mode.  Am using the following code, but it is not taking effect.

(defface my-org-emphasis-bold
  '((default :inherit bold)
    (((class color) (min-colors 88) (background light))
     :foreground "#a60000")
    (((class color) (min-colors 88) (background dark))
     :foreground "#ff8059"))
  "My bold emphasis for Org.")

(setq org-emphasis-alist
      '(("*" my-org-emphasis-bold)
    ("/" italic)
    ("_" underline)
    ("=" org-verbatim verbatim)
    ("~" org-code verbatim)
    ("+" (:strike-through t))))


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Colourising emphasized text in org-mode
       [not found] ` <MtAVGSN--3-2@tutanota.com-MtAVOsm----2>
@ 2022-01-12  0:12   ` fatiparty--- via Users list for the GNU Emacs text editor
  0 siblings, 0 replies; 5+ messages in thread
From: fatiparty--- via Users list for the GNU Emacs text editor @ 2022-01-12  0:12 UTC (permalink / raw)
  To: Fatiparty; +Cc: Help Gnu Emacs

Jan 12, 2022, 11:37 by help-gnu-emacs@gnu.org:

>
> I want to colourise emphasized text in org-mode.  Am using the following code, but it is not taking effect.
>
> (defface my-org-emphasis-bold
>   '((default :inherit bold)
>     (((class color) (min-colors 88) (background light))
>      :foreground "#a60000")
>     (((class color) (min-colors 88) (background dark))
>      :foreground "#ff8059"))
>   "My bold emphasis for Org.")
>
> (setq org-emphasis-alist
>       '(("*" my-org-emphasis-bold)
>     ("/" italic)
>     ("_" underline)
>     ("=" org-verbatim verbatim)
>     ("~" org-code verbatim)
>     ("+" (:strike-through t))))
>

For italic, underline, etc I still want to use italic, underline etc, with the addition
of colouring.  Is there a neat way to do it?  At this moment I am inheriting the bold,
italic, underline attribute using a function for each.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Colourising emphasized text in org-mode
  2022-01-11 23:37 Colourising emphasized text in org-mode fatiparty--- via Users list for the GNU Emacs text editor
       [not found] ` <MtAVGSN--3-2@tutanota.com-MtAVOsm----2>
@ 2022-01-12  0:16 ` Michael Heerdegen
  2022-01-12  1:16   ` fatiparty--- via Users list for the GNU Emacs text editor
  1 sibling, 1 reply; 5+ messages in thread
From: Michael Heerdegen @ 2022-01-12  0:16 UTC (permalink / raw)
  To: help-gnu-emacs

fatiparty--- via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> writes:

> I want to colourise emphasized text in org-mode.  Am using the
> following code, but it is not taking effect.

Did you follow the "You need to reload Org or to restart Emacs after
customizing this." hint in the `org-emphasis-alist' docstring?

Michael.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Colourising emphasized text in org-mode
  2022-01-12  0:16 ` Michael Heerdegen
@ 2022-01-12  1:16   ` fatiparty--- via Users list for the GNU Emacs text editor
  2022-01-12 14:36     ` Michael Heerdegen
  0 siblings, 1 reply; 5+ messages in thread
From: fatiparty--- via Users list for the GNU Emacs text editor @ 2022-01-12  1:16 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: Help Gnu Emacs


Jan 12, 2022, 12:16 by michael_heerdegen@web.de:

> fatiparty--- via Users list for the GNU Emacs text editor
> <help-gnu-emacs@gnu.org> writes:
>
>> I want to colourise emphasized text in org-mode.  Am using the
>> following code, but it is not taking effect.
>>
>
> Did you follow the "You need to reload Org or to restart Emacs after
> customizing this." hint in the `org-emphasis-alist' docstring?
>
> Michael.
>

I followed through and can now see the colouring.  What would I have to do in order
to colourise 

("=" org-verbatim verbatim)
("~" org-code verbatim)
("+" (:strike-through t))))
For bold, italic and underline, I am using

(defface my-emphasis-bold
  '((default :inherit bold)
    (((class color) (min-colors 88) (background light))
     :foreground "#a60000")
    (((class color) (min-colors 88) (background dark))
     :foreground "#ff8059"))
  "My bold emphasis for Org.")

(defface my-emphasis-italic
  '((default :inherit italic)
    (((class color) (min-colors 88) (background light))
     :foreground "#a60000")
    (((class color) (min-colors 88) (background dark))
     :foreground "#ff8059"))
  "My underline emphasis for Org.")

(defface my-emphasis-underline
  '((default :inherit underline)
    (((class color) (min-colors 88) (background light))
     :foreground "#a60000")
    (((class color) (min-colors 88) (background dark))
     :foreground "#ff8059"))
  "My underline emphasis for Org.")

(setq org-emphasis-alist
      '(("*" my-emphasis-bold)
    ("/" my-emphasis-italic)
    ("_" my-emphasis-underline)
    ("=" org-verbatim verbatim)
    ("~" org-code verbatim)
    ("+" (:strike-through t))))


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Colourising emphasized text in org-mode
  2022-01-12  1:16   ` fatiparty--- via Users list for the GNU Emacs text editor
@ 2022-01-12 14:36     ` Michael Heerdegen
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Heerdegen @ 2022-01-12 14:36 UTC (permalink / raw)
  To: fatiparty; +Cc: Help Gnu Emacs

fatiparty@tutanota.com writes:

> What would I have to do in order to colourise
>
> ("=" org-verbatim verbatim)
> ("~" org-code verbatim)
> ("+" (:strike-through t))))

I don't see any place in the org source code where the third list
element (`verbatim`) is used.  I suggest to keep it and specify your
face in the second position as in the other entries.

(:strike-through t) is an anonymous face spec.  Nothing special with
that - put a face name or anonymous face spec there as in the other
entries.

Michael.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-01-12 14:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-11 23:37 Colourising emphasized text in org-mode fatiparty--- via Users list for the GNU Emacs text editor
     [not found] ` <MtAVGSN--3-2@tutanota.com-MtAVOsm----2>
2022-01-12  0:12   ` fatiparty--- via Users list for the GNU Emacs text editor
2022-01-12  0:16 ` Michael Heerdegen
2022-01-12  1:16   ` fatiparty--- via Users list for the GNU Emacs text editor
2022-01-12 14:36     ` Michael Heerdegen

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).