From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: font-lock-refresh-defaults Date: Thu, 15 Jul 2010 14:20:34 -0700 Message-ID: <4FF5DD848A9B404E98F26FF04C85B3FA@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1279228861 26184 80.91.229.12 (15 Jul 2010 21:21:01 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 15 Jul 2010 21:21:01 +0000 (UTC) Cc: 'Bastian Beischer' To: Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 15 23:20:59 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OZVrX-0007vZ-FP for ged-emacs-devel@m.gmane.org; Thu, 15 Jul 2010 23:20:59 +0200 Original-Received: from localhost ([127.0.0.1]:36428 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OZVrW-0005XF-OK for ged-emacs-devel@m.gmane.org; Thu, 15 Jul 2010 17:20:58 -0400 Original-Received: from [140.186.70.92] (port=50058 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OZVrQ-0005Wc-Dy for Emacs-devel@gnu.org; Thu, 15 Jul 2010 17:20:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OZVrO-0007UZ-Aj for Emacs-devel@gnu.org; Thu, 15 Jul 2010 17:20:52 -0400 Original-Received: from rcsinet10.oracle.com ([148.87.113.121]:26873) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OZVrN-0007UI-P1 for Emacs-devel@gnu.org; Thu, 15 Jul 2010 17:20:50 -0400 Original-Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o6FLKkqo030539 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 15 Jul 2010 21:20:48 GMT Original-Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o6FBCad7019820; Thu, 15 Jul 2010 21:20:44 GMT Original-Received: from abhmt019.oracle.com by acsmt354.oracle.com with ESMTP id 409430211279228843; Thu, 15 Jul 2010 14:20:43 -0700 Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 15 Jul 2010 14:20:43 -0700 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcskY4/ODDcX+hx1SZyKBxPz/27XKw== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 X-Source-IP: acsmt354.oracle.com [141.146.40.154] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090202.4C3F7BAD.00B5:SCFMA4539814,ss=1,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:127392 Archived-At: I just got a bug report for my library buff-menu+.el, which adds a few things to buff-menu.el. The problem was that none of the faces were showing up (except one), using the latest Emacs source code. There is no such problem with Emacs 23.2 or with a build as late as 2009-09-11. I see the problem starting with a build of 2010-05-23 (I have no builds between those dates). The buff-menu.el source library is identical (no changes), so the problem does not come from that code. The problem goes away if a call to `font-lock-refresh-defaults' is inserted: (defun Buffer-menu-fontify-and-adjust-frame () "Use for `buffer-menu-mode-hook'. Fontify, fit and raise frame." (save-window-excursion (save-excursion (pop-to-buffer "*Buffer List*") (when (< emacs-major-version 21) (make-local-variable 'font-lock-defaults)) (setq font-lock-defaults '(buffer-menu-font-lock-keywords t)) (when (fboundp 'font-lock-refresh-defaults) (font-lock-refresh-defaults)) ; WHY NEEDED NOW? (turn-on-font-lock) (when (and (fboundp 'fit-frame) (one-window-p t)) (fit-frame)) (raise-frame)))) OK, so Emacs has apparently changed something about font-locking, so now you must refresh whenever you change the font-lock defaults. (Whenever? Or maybe only sometimes when you change the defaults?) Why? And exactly when? What changes must users make to their code? Well, the doc string for the function gives a little guidance, but I looked in the Emacs and Elisp manuals for more. Nothing. I looked in NEWS. Nothing. Why the silence about this change? Why not help users by telling them (a) THAT they may have to do something different to get the same behavior as before and (b) WHY they now have to do something different. Why no discussion in emacs-devel before the change - or even after it? Searching the emacs-devel archives finds thread "Need help with search based font-locking". This function was added in the middle of that thread. No attention was brought to this change. Nothing about how this means that you might need to change your code, that this represents a general font-lock behavior change. Isn't some explanation of this feature the least one could expect from those who make such changes? We might like to understand WHY such a change in existing code that uses font-locking is now necessary, and under what circumstances.