From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.help Subject: Re: Font-Locking for Allout Mode Date: Thu, 08 Mar 2007 23:45:04 +0100 Message-ID: <87vehbtkwf.fsf@escher.local.home> References: <87mz2o3jib.fsf@baldur.tsdh.de> <877itrn86x.fsf@baldur.tsdh.de> <87tzwvlmad.fsf@baldur.tsdh.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1173393949 18342 80.91.229.12 (8 Mar 2007 22:45:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 8 Mar 2007 22:45: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 Thu Mar 08 23:45:43 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 1HPRMj-0005Cb-OP for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Mar 2007 23:45:42 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HPRMy-0005Ix-N2 for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Mar 2007 17:45:56 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HPRMk-0005Iq-Vi for help-gnu-emacs@gnu.org; Thu, 08 Mar 2007 17:45:43 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HPRMj-0005IS-6N for help-gnu-emacs@gnu.org; Thu, 08 Mar 2007 17:45:42 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HPRMj-0005IJ-05 for help-gnu-emacs@gnu.org; Thu, 08 Mar 2007 17:45:41 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HPRMS-0002lj-JQ for help-gnu-emacs@gnu.org; Thu, 08 Mar 2007 17:45:24 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1HPRMJ-00052o-D2 for help-gnu-emacs@gnu.org; Thu, 08 Mar 2007 23:45:15 +0100 Original-Received: from i577bcf4d.versanet.de ([87.123.207.77]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 08 Mar 2007 23:45:15 +0100 Original-Received: from Stephen.Berman by i577bcf4d.versanet.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 08 Mar 2007 23:45:15 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 101 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: i577bcf4d.versanet.de User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.93 (gnu/linux) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:41814 Archived-At: On Thu, 08 Mar 2007 17:42:18 +0100 Tassilo Horn wrote: > Stephen Berman writes: > >> You cannot see the fontified allout headings in emacs lisp mode >> because the emacs lisp comment fontification overrides it. > > No, I don't think so. I fontify TODO and FIXME, too, even though they're > fontified with camment-face by default. I forgot about this possibility. I guess I really have no idea then; hopefully someone who understands font-locking well will chime in. >> If you use allout with a text-mode file, then you'll see the >> fontification. > > Nope, I changed the first line of my .emacs to > > ;;; -*- mode: text -*- -*-coding: utf-8 -*- > > but when I opened it no fontification was done, although allout was > activated automatically. I meant you should add the file local variable `mode: allout' to a file you are visiting in the major mode Text Mode. However, if the file you are visiting in Text Mode is ~/.emacs, presumably your allout headings beginning with `;;;_' and if so, they won't match allout-regexp for Text Mode, so won't get fontified. Try saving the following as `allout-test.txt'; I would be surprised, and mystified, if you still don't see the fontification. * test .. test test . , test test . . test . , test . . test test . , test . . test . , test * file local variables list Local variables: allout-layout: (+ :) mode: allout End: >> I use the same code you do (I had also found it on emacswiki and >> modified it as you did). What I meant is that I don't know why it's >> necessary to add the file local variable for allout-mode (or >> alternatively, invoke font-lock-fontify-buffer) to see the >> fontification using that code, so maybe the code isn't quite right. > > Hm, maybe. But I think the "mode: allout" can be omitted nowadays. I > guess I use a newer allout-version than you and it switches on if it > finds the local variable "allout-layout". > > ,---- > | allout-version is a variable defined in `allout.el'. > | Its value is "2.2.1" > `---- > > ,----[ C-h f allout-init RET ] > | allout-init is an interactive compiled Lisp function in `allout.el'. > | (allout-init &optional MODE) > | > | Prime `allout-mode' to enable/disable auto-activation, wrt > | `allout-layout'. > | ^^^^^^^^^^^^^^^ > `---- I also get "2.2.1" for allout-version. But I did not mean that I need to use "mode: allout" to get hiding, navigation, etc. in allout-mode to work, but only that I need it to get fontification upon visiting a suitable file using the code adapted from the Emacs Wiki. That's why I speculated that that code may be buggy, since indeed, you don't normally need to have the file local variable "mode: allout". >> BTW, when I add ";;mode: allout" to an the Local Variables section of >> an Emacs lisp file with an allout-layout specification, I still get >> the expected hiding, so it puzzles me that you don't. Did you eval >> (allout-init t) before visiting the file? > > That's in my .emacs. I think that's omitted in the new allout version > with respect to allout-layout. In my allout.el (2.2.1) the docstring of allout-init ends: "To prime your Emacs session for full auto-outline operation, include the following two lines in your Emacs init file: (require 'allout) (allout-init t)" Since you have it in yours, I'm at a loss to explain the different behaviors you and I are observing. Steve Berman