From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#635: Adding font-lock keywords results in no font-lock at all Date: Thu, 13 Aug 2009 19:41:46 -0400 Message-ID: <87bpmjnux1.fsf@cyd.mit.edu> Reply-To: Chong Yidong , 635@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1250208431 16609 80.91.229.12 (14 Aug 2009 00:07:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Aug 2009 00:07:11 +0000 (UTC) Cc: 635@emacsbugs.donarmstrong.com To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 14 02:07:03 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MbkJy-0003zv-P4 for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Aug 2009 02:07:03 +0200 Original-Received: from localhost ([127.0.0.1]:43525 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MbkJy-00018l-73 for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Aug 2009 20:07:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MbkJu-00018K-22 for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2009 20:06:58 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MbkJp-000187-Ru for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2009 20:06:57 -0400 Original-Received: from [199.232.76.173] (port=54488 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MbkJp-00017x-Iu for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2009 20:06:53 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:43710) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MbkJo-0006K2-QG for bug-gnu-emacs@gnu.org; Thu, 13 Aug 2009 20:06:53 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7E06nYP009493; Thu, 13 Aug 2009 17:06:49 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n7DNo6mR006314; Thu, 13 Aug 2009 16:50:06 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Chong Yidong Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Thu, 13 Aug 2009 23:50:06 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 635 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 635-submit@emacsbugs.donarmstrong.com id=B635.12502068514929 (code B ref 635); Thu, 13 Aug 2009 23:50:06 +0000 Original-Received: (at 635) by emacsbugs.donarmstrong.com; 13 Aug 2009 23:40:51 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7DNeorK004926 for <635@emacsbugs.donarmstrong.com>; Thu, 13 Aug 2009 16:40:51 -0700 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id A814257E21A; Thu, 13 Aug 2009 19:41:46 -0400 (EDT) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Thu, 13 Aug 2009 20:06:57 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:30167 Archived-At: > 2007-06-11 Stefan Monnier > * font-lock.el (font-lock-add-keywords): In case font-lock was only > half-activated, forcefully activate it completely. > > which added the following lines to `font-lock-add-keywords' > (when (and font-lock-mode > (not (or font-lock-keywords font-lock-defaults))) > ;; The major mode has not set any keywords, so when we enabled > ;; font-lock-mode it only enabled the font-core.el part, not the > ;; font-lock-mode-internal. Try again. > (font-lock-mode -1) > (set (make-local-variable 'font-lock-defaults) '(nil t)) > (font-lock-mode 1)) > > What happens appears to be that in any mode that does not specify > `font-lock-keywords' (like `help-mode' or `view-mode' in your case), > (font-lock-mode -1) unfontifies the entire buffer thus removing any > faces assigned earlier by, for example, `list-faces-display'. Since > these faces are not reassigned by font-lock you won't get them back > either :-( > > AFAICT, this change also broke `hi-lock-mode' in such buffers. Maybw we should do away with the optimization where font-lock-mode avoids calling font-lock-internal when font-lock-defaults is empty. The performance benefit is probably negligible. Stefan, WDYT?