unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Tim Visher <tim.visher@gmail.com>
To: Luca Ferrari <fluca1978@infinito.it>
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: set font for TODO
Date: Mon, 3 Jun 2013 08:43:55 -0400	[thread overview]
Message-ID: <CAHa53uyAzN0NuDyCQFtPLBGHe1ynJrD9LanXbGDcNeSLmiP0YQ@mail.gmail.com> (raw)
In-Reply-To: <CAKoxK+6mUZWGSvLGyx_p1Ng_9gwTFPuRsHPKWcOJp2ef87p70A@mail.gmail.com>

On Mon, Jun 3, 2013 at 2:54 AM, Luca Ferrari <fluca1978@infinito.it> wrote:
> this could be trivial but I cannot find a solution: I'd like to
> emphasize some warning/todo words with a special font, so in the
> beginning I did:
>
> (custom-set-faces
>  '(font-lock-warning-face ((t (:foreground "Yellow" :weight bold  )))) )
>
> (defun fluca1978/fontify-fixme ()
>   (font-lock-add-keywords
>    nil '(("\\<\\(FIX\\|TODO\\|FIXME\\|HACK\\|REFACTOR\\|XXX\\)[ \t\s\n:]*"
>           1 font-lock-warning-face t))))
>
>
> but of course this has the side effect to fontify also every other
> string that emacs applies warning-face to. So how can I isolate my
> keyword list from the emacs one?

You'll probably need to define your own custom face, maybe having it
inherit from font-lock-warning-face, and then have font-lock apply
your new face rather than the old face to your keywords.

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail



  reply	other threads:[~2013-06-03 12:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-03  6:54 set font for TODO Luca Ferrari
2013-06-03 12:43 ` Tim Visher [this message]
2013-06-03 13:11   ` Luca Ferrari
     [not found]   ` <mailman.925.1370265110.22516.help-gnu-emacs@gnu.org>
2013-06-13 14:44     ` Stefan Monnier

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.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHa53uyAzN0NuDyCQFtPLBGHe1ynJrD9LanXbGDcNeSLmiP0YQ@mail.gmail.com \
    --to=tim.visher@gmail.com \
    --cc=fluca1978@infinito.it \
    --cc=help-gnu-emacs@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.
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).