From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marc Croteau Newsgroups: gmane.emacs.help Subject: Re: allout and font-locking Date: Wed, 07 Mar 2012 15:52:07 -0500 Organization: Here And Now Message-ID: <87ipigcex4.wl%mdcroteau@gmail.com> References: <87zkbthc6d.wl%mdcroteau@gmail.com> <8762eg5fvv.fsf@escher.home> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: dough.gmane.org 1331153548 30138 80.91.229.3 (7 Mar 2012 20:52:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 7 Mar 2012 20:52:28 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Stephen Berman Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Mar 07 21:52:26 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S5NqP-0003HN-HW for geh-help-gnu-emacs@m.gmane.org; Wed, 07 Mar 2012 21:52:21 +0100 Original-Received: from localhost ([::1]:52606 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5NqO-0005Gx-VR for geh-help-gnu-emacs@m.gmane.org; Wed, 07 Mar 2012 15:52:20 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:33035) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5NqJ-0005Gs-0h for help-gnu-emacs@gnu.org; Wed, 07 Mar 2012 15:52:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5NqH-0004le-4m for help-gnu-emacs@gnu.org; Wed, 07 Mar 2012 15:52:14 -0500 Original-Received: from mail-vw0-f41.google.com ([209.85.212.41]:57506) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5NqG-0004lH-U5 for help-gnu-emacs@gnu.org; Wed, 07 Mar 2012 15:52:13 -0500 Original-Received: by vbbey12 with SMTP id ey12so6700642vbb.0 for ; Wed, 07 Mar 2012 12:52:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:message-id:from:to:cc:subject:in-reply-to:references :user-agent:organization:mime-version:content-type; bh=5vl/IhTnIQpzkY0hn+becENnXEWa6iq2nAkt4GKcyOE=; b=juG7CYy/3EKCcu6La9IaIFi6c4uuDBmaKaryP7c5hWAAcWGNbtVdLjkRuZ5gGVSm/B 2VSlT1n+w509SwK9IWp++67YSumXvXCDlY5yfSO+ta3CrdfrLrJtwTG/g3v23CpYwx8x kv+/EWoeL7M8QTfxiw8+CpiYQdEu6pcAMs5w0nSMOl5tn8AKTXSOpXye8sfhdPCFM8F9 QWYugB2uztqvdQzwIvKNQWDzuzr/8IkP1+TMtxpsJjc3lEHtnDodJbIn2WvKct4lHm16 AMoK9cgClFcOy2e0wcfWf1xeDc9X8N8Sjk5sOPIv+UiXr8L76AoTjHh1d/IffnJ+MYGM Bb6g== Original-Received: by 10.52.68.206 with SMTP id y14mr5699913vdt.107.1331153530378; Wed, 07 Mar 2012 12:52:10 -0800 (PST) Original-Received: from mdc-home.gmail.com (CPE001cf067dcb9-CM0019477f64c0.cpe.net.cable.rogers.com. [99.242.17.202]) by mx.google.com with ESMTPS id a19sm38357107vdh.12.2012.03.07.12.52.08 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 07 Mar 2012 12:52:09 -0800 (PST) In-Reply-To: <8762eg5fvv.fsf@escher.home> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/23.3 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.212.41 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:83973 Archived-At: Hi Stephen, As you suggested, the color highlights came through. My mistake was that in tracking down the code suggestions various people had made, I put your code in but did not add the very necessary code: (defun srb-allout-font-lock-mode () > (font-lock-add-keywords nil srb-allout-font-lock-keywords)) > (add-hook 'allout-mode-hook 'srb-allout-font-lock-mode) to my .init file. Once again, Thanks a bunch and sorry to have wasted your time. Regards, Marc > On Tue, 06 Mar 2012 12:27:54 -0500 Marc Croteau wrote: >> I'm having problems getting the font-locking features to work. I hope >> someone can help me. >> I have allout (version 2.3) working just fine but the color highlighting is NOT >> working. >> >> I'm running emacs 23.3 on a ubuntu box running 11.10. >> I've tried the suggestions made in (1) the emacswiki with respect to >> (defvar rf-allout-font-lock-keywords... >> and (2) suggestions in this mailing list by Stephen Berman and also >> Tassilo Horn and don't seem to get the color highlighting I'm >> expecting. > The code I posted here five years ago still works for me on openSUSE's > Emacs 23.3 (as well as with the current trunk). I tested by saving your > test file, starting emacs with -Q and evaluating the following: > --8<---------------cut here---------------start------------->8--- > (require 'allout) > (require 'allout-widgets) > (allout-init t) > (defvar srb-allout-font-lock-keywords > '((eval . (list (concat "^\\(" allout-regexp "\\).+") > 0 '(cond ((= (allout-depth) 1) > font-lock-function-name-face) > ((= (allout-depth) 2) > font-lock-variable-name-face) > ((= (allout-depth) 3) > font-lock-keyword-face) > ((= (allout-depth) 4) > font-lock-builtin-face) > ((= (allout-depth) 5) > font-lock-comment-face) > ((= (allout-depth) 6) > font-lock-constant-face) > ((= (allout-depth) 7) > font-lock-type-face) > ((= (allout-depth) 8) > font-lock-string-face) > (t font-lock-warning-face)) > t nil))) > "Additional expressions to highlight in Allout mode.") > (defun srb-allout-font-lock-mode () > (font-lock-add-keywords nil srb-allout-font-lock-keywords)) > (add-hook 'allout-mode-hook 'srb-allout-font-lock-mode) > --8<---------------cut here---------------end--------------->8--- > Then I visited the test file and each instance of "test" had a different > color. Can you try the same test? > Steve Berman