emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jeremie Juste <jeremiejuste@gmail.com>
To: Will Pierce <pierwill@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Fontify text between quotes?
Date: Wed, 21 Nov 2018 20:38:24 +0100	[thread overview]
Message-ID: <87r2fenrv3.fsf@gmail.com> (raw)
In-Reply-To: <CAF-DrMipoJEpcxya=gkeeZDEGyULGuf-Wuf+-bJfB-yz70D8qQ@mail.gmail.com> (Will Pierce's message of "Wed, 21 Nov 2018 11:30:24 -0600")

Hello,

You can in principle tap directly into font lock-mode.
For instance something like

 (add-hook 'org-mode-hook
	   (lambda ()
	     (font-lock-add-keywords nil
				     '(("\\<\\(FIXME\\):" 1 'font-lock-warning-face prepend)
				       ("\\<\\(and\\|or\\|not\\)\\>" .
					'font-lock-keyword-face)))))




would fontify [FIXME:], [and] [or] ,and [not], without the [], in org-mode, See the
doc of font-lock-add-keywords (just stole the code above from it)

I could not achieve what you want though. Don't have enough time and energy
to think about it now, and I'm very bad with regex. :-). But in
principle it should do the job,

Hope this helps,

Jeremie



> Hi all,
>
> I'd like to add a function that changes the face of any text in quotation
> marks. I looked a bit into adapting the existing org code for emphasis, but
> got bogged down. I'd like "text like this" to use the org-block face.
>
> Any help pointing me in the right direction on this would be much
> appreciated!
>
> –W

  reply	other threads:[~2018-11-21 19:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-21 17:30 Fontify text between quotes? Will Pierce
2018-11-21 19:38 ` Jeremie Juste [this message]
2018-11-21 20:50   ` Will Pierce
2018-11-22  6:44     ` 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=87r2fenrv3.fsf@gmail.com \
    --to=jeremiejuste@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=pierwill@gmail.com \
    /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).