From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kirill Kuvaldin Newsgroups: gmane.emacs.help Subject: Re: keywords highlighting Date: 8 Feb 2006 08:08:55 +0100 Organization: X-Privat NNTP Server - http://www.x-privat.org Message-ID: <87irrqe3ab.fsf@utero.home> References: <87u0bbhssj.fsf@utero.home> <1139345272.491088.302860@g44g2000cwa.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1139382631 4942 80.91.229.2 (8 Feb 2006 07:10:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 8 Feb 2006 07:10:31 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 08 08:10:29 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F6jT6-0000OO-M6 for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Feb 2006 08:10:24 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F6jT5-00065T-W0 for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Feb 2006 02:10:24 -0500 Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:Rq7Z4py33WJb/VUpGjxNaJVsfew= Original-NNTP-Posting-Host: $$_jwdm_imsh1.x-privat.org Original-Lines: 40 X-Authenticated-User: $$o9fo6pr-suhxkoyemw Original-X-Complaints-To: abuse@x-privat.org Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!npeer.de.kpn-eurorings.net!ndsoftware.com!ciril.fr!newsfeed.x-privat.net!x-privat.org!news.in.utero.home!news Original-Xref: shelby.stanford.edu gnu.emacs.help:137440 Original-To: help-gnu-emacs@gnu.org 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:33064 Archived-At: Tim Johnson writes: > Kirill, I recommend that you do an appropos search on > "font" "font-lock", etc. As in C-h, a, "font-lock". > > More advanced users can tell you what file extensions > that emacs "knows about automatically", in my case: > here is an example from my .emacs file: Everythink ok with fontlocking, by keywords highlighting I didn't mean the syntax highlighting. It's that emacs does by default. I meant that keywords (FIXME, TODO) should be highlighted wherever they occur, I'd like to use them in my code in comments representing the places in code that need to be modified in future. Just found such solution: (setq keyword-highlight-modes '(php-mode java-mode c-mode c++-mode emacs-lisp-mode scheme-mode)) (make-face 'font-lock-fixme-face) (make-face 'font-lock-todo-face) (mapc (lambda (mode) (font-lock-add-keywords mode '(("\\<\\(FIXME\\)" 1 'font-lock-fixme-face t)))) keyword-highlight-modes) (mapc (lambda (mode) (font-lock-add-keywords mode '(("\\<\\(TODO\\)" 1 'font-lock-todo-face t)))) keyword-highlight-modes) (modify-face 'font-lock-fixme-face "black" "yellow" nil t nil t nil nil) (modify-face 'font-lock-todo-face "black" "yellow" nil t nil nil nil nil) -- kuvkir