From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?iso-8859-1?B?Tm9yZGz2dw==?= Newsgroups: gmane.emacs.help Subject: Highlighting of special word-tags in all modes Date: 6 May 2007 05:17:46 -0700 Organization: http://groups.google.com Message-ID: <1178453866.189344.143920@y5g2000hsa.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1178464893 30391 80.91.229.12 (6 May 2007 15:21:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 6 May 2007 15:21:33 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun May 06 17:21:32 2007 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.50) id 1HkiYF-0005TV-UZ for geh-help-gnu-emacs@m.gmane.org; Sun, 06 May 2007 17:21:32 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hkif7-0004Gd-IR for geh-help-gnu-emacs@m.gmane.org; Sun, 06 May 2007 11:28:37 -0400 Original-Path: shelby.stanford.edu!newshub.stanford.edu!postnews.google.com!y5g2000hsa.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 35 Original-NNTP-Posting-Host: 213.66.43.242 Original-X-Trace: posting.google.com 1178453866 7595 127.0.0.1 (6 May 2007 12:17:46 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sun, 6 May 2007 12:17:46 +0000 (UTC) User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.3) Gecko/20061201 Firefox/2.0.0.3 (Ubuntu-feisty),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: y5g2000hsa.googlegroups.com; posting-host=213.66.43.242; posting-account=T25tbw0AAADoaalO12jRFAyM2dkqq2mX Original-Xref: shelby.stanford.edu gnu.emacs.help:148166 X-Mailman-Approved-At: Sun, 06 May 2007 11:25:33 -0400 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:43771 Archived-At: Hey again, Hackers! How do I make the following code active in *all* modes in Emacs? Adding a hook to the text-mode-hook works for many but not *all* modes. Here is the code: (defvar alert-tags '("FIXME" "FixMe" "TODO" "ToDo" "TEST" "Test" "NOTE" "Note" "WARNING" "Warning" "OBS" "Obs" "OBSERVE" "Observe" ) "Special tags/words mainly used in source code comments to alert the reader about important things.") (defun alert-tags-font-locking () (font-lock-add-keywords nil (list (cons (concat "\\<\\(" (regexp-opt alert-tags) "\\):") '(1 'font-lock-warning-face prepend)) ;need prepend-merge to override inside comments ))) (add-hook 'text-mode-hook 'alert-tags-font-locking) ;all modes for now Many Thanks in advance, Nordl=F6w