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: Fri, 24 Oct 2003 11:49:00 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <87vfqffbwe.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 1066989422 28582 80.91.224.253 (24 Oct 2003 09:57:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 24 Oct 2003 09:57:02 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Oct 24 11: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 1ACygm-0000Oj-00 for ; Fri, 24 Oct 2003 11:57:00 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1ACygm-0007Ka-00 for ; Fri, 24 Oct 2003 11:57:00 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ACyaL-0005XZ-1O for emacs-devel@quimby.gnus.org; Fri, 24 Oct 2003 05:50:21 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1ACyZg-0005Ij-UT for emacs-devel@gnu.org; Fri, 24 Oct 2003 05:49:40 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1ACyZ7-00055z-3B for emacs-devel@gnu.org; Fri, 24 Oct 2003 05:49:36 -0400 Original-Received: from [213.191.128.133] (helo=localhost.localdomain) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1ACyZ6-000555-G8 for emacs-devel@gnu.org; Fri, 24 Oct 2003 05:49:04 -0400 Original-Received: from localhost.localdomain (frost [127.0.0.1]) by localhost.localdomain (8.12.9/8.12.9) with ESMTP id h9O9n1eO002462 for ; Fri, 24 Oct 2003 11:49:01 +0200 Original-Received: (from hniksic@localhost) by localhost.localdomain (8.12.9/8.12.9/Submit) id h9O9n088002460; Fri, 24 Oct 2003 11:49:00 +0200 Original-To: emacs-devel@gnu.org In-Reply-To: <87vfqffbwe.fsf@oak.pohoyda.family> (Alexander Pohoyda's message of "24 Oct 2003 07:22:09 +0200") 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:17397 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:17397 Alexander Pohoyda writes: > Hrvoje Niksic writes: > >> > 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 >> (c-mode) >> (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 >> nil. > > I have just tested it on recent Emacs and this code always works > (returns t). Then the bug may have been fixed already. Could you please also check whether the buffer is actually fontified? For example: (let ((newbuf (generate-new-buffer "*foo*"))) (with-current-buffer newbuf (c-mode) (insert "\"a string\"") (font-lock-mode 1)) (switch-to-buffer newbuf)) If things work, using both "*foo*" and with " *foo" should result in a buffer with fontified "a string".