[Top][All Lists]

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

Re: (font-lock-mode 1) does not always force font-lock

From: Hrvoje Niksic
Subject: Re: (font-lock-mode 1) does not always force font-lock
Date: Fri, 24 Oct 2003 00:30:17 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.4 (Rational FORTRAN, linux)

Richard Stallman <address@hidden> writes:

>     This returns nil because `(font-lock-mode 1)' does not force
>     font-lock, contrary to the docstring which, in GNU Emacs 21.2.1,
>     states:
>       With arg, turn Font Lock mode off if and only if arg is a
>       non-positive number; if arg is nil, toggle Font Lock mode;
>       anything else turns Font Lock on.
>     I assume the problem is that the buffer is that the buffer in
>     question is temporary.
> that seems like a bug to me.  perhaps it is a consequence of a
> feature meant for some other case.

It was probably meant to prevent unwanted fontification of temporary
buffers for users who turn on font-lock from a global hook or who use

The idea is correct, but the place is wrong.  The code that excludes
temporary buffers from font-lock should be in global-font-lock-mode or
perhaps in turn-on-font-lock, but not in font-lock-mode proper.

> what code tests this?

I don't have the sources handy.  It seems that the code recognizes the
buffer as temporary by checking for names that begins with space.  For
instance, this works (returns t):

(let ((newbuf (generate-new-buffer "*foo*")))
  (with-current-buffer newbuf
    (font-lock-mode 1)
    (prog1 font-lock-mode
      (kill-buffer (current-buffer)))))

Change "*foo*" to " *foo*", and it no longer works, i.e. it returns

> can u suggest a patch?

I don't have a patch, sorry.

reply via email to

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