From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "seberino@spawar.navy.mil" Newsgroups: gmane.emacs.help Subject: Adding to font-lock-keywords doesn't seem to immediately take effect? Date: Wed, 3 Dec 2008 12:30:52 -0800 (PST) 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 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1228336909 27877 80.91.229.12 (3 Dec 2008 20:41:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Dec 2008 20:41:49 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 03 21:42:52 2008 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 1L7yYd-0004TR-Jn for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Dec 2008 21:42:51 +0100 Original-Received: from localhost ([127.0.0.1]:60903 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L7yXT-0003KE-AZ for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Dec 2008 15:41:39 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!f40g2000pri.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 33 Original-NNTP-Posting-Host: 129.46.155.118 Original-X-Trace: posting.google.com 1228336252 8461 127.0.0.1 (3 Dec 2008 20:30:52 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 3 Dec 2008 20:30:52 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: f40g2000pri.googlegroups.com; posting-host=129.46.155.118; posting-account=VkuUtQkAAADKqMjRUmZTNs7a8uCSNNy2 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.3) Gecko/2008101315 Ubuntu/8.10 (intrepid) Firefox/3.0.3, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:165024 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:60349 Archived-At: I'm trying to write a simple toy mode that highlights chars after column 80...... (define-minor-mode warning80-mode " " nil " W80" nil (if warning80-mode (font-lock-add-keywords nil '(("^.\\{80\\}\\(.*\\)$" 1 font-lock-warning-face prepend))) (font-lock-remove-keywords nil '(("^.\\{80\\}\\(.*\\)$" 1 font-lock-warning-face prepend)))) (font-lock-fontify-buffer)) It successfully highlights chars past column 80 and turns off successfully. The problem is that I must turn the mode on and off a few times to get it to start working. Also, after it starts to "work"....it makes EVERYTHING be highlighted thereafter as if it is ALL past col 80!!! Any help greatly appreciated. Chris