emacs-devel
[Top][All Lists]
Advanced

[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: Sun, 26 Oct 2003 17:56:01 +0100
User-agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.4 (Rational FORTRAN, linux)

Alexander Pohoyda <address@hidden> writes:

> Please open the lisp/font-core.el file, function font-lock-mode,
> right at the beginning of the function, after very long comment,
> code goes like this:
>
>   ;; Don't turn on Font Lock mode if we don't have a display (we're running a
>   ;; batch job) or if the buffer is invisible (the name starts with a space).
>   (when (or noninteractive (eq (aref (buffer-name) 0) ?\ ))
>     (setq font-lock-mode nil))

I propose removing the buffer-name check, at least when the argument
to font-lock-mode is positive.

The code that prevents fontification of temporary buffers would be
better placed in the hook function installed by
`global-font-lock-mode'.

> I'm wondering why there's no such function:
>
> (defun buffer-invisible-p (&optional buffer)
[...]

I don't see a good use for this function.  Very little code should
care whether the buffer they're working on is temporary or not --
font-lock is the exception here, and even font-lock got it wrong
(IMHO).  Lisp code should preferrably check for specific features,
such as buffer-local variables, to modify its behavior.  Also, buffers
can be renamed, which would change their "invisibility" status.

(Note that the manual doesn't even use the term "invisible" for such
buffers.  It calls them "ephemeral" in one place.)





reply via email to

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