From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#9919: 24.0.91; font-lock broken in dired Date: Mon, 9 Jan 2012 10:59:58 -0800 Message-ID: <7F9343C4FA564C29BE7E8576E5A25183@us.oracle.com> References: <1161A09A8D6E494CBF91D53B99D5FBC2@us.oracle.com><86k47fuzce.fsf@googlemail.com><01BD44CE3569404796A5C8252DDA7BDB@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 1326135663 13106 80.91.229.12 (9 Jan 2012 19:01:03 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 9 Jan 2012 19:01:03 +0000 (UTC) Cc: 9919@debbugs.gnu.org To: "'Stefan Monnier'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jan 09 20:00:59 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RkKSo-0007tU-UM for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 Jan 2012 20:00:59 +0100 Original-Received: from localhost ([::1]:54646 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkKSj-0005A8-1K for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 Jan 2012 14:00:53 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:60267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkKSf-00059l-35 for bug-gnu-emacs@gnu.org; Mon, 09 Jan 2012 14:00:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RkKSd-00070k-Km for bug-gnu-emacs@gnu.org; Mon, 09 Jan 2012 14:00:49 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56610) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkKSd-00070g-FS for bug-gnu-emacs@gnu.org; Mon, 09 Jan 2012 14:00:47 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1RkKSs-00073a-5J for bug-gnu-emacs@gnu.org; Mon, 09 Jan 2012 14:01:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Jan 2012 19:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9919 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9919-submit@debbugs.gnu.org id=B9919.132613562827084 (code B ref 9919); Mon, 09 Jan 2012 19:01:02 +0000 Original-Received: (at 9919) by debbugs.gnu.org; 9 Jan 2012 19:00:28 +0000 Original-Received: from localhost ([127.0.0.1]:51283 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RkKSI-00072m-Sx for submit@debbugs.gnu.org; Mon, 09 Jan 2012 14:00:27 -0500 Original-Received: from rcsinet15.oracle.com ([148.87.113.117]:57828) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RkKSF-00072Y-9v for 9919@debbugs.gnu.org; Mon, 09 Jan 2012 14:00:24 -0500 Original-Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by rcsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id q09J01v7012763 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 9 Jan 2012 19:00:01 GMT Original-Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q09IxxT9016380 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 9 Jan 2012 19:00:00 GMT Original-Received: from abhmt109.oracle.com (abhmt109.oracle.com [141.146.116.61]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q09Ixw8R025317; Mon, 9 Jan 2012 12:59:59 -0600 Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 09 Jan 2012 10:59:58 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: AczO8Lm0VYlcA7LgS/GZIdn5SF2iKQAAYvZA X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-CT-RefId: str=0001.0A090206.4F0B3932.001A,ss=1,re=0.000,fgs=0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:55585 Archived-At: > > I am still getting reports about this wrt dired+.el from users on > > GNU/Linux. So perhaps my workaround is not sufficient there - dunno. > > Whenever you change font-lock-defaults, you need to cause > font-lock-keywords (and the text already font-locked) to be refreshed, > unless you know for sure that font-lock-mode has not yet been started. Your "whenever" obviously does not apply to Emacs 20-22, since `font-lock-refresh-defaults' does not even exist in those releases. And at least for my code, "whenever" is true only for Emacs 24, not Emacs 23 (which also has `font-lock-refresh-defaults'). And the problem did not exist in Emacs 24 either, until the build where I reported the bug. I have this code, which has always worked and still works with Emacs 20 through 23.3: (add-hook 'dired-mode-hook (lambda () (set (make-local-variable 'font-lock-defaults) (cons '(dired-font-lock-keywords diredp-font-lock-keywords-1) (cdr font-lock-defaults))) ;; Emacs 24+: Need to refresh `font-lock-keywords' from `font-lock-defaults'. (when (fboundp 'font-lock-refresh-defaults) (font-lock-refresh-defaults)))) The last bit, which invokes `font-lock-refresh-defaults', I had to add for Emacs 24. Similarly, for buff-menu+.el, I need to do likewise on `buffer-menu-mode-hook'. Again, this workaround is needed only for Emacs 24. > > In any case, this is a regression and a performance problem. > > I don't see any evidence of a performance problem. This means, in effect, that fontification must now be done twice, or else it is incorrect. That's the performance hit I meant: font-locking twice. What has always given correct fontification before with a single fontification (and still does, in the published Emacs releases) now does not, I must re-fontify completely. Am I missing something here? Is there a way to get what's needed without fontifying twice? That's expensive. What's the cause of this change/regression? Thx.