all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* font-lock-number-face
@ 2010-11-04 18:19 Ritchie
  2010-11-05 10:31 ` font-lock-number-face Sébastien Vauban
  2010-12-17 22:24 ` font-lock-number-face Stefan Monnier
  0 siblings, 2 replies; 5+ messages in thread
From: Ritchie @ 2010-11-04 18:19 UTC (permalink / raw)
  To: help-gnu-emacs

I'm trying to add a new face in my config file so that all the numbers
will have different color. Here is what I have:

(make-face 'font-lock-number-face)
(set-face-foreground 'font-lock-number-face "DodgerBlue4")
(setq font-lock-number-face 'font-lock-number-face)
(defvar font-lock-number "[0-9]+\\([eE][+-]?[0-9]*\\)?")
(defvar font-lock-hexnumber "0[xX][0-9a-fA-F]+")

(add-hook 'font-lock-mode-hook
          #'(lambda ()
              (setq font-lock-keywords
                    (append font-lock-keywords
                            (list
                             (list (concat "\\<\\(" font-lock-number "\
\)\\>" )
                                   (list 0 font-lock-number-face))
                             (list (concat "\\<\\(" font-lock-
hexnumber "\\)\\>" )
                                   (list 0 font-lock-number-face))
                             )))))

This works fine for most modes, except multi-term. When I startup
multi-term, the terminal text color will be all black and white. I can
turn terminal's color back to normal by turning off font-lock-mode
manually, but I couldn't find a way to turn it off automatically.

I tried this:

(add-hook 'term-mode-hook
          #'(lambda ()
              (font-lock-mode nil)))

it didn't work. I think I could try to add something in font-lock-mode-
hook to check if it is term-mode, but I don't know how to get current
mode name.

Anybody has any suggestions?

Thank you in advance

Ritchie



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-12-17 22:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-04 18:19 font-lock-number-face Ritchie
2010-11-05 10:31 ` font-lock-number-face Sébastien Vauban
     [not found]   ` <6571e80e-43d2-4f68-9f78-be1d02d1dcab@o11g2000prf.googlegroups.com>
2010-12-17  4:56     ` font-lock-number-face Ritchie
2010-12-17  9:14   ` font-lock-number-face Elena
2010-12-17 22:24 ` font-lock-number-face Stefan Monnier

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.