Hello everyone,

how do you add custom face properties to an org buffer?

I want to generate org buffers automatically (displaying verious entries and properties). Specifically, I want the resulting buffer in org mode to handle links, equations, and export. But I want also to add custom background or fonts to parts of the buffer.

The easiest way to see the problem is this:

(let ((entry
       (concat
        "any "
        (propertize "link" 'font-lock-face '(:family "DejaVu Sans Mono"))
" like [[file:some-file]] or equations like \\(\\sqrt{\\frac{1}{(x+y)^2\\), but also /italics/ and *bold text* should be displayed correctly;")))
  (switch-to-buffer-other-window
   "*fb-merging-example")
  (erase-buffer)
  (insert (propertize (concat "1. " entry)
                      'font-lock-face '(:background "yellow")
                      'underline t))
  (insert "\n2. other font:")
  (insert (propertize entry 'font-lock-face '(:family "Symbola")))
  (org-mode))

Two problems:
1. "link" has not the right font. I guess `propertize' doesn't merge face. Is there a way to accomplish this?
2. Links and equations don't have the desired background.

Any help appreciated.


Reply via email to