From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: JD Smith Newsgroups: gmane.emacs.devel Subject: Re: Font-lock in COMINT modes Date: Fri, 08 Dec 2006 19:15:50 -0700 Message-ID: References: NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1165630592 3196 80.91.229.10 (9 Dec 2006 02:16:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 9 Dec 2006 02:16:32 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 09 03:16:30 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1GsrlK-00046I-Sb for ged-emacs-devel@m.gmane.org; Sat, 09 Dec 2006 03:16:27 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GsrlK-0008F0-7e for ged-emacs-devel@m.gmane.org; Fri, 08 Dec 2006 21:16:26 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Gsrl8-0008El-MJ for emacs-devel@gnu.org; Fri, 08 Dec 2006 21:16:14 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Gsrl7-0008EZ-3G for emacs-devel@gnu.org; Fri, 08 Dec 2006 21:16:13 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gsrl6-0008EW-Tr for emacs-devel@gnu.org; Fri, 08 Dec 2006 21:16:12 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1Gsrl6-0007l4-PG for emacs-devel@gnu.org; Fri, 08 Dec 2006 21:16:12 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Gsrl0-0004Tq-Do for emacs-devel@gnu.org; Sat, 09 Dec 2006 03:16:06 +0100 Original-Received: from turtle.as.arizona.edu ([128.196.208.207]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 09 Dec 2006 03:16:06 +0100 Original-Received: from jdsmith by turtle.as.arizona.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 09 Dec 2006 03:16:06 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 39 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: turtle.as.arizona.edu User-Agent: Pan/0.14.2.91 (As She Crawled Across the Table) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:63487 Archived-At: On Fri, 08 Dec 2006 20:26:27 -0500, Richard Stallman wrote: > Here is the change which altered the default behavior in comint modes. > > ---------------------------- > revision 1.348 > date: 2006-09-28 19:09:19 +0000; author: rms; state: Exp; lines: +4 > -1 (comint-mode): Bind font-lock-defaults non-nil. > ---------------------------- > > I'm sure I did this to fix a bug, but I can't find any discussion about > it. Maybe it was so facemenu-enable-faces-p would return nil. > > As far as I can see, if font-lock-defaults is nil, that is equivalent to > (nil). How do you conclude that nil would be equivalent to (nil t)? nil and '(nil) are not equivalent, in that the former implicitly causes only keywords to be fontified, and the latter causes font-lock-keywords-only to be set locally to nil (since it is a list without a 2nd entry), which allows string and comments to be fontified. This is a telling comment from font-core.el: ;; Only do hard work if the mode has specified stuff in ;; `font-lock-defaults'. All the defaults, like keyword-only, are recovered from the font-lock-defaults list *only* if it is non-nil (e.g. '(nil)). I haven't understood how a purely nil font-lock-defaults implicitly prevents string+comment fontification independent of the keywords-only setting, but it does. '(nil t) explicitly sets keywords-only to t, restoring the behavior. What I don't know is whether nil and '(nil t) differ in other ways. They clearly exercise different code paths. JD