From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Hrvoje Niksic Newsgroups: gmane.emacs.devel Subject: Re: (font-lock-mode 1) does not always force font-lock Date: Sun, 26 Oct 2003 17:56:01 +0100 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <87vfqffbwe.fsf@oak.pohoyda.family> <8765iephzh.fsf@oak.pohoyda.family> <87y8v9epmv.fsf@oak.pohoyda.family> <87ismcb5ek.fsf@oak.pohoyda.family> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1067191022 10314 80.91.224.253 (26 Oct 2003 17:57:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 26 Oct 2003 17:57:02 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sun Oct 26 18:57:00 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1ADp8O-0007dj-00 for ; Sun, 26 Oct 2003 18:57:00 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1ADp8O-00053l-00 for ; Sun, 26 Oct 2003 18:57:00 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ADp86-0000CF-Pa for emacs-devel@quimby.gnus.org; Sun, 26 Oct 2003 12:56:42 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1ADp7y-0008VG-Mj for emacs-devel@gnu.org; Sun, 26 Oct 2003 12:56:34 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1ADp7R-0007eN-Ij for emacs-devel@gnu.org; Sun, 26 Oct 2003 12:56:32 -0500 Original-Received: from [213.191.128.10] (helo=mxout.iskon.hr) by monty-python.gnu.org with smtp (Exim 4.24) id 1ADp7R-0007eK-7R for emacs-devel@gnu.org; Sun, 26 Oct 2003 12:56:01 -0500 Original-Received: (qmail 1655 invoked from network); 26 Oct 2003 18:55:59 +0100 Original-Received: from mx.iskon.hr (qmailr@213.191.128.11) by mxout.iskon.hr with SMTP; 26 Oct 2003 18:55:59 +0100 Original-Received: (qmail 22641 invoked from network); 26 Oct 2003 18:55:58 +0100 X-Remote-IP: 213.191.139.219 Original-Received: from hniksic.iskon.hr (213.191.139.219) by mx.iskon.hr with SMTP; 26 Oct 2003 18:55:58 +0100 Original-To: Alexander Pohoyda In-Reply-To: <87ismcb5ek.fsf@oak.pohoyda.family> (Alexander Pohoyda's message of "26 Oct 2003 12:32:51 +0100") User-Agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.4 (Rational FORTRAN, linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:17440 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:17440 Alexander Pohoyda 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.)