all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Haines Brown <haines@histomat.net>
To: help-gnu-emacs@gnu.org
Subject: Re: colorization of mode contents
Date: Sat, 25 Jan 2014 10:55:05 -0500	[thread overview]
Message-ID: <87ha8sgip2.fsf@engels.HistoricalMaterialism.info> (raw)
In-Reply-To: 87zjmk4078.fsf@nl106-137-194.student.uu.se

Emanuel Berg <embe8573@student.uu.se> writes:

> Haines Brown <haines@histomat.net> writes:
>
>> In LaTeX/PS mode, the \cite{key} command displays key
>> values in green in the raw .tex file. This makes it
>> easy to spot the command in a block of text.
>
> Try:
>
> (font-lock-add-keywords
>  'latex-mode
>  '(("citeNP\{\\(.*\\)\}" (1 'font-lock-comment-face))))

Unfortunately, nothing happened. 

> If nothing happens, after eval, 

Being a LISP ignoramus, I tried C-x C-e after each of the parentheses or
brackets. Starting at end (after "...))))" I got "nil", then simply an
echo of the string, then / is invalid function, then } is void variable.
Sorry. 

> try (latex-mode) 

I don't understand what you want. I tied replacing 'latex-mode with
'(latex-mode) to no avail. 

> or `M-x latex-mode'. 

Given my setup, this runs spell check, and the key values in
\citeNP{key} naturlly turn red as the result. When the cursor hits
them,the red turns off, but I return to black foreground color for the
{key} value, not the forest green I wanted.

Toggling M-x font-lock-mode didn't help any more than toggling M-x
latex-mode. 

I tried:

  (add-hook 'latex-mode
     (lambda ()
      (font-lock-add-keywords nil
        '(("citeNP\{\\(.*\\)\}" (1 'font-lock-constant-face))))))

and didn't do any better with it. I changed to constant-face because
my comment-face with command package is black foreground.

Haines


  reply	other threads:[~2014-01-25 15:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-24 16:43 colorization of mode contents Haines Brown
2014-01-25 14:14 ` Emanuel Berg
2014-01-25 15:55   ` Haines Brown [this message]
2014-01-25 17:15     ` Emanuel Berg
2014-01-25 20:56   ` Haines Brown
2014-01-25 23:05     ` Emanuel Berg
2014-01-25 23:21       ` Emanuel Berg
2014-01-26 12:35       ` Haines Brown
2014-01-26 15:51         ` Emanuel Berg
2014-01-27 15:49           ` Haines Brown
2014-01-27 16:56             ` Emanuel Berg
2014-01-27 19:36               ` Haines Brown
2014-01-25 21:27   ` 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

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

  git send-email \
    --in-reply-to=87ha8sgip2.fsf@engels.HistoricalMaterialism.info \
    --to=haines@histomat.net \
    --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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.