From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Emacs revision #107149 Date: Sun, 12 Feb 2012 21:42:59 +0100 Message-ID: <87zkcnhjfw.fsf@gnus.org> References: <20120210232039.GC4340@acm.acm> <87pqdlbby2.fsf@gnus.org> <20120211195927.GA3969@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1329079399 14073 80.91.229.3 (12 Feb 2012 20:43:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 12 Feb 2012 20:43:19 +0000 (UTC) Cc: bug-cc-mode@gnu.org, emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 12 21:43:18 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RwgGT-0003uO-CN for ged-emacs-devel@m.gmane.org; Sun, 12 Feb 2012 21:43:17 +0100 Original-Received: from localhost ([::1]:58501 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RwgGS-0000x6-Ho for ged-emacs-devel@m.gmane.org; Sun, 12 Feb 2012 15:43:16 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:52758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RwgGP-0000wq-Ee for emacs-devel@gnu.org; Sun, 12 Feb 2012 15:43:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RwgGM-00042U-Ng for emacs-devel@gnu.org; Sun, 12 Feb 2012 15:43:13 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:46653) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RwgGM-000427-FX; Sun, 12 Feb 2012 15:43:10 -0500 Original-Received: from 93-41-188-50.ip82.fastwebnet.it ([93.41.188.50] helo=rusty) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1RwgGE-0004IK-H1; Sun, 12 Feb 2012 21:43:02 +0100 In-Reply-To: <20120211195927.GA3969@acm.acm> (Alan Mackenzie's message of "Sat, 11 Feb 2012 19:59:27 +0000") User-Agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.0.93 (gnu/linux) X-MailScanner-ID: 1RwgGE-0004IK-H1 MailScanner-NULL-Check: 1329684183.01777@iqg6Qd5BWtdJwi7dO2mkrQ X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.224.195 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:148524 Archived-At: Alan Mackenzie writes: > You cannot get away with this. These hooks belong to the major mode (or > perhaps the user), and if you arbitrarily inhibit them, then font lock, > in the general case, will not be fully initialised. As Wolfgang Jenkner said, I think it has something to do with disabling the delayed fontification modes. But I'm not actually sure -- the code has been that way forever, and I probably didn't write it. > Again, why are you breaking these hook calls? This seems to be a very > bad solution to whatever the problem was. It works for all modes tested, except C mode, apparently. >> Is there any reason why `c-standard-font-lock-fontify-region-function' >> is nil, when this makes just calling `(font-lock-fontify-buffer)' not >> work? > > font-lock-fontify-region will work fine if you just initialise font lock > fully. That involves running the hook. So there is no reason? > Setting that variable to font-lock-default-fontify-region at build time > couples CC Mode and font lock mode too closely. In particular, it will > prevent CC Mode loading on any system in which font lock is not present. What systems would this be? As far as I can tell from the cc-mode code, `c-font-lock-fontify-region' unconditionally calls `c-standard-font-lock-fontify-region-function'. Furthermore, `c-standard-font-lock-fontify-region-function' doesn't seem to be set to anything other than `(default-value 'font-lock-fontify-region-function)'. And the variable is not a user-level variable, which seems to make the entire tap-dance routine here rather ... odd. Why not just call `(default-value 'font-lock-fontify-region-function)' unconditionally? -- (domestic pets only, the antidote for overdose, milk.) http://lars.ingebrigtsen.no * Sent from my Rome