[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs revision #107149

From: Alan Mackenzie
Subject: Re: Emacs revision #107149
Date: Sat, 11 Feb 2012 19:59:27 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

Hello, Lars.

On Sat, Feb 11, 2012 at 04:56:53PM +0100, Lars Ingebrigtsen wrote:
> Alan Mackenzie <address@hidden> writes:

> > Why, should the case be, would you want to call font-lock-fontify-buffer
> > without initialising font lock mode first?  Would this not, perhaps,
> > indicate some other problem in mm-inline-text?

> mm sets `font-lock-mode-hook' (and friends) to nil to avoid problems
> when calling `(font-lock-fontify-buffer)', if I remember correctly.

You cannot get away with this.  These hooks belong to the major mode (or
perhaps the user), and if you arbitrarily inhibit them, then font lock,
in the general case, will not be fully initialised.

> Since it's that hook that sets
> `c-standard-font-lock-fontify-region-function' (which is nil by
> default), this breaks when viewing C mode files.

Again, why are you breaking these hook calls?  This seems to be a very
bad solution to whatever the problem was.

> Is there any reason why `c-standard-font-lock-fontify-region-function'
> is nil, when this makes just calling `(font-lock-fontify-buffer)' not
> work?

font-lock-fontify-region will work fine if you just initialise font lock
fully.  That involves running the hook.

> All the other modes seem to work fine.

Then you've been lucky, so far.  What in mm gets upset by running

Setting that variable to font-lock-default-fontify-region at build time
couples CC Mode and font lock mode too closely.  In particular, it will
prevent CC Mode loading on any system in which font lock is not present.

Alan Mackenzie (Nuremberg, Germany).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]