From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ritchie Newsgroups: gmane.emacs.help Subject: font-lock-number-face Date: Thu, 4 Nov 2010 11:19:23 -0700 (PDT) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1291881275 21283 80.91.229.12 (9 Dec 2010 07:54:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 07:54:35 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 09 08:54:31 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQbKg-0006HR-30 for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 08:54:30 +0100 Original-Received: from localhost ([127.0.0.1]:47483 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQbKf-0006Bu-8S for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 02:54:29 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!x7g2000prj.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 43 Original-NNTP-Posting-Host: 139.182.55.233 Original-X-Trace: posting.google.com 1288894763 30422 127.0.0.1 (4 Nov 2010 18:19:23 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 4 Nov 2010 18:19:23 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: x7g2000prj.googlegroups.com; posting-host=139.182.55.233; posting-account=CuLrKQoAAACxi2VsGphG0_-Zo9Puh4B0 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.41 Safari/534.7, gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:182207 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:76847 Archived-At: 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