emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Florian Beck <fb@fbeck.net>
To: emacs-orgmode@gnu.org
Subject: Merging Faces
Date: Mon, 16 Oct 2017 22:56:30 +0200	[thread overview]
Message-ID: <os36dn$9sn$1@blaine.gmane.org> (raw)

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	other threads:[~2017-10-16 20:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='os36dn$9sn$1@blaine.gmane.org' \
    --to=fb@fbeck.net \
    --cc=emacs-orgmode@gnu.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public 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).