From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Alexander Pohoyda Newsgroups: gmane.emacs.devel Subject: Re: (font-lock-mode 1) does not always force font-lock Date: 26 Oct 2003 12:32:51 +0100 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87ismcb5ek.fsf@oak.pohoyda.family> References: <87vfqffbwe.fsf@oak.pohoyda.family> <8765iephzh.fsf@oak.pohoyda.family> <87y8v9epmv.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 1067168351 4713 80.91.224.253 (26 Oct 2003 11:39:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 26 Oct 2003 11:39:11 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sun Oct 26 12:39:09 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 1ADjEj-0002j6-00 for ; Sun, 26 Oct 2003 12:39:09 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1ADjEj-00023D-00 for ; Sun, 26 Oct 2003 12:39:09 +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 1ADjAL-00007w-Vg for emacs-devel@quimby.gnus.org; Sun, 26 Oct 2003 06:34:37 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1ADj9P-00005K-74 for emacs-devel@gnu.org; Sun, 26 Oct 2003 06:33:39 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1ADj8r-00086n-46 for emacs-devel@gnu.org; Sun, 26 Oct 2003 06:33:37 -0500 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.24) id 1ADj8l-0007xK-0N for emacs-devel@gnu.org; Sun, 26 Oct 2003 06:32:59 -0500 Original-Received: (qmail 1586 invoked by uid 65534); 26 Oct 2003 11:32:55 -0000 Original-Received: from p508BDD32.dip.t-dialin.net (EHLO oak.pohoyda.family) (80.139.221.50) by mail.gmx.net (mp015) with SMTP; 26 Oct 2003 12:32:55 +0100 X-Authenticated: #14602519 Original-Received: from oak.pohoyda.family (oak.pohoyda.family [127.0.0.1]) by oak.pohoyda.family (8.12.9/8.12.9) with ESMTP id h9QBWs28001379; Sun, 26 Oct 2003 12:32:54 +0100 (CET) (envelope-from alexander.pohoyda@gmx.net) Original-Received: (from apog@localhost) by oak.pohoyda.family (8.12.9/8.12.9/Submit) id h9QBWqfC001376; Sun, 26 Oct 2003 12:32:52 +0100 (CET) (envelope-from alexander.pohoyda@gmx.net) X-Authentication-Warning: oak.pohoyda.family: apog set sender to alexander.pohoyda@gmx.net using -f Original-To: Hrvoje Niksic In-Reply-To: Original-Lines: 44 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 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:17434 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:17434 Hrvoje Niksic writes: > > Hrvoje Niksic writes: > > > >> > Yes, both cases work. If I comment out (font-lock-mode 1), things > >> > still work. > >> > >> Please repeat the tests with `emacs -q' then. > > > > OK. There is no difference whether the buffer is named "*foo*" or just > > "foo". Both cases work. > > I'm afraid you tested the wrong thing. You need to try "*foo*" and > " *foo*", i.e. with and without the leading space in the buffer name. Yes, indeed, I misread your original posting. Sorry for that. Now I was able to reproduce the problem you described. 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)) (funcall font-lock-function font-lock-mode) That's what happens: font-lock-default-function is called with nil argument. So, the buffer is considered to be invisible. I don't know whether this is a bug or not, but I'm wondering why there's no such function: (defun buffer-invisible-p (&optional buffer) "Return t if BUFFER is invisible. No argument or nil as argument means use current buffer as BUFFER." (eq (aref (buffer-name buffer) 0) ?\ )) do to the job. -- Alexander Pohoyda PGP Key fingerprint: 7F C9 CC 5A 75 CD 89 72 15 54 5F 62 20 23 C6 44