From unknown Sun Aug 17 01:50:24 2025 X-Loop: don@donarmstrong.com Subject: bug#1024: Large C++ files load slowly, regardless of font-lock-maximum-size Reply-To: jw_spambox@yahoo.com, 1024@debbugs.gnu.org Resent-From: John W Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Thu, 25 Sep 2008 06:15:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1024 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.12223228459467 (code B ref -1); Thu, 25 Sep 2008 06:15:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-4.9 required=4.0 tests=BAYES_00,FOURLA, RCVD_IN_DNSWL_LOW autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 25 Sep 2008 06:07:25 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8P67Mtb009461 for ; Wed, 24 Sep 2008 23:07:23 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kik0Y-0005C7-0j for bug-gnu-emacs@gnu.org; Thu, 25 Sep 2008 02:07:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kik0X-0005Bv-7o for bug-gnu-emacs@gnu.org; Thu, 25 Sep 2008 02:07:21 -0400 Received: from [199.232.76.173] (port=48878 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kik0X-0005Bs-3r for bug-gnu-emacs@gnu.org; Thu, 25 Sep 2008 02:07:21 -0400 Received: from web56505.mail.re3.yahoo.com ([66.196.97.34]:37702) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1Kik0X-0006n7-3F for bug-gnu-emacs@gnu.org; Thu, 25 Sep 2008 02:07:21 -0400 Received: (qmail 36369 invoked by uid 60001); 25 Sep 2008 06:07:20 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type:Message-ID; b=KSNCr4drYuV6AxpmeEgVu4wajVdg3y3IbvVj79GAo3PyZeVk6bF7QKe8TYDQ1r+Z7PF+IFbHydvpZ4LeegPlj2S/Ljx+GWG8A5VbDbJfgZH6WOyW+IEx2EkP9Cb8hPbNfAaA57VugI3T9lXFaAxxzyrTqizu8EKhMITtfqB9RDM=; X-YMail-OSG: f8Y8phQVM1kbu9e_AP2jrshFiC9Ir7ptPaNIE2cLsxn1jFkjXNsHIT2BeUw5ltesmQ78Jye_zP0Cd.V0RCjTVfOW9EfR1x94B2f_T0iQVPzVqV062NgQ3P9JElD8OfyrjhFbXg-- Received: from [24.20.200.113] by web56505.mail.re3.yahoo.com via HTTP; Wed, 24 Sep 2008 23:07:19 PDT X-Mailer: YahooMailWebService/0.7.218.2 Date: Wed, 24 Sep 2008 23:07:19 -0700 (PDT) From: John W To: bug-gnu-emacs@gnu.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Message-ID: <133132.36158.qm@web56505.mail.re3.yahoo.com> X-detected-operating-system: by monty-python.gnu.org: FreeBSD 6.x (1) To reproduce: (1) Generate a 3M C++ file. (2) Load file. (3) Wait for emacs. <-- bug I'm using jit-lock, but I tested lazy-lock, and the behavior is the same. font-lock-maximum-size is the default. I.e. Its value is 256000 I used edebug to see what emacs was doing, and it gave me a stack like: c-literal-limits() c-neutralize-syntax-in-CPP(1 3527391 3527390) funcall(c-neutralize-syntax-in-CPP 1 3527391 3527390) (if nil c-before-font-lock-function (funcall c-before-font-lock-function (point-min) (point-max) (- ... ...))) (save-excursion (if c-get-state-before-change-function (funcall c-get-state-before-change-function ... ...)) (if nil c-before-font-lock-function (funcall c-before-font-lock-function ... ... ...))) (save-restriction (widen) (save-excursion (if c-get-state-before-change-function ...) (if nil c-before-font-lock-function ...))) c-common-init(c++-mode) c++-mode() set-auto-mode-0(c++-mode nil) set-auto-mode() normal-mode(t) after-find-file(nil t) I blame c-before-font-lock-function . If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. If you would like to further debug the crash, please read the file /usr/local/share/emacs/22.2/etc/DEBUG for instructions. In GNU Emacs 22.2.1 (i686-pc-linux-gnu) of 2008-08-27 on augustine Important settings: value of $LC_ALL: nil value of $LC_COLLATE: C value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.utf8 locale-coding-system: utf-8 default-enable-multibyte-characters: t Major mode: Emacs-Lisp Minor modes in effect: encoded-kbd-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t unify-8859-on-encoding-mode: t utf-translate-cjk-mode: t auto-compression-mode: t line-number-mode: t Recent input: [ 6 ~ ESC [ 6 ~ ESC [ 6 ~ ESC [ 6 ~ ESC [ 6 ~ ESC [ 6 ~ ESC [ 5 ~ ESC [ 5 ~ ESC [ 5 ~ ESC [ 5 ~ ESC [ 5 ~ ESC [ 5 ~ ESC [ 5 ~ ESC [ 5 ~ ESC [ 5 ~ ESC [ 5 ~ ESC [ 5 ~ ESC [ 5 ~ C-x k RET C-x C-e C-x k RET ESC [ A ESC [ A ESC [ A ESC [ A ESC [ A ESC [ A ESC [ A ESC [ A ESC [ A ESC [ A ESC [ A ESC [ A ESC [ A ESC [ A ESC [ A ESC [ A ESC [ A ESC [ A ESC [ B ESC [ B ESC [ B ESC [ A ESC f ESC f ESC f ESC f ESC f ESC b C-k C-_ ESC [ 5 ~ ESC [ 6 ~ ESC [ 5 ~ ESC [ 6 ~ ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ A C-@ ESC [ B ESC [ B ESC [ B C-x b C-g C-x o C-g ESC [ A ESC [ A ESC [ A ESC f ESC f ESC b ESC f ESC f ESC f ESC f ESC b C-k C-_ C-x b RET C-x b RET ESC x e m a c s - b DEL d e TAB DEL DEL TAB DEL DEL DEL DEL DEL DEL b u TAB DEL DEL g n TAB DEL DEL DEL DEL r e p o TAB r t TAB RE T Recent messages: # Auto-saving...done Undo! Mark set Entering debugger... Quit Undo! Auto-saving...done Making completion list... [3 times] Loading emacsbug...done From unknown Sun Aug 17 01:50:24 2025 X-Loop: don@donarmstrong.com Subject: bug#1024: Large C++ files load slowly, regardless of font-lock-maximum-size Reply-To: martin rudalics , 1024@debbugs.gnu.org Resent-From: martin rudalics Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs , don@donarmstrong.com Resent-Date: Thu, 25 Sep 2008 12:25:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1024 X-Emacs-PR-Package: emacs,cc-mode X-Emacs-PR-Keywords: Received: via spool by 1024-submit@emacsbugs.donarmstrong.com id=B1024.12223450485256 (code B ref 1024); Thu, 25 Sep 2008 12:25:04 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.6 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1024) by emacsbugs.donarmstrong.com; 25 Sep 2008 12:17:28 +0000 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id m8PCHKsf005248 for <1024@emacsbugs.donarmstrong.com>; Thu, 25 Sep 2008 05:17:22 -0700 Received: (qmail invoked by alias); 25 Sep 2008 12:17:14 -0000 Received: from 62-47-40-37.adsl.highway.telekom.at (EHLO [62.47.40.37]) [62.47.40.37] by mail.gmx.net (mp065) with SMTP; 25 Sep 2008 14:17:14 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19K+mkBMelKflpC1mP1ZfcdZgu1JafQDfFTyRMBud 0/smMnpmxihHWo Message-ID: <48DB8026.4040201@gmx.at> Date: Thu, 25 Sep 2008 14:12:22 +0200 From: martin rudalics User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: jw_spambox@yahoo.com, 1024@debbugs.gnu.org References: <133132.36158.qm@web56505.mail.re3.yahoo.com> In-Reply-To: <133132.36158.qm@web56505.mail.re3.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.6899999999999999 > I used edebug to see what emacs was doing, and it gave me a stack like: > > c-literal-limits() > c-neutralize-syntax-in-CPP(1 3527391 3527390) > funcall(c-neutralize-syntax-in-CPP 1 3527391 3527390) > (if nil c-before-font-lock-function (funcall c-before-font-lock-function (point-min) (point-max) (- ... ...))) > (save-excursion (if c-get-state-before-change-function (funcall c-get-state-before-change-function ... ...)) (if nil c-before-font-lock-function (funcall c-before-font-lock-function ... ... ...))) > (save-restriction (widen) (save-excursion (if c-get-state-before-change-function ...) (if nil c-before-font-lock-function ...))) > c-common-init(c++-mode) > c++-mode() > set-auto-mode-0(c++-mode nil) > set-auto-mode() > normal-mode(t) > after-find-file(nil t) > > I blame c-before-font-lock-function . Could you please have a look at the description of bug#851 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=851 and try the recipe proposed there by Chong Yidong? martin From unknown Sun Aug 17 01:50:24 2025 X-Loop: don@donarmstrong.com Subject: bug#1024: Large C++ files load slowly, regardless of font-lock-maximum-size Reply-To: Alan Mackenzie , 1024@debbugs.gnu.org Resent-From: Alan Mackenzie Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs , don@donarmstrong.com Resent-Date: Thu, 25 Sep 2008 13:00:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1024 X-Emacs-PR-Package: emacs,cc-mode X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.122234720213663 (code B ref -1); Thu, 25 Sep 2008 13:00:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-4.8 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER, INVALID_DATE,MSGID_RANDY,RCVD_IN_DNSWL_LOW autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 25 Sep 2008 12:53:22 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8PCrEbH013657 for ; Thu, 25 Sep 2008 05:53:16 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KiqLK-0008Cu-JW for bug-gnu-emacs@gnu.org; Thu, 25 Sep 2008 08:53:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KiqLI-0008CW-2q for bug-gnu-emacs@gnu.org; Thu, 25 Sep 2008 08:53:13 -0400 Received: from [199.232.76.173] (port=36045 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KiqLH-0008CT-Td for bug-gnu-emacs@gnu.org; Thu, 25 Sep 2008 08:53:11 -0400 Received: from moderators.individual.net ([130.133.4.7]:53468) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KiqLH-0002fW-Dj for bug-gnu-emacs@gnu.org; Thu, 25 Sep 2008 08:53:11 -0400 Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by moderators.individual.net (Exim 4.69) for gnu-emacs-bug@moderators.isc.org with esmtp (envelope-from ) id <1KiqLA-0007Mu-Cj>; Thu, 25 Sep 2008 14:53:04 +0200 Received: (qmail 77721 invoked by uid 8); 25 Sep 2008 12:53:03 -0000 Date: 25 Sep 2008 14:53:03 +0200 To: gnu-emacs-bug@moderators.isc.org Path: not-for-mail From: Alan Mackenzie Newsgroups: gnu.emacs.bug Date: Thu, 25 Sep 2008 12:53:03 +0000 (UTC) Organization: muc.de e.V. -- private internet access Lines: 48 Message-ID: References: NNTP-Posting-Host: marvin.muc.de X-Trace: colin2.muc.de 1222347183 77717 2001:608:1000::2 (25 Sep 2008 12:53:03 GMT) X-Complaints-To: news-admin@muc.de NNTP-Posting-Date: Thu, 25 Sep 2008 12:53:03 +0000 (UTC) User-Agent: tin/1.6.2-20030910 ("Pabbay") (UNIX) (FreeBSD/4.11-RELEASE (i386)) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Hi, John. John W wrote: > To reproduce: > (1) Generate a 3M C++ file. > (2) Load file. > (3) Wait for emacs. <-- bug > I'm using jit-lock, but I tested lazy-lock, and the behavior is the same. > font-lock-maximum-size is the default. I.e. > Its value is 256000 > I used edebug to see what emacs was doing, and it gave me a stack like: > c-literal-limits() > c-neutralize-syntax-in-CPP(1 3527391 3527390) > funcall(c-neutralize-syntax-in-CPP 1 3527391 3527390) > (if nil c-before-font-lock-function (funcall c-before-font-lock-function (point-min) (point-max) (- ... ...))) > (save-excursion (if c-get-state-before-change-function (funcall c-get-state-before-change-function ... ...)) (if nil c-before-font-lock-function (funcall c-before-font-lock-function ... ... ...))) > (save-restriction (widen) (save-excursion (if c-get-state-before-change-function ...) (if nil c-before-font-lock-function ...))) > c-common-init(c++-mode) > c++-mode() > set-auto-mode-0(c++-mode nil) > set-auto-mode() > normal-mode(t) > after-find-file(nil t) Thanks for taking the trouble to generate this stack dump; it identifies the problem completely. This bug was caused by a previous bug fix which introduced a complete scan over the entire buffer when it's loaded. One function, `c-neutralize-syntax-in-CPP' had been coded very inefficiently. It was recoded for speed on 2008-05-24, committed in .../emacs/lisp/progmodes/cc-mode.el version 1.58.2.12 (Emacs 22 branch) and version 1.75 (trunk) at savannah. To get the fixed version, either: (i) Upgrade to Emacs 22.3; or (ii) If you're using the Emacs 23 CVS, update your version. [ .... ] -- Alan Mackenzie (Nuremberg, Germany). From unknown Sun Aug 17 01:50:24 2025 X-Loop: don@donarmstrong.com Subject: bug#1024: Large C++ files load slowly, regardless of font-lock-maximum-size Reply-To: jw_spambox@yahoo.com, 1024@debbugs.gnu.org Resent-From: John W Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs , don@donarmstrong.com Resent-Date: Fri, 26 Sep 2008 03:30:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1024 X-Emacs-PR-Package: emacs,cc-mode X-Emacs-PR-Keywords: Received: via spool by 1024-submit@emacsbugs.donarmstrong.com id=B1024.12223993633363 (code B ref 1024); Fri, 26 Sep 2008 03:30:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1024) by emacsbugs.donarmstrong.com; 26 Sep 2008 03:22:43 +0000 Received: from web56508.mail.re3.yahoo.com (web56508.mail.re3.yahoo.com [66.196.97.37]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id m8Q3MeYA003357 for <1024@emacsbugs.donarmstrong.com>; Thu, 25 Sep 2008 20:22:41 -0700 Received: (qmail 91325 invoked by uid 60001); 26 Sep 2008 03:22:34 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Message-ID; b=mfp6A/gI9NFYHOKbmGR6OvmJyNyH9OJ22o0dFARUJFhjLfNE8IH7/M2XnMt8n6jyTM7hM0czDQ0CaYyV8RGO0HqQ6705LbGJ4Yya0/DI4g+SUq8tfSPY477BKmrU78IrVPWCbxAOrEqyPzp0UWpKMB+B1KJ+TpBhbfsOE90JlCE=; X-YMail-OSG: 8D3lOjcVM1n7dHUhEJl5LdTJ5EG.wnUpcWw8hJtxsL5vPtMjMkW2_S16p1IpObaedw-- Received: from [24.20.200.113] by web56508.mail.re3.yahoo.com via HTTP; Thu, 25 Sep 2008 20:22:34 PDT X-Mailer: YahooMailWebService/0.7.218.2 Date: Thu, 25 Sep 2008 20:22:34 -0700 (PDT) From: John W To: martin rudalics Cc: 1024@debbugs.gnu.org In-Reply-To: <48DB8026.4040201@gmx.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Message-ID: <706144.90919.qm@web56508.mail.re3.yahoo.com> > Could you please have a look at the description of bug#851 > > http://debbugs.gnu.org/cgi/bugreport.cgi?bug=851 > > and try the recipe proposed there by Chong Yidong? Sure. I tried this patch +++ cc-engine.el 2008/04/01 21:41:21 1.56.2.11 but it made no difference; it is still slow, and when I examine the stack, it is the same stack trace. The file loads in 2 seconds in fundamental mode, but takes about 2 minutes in C++ mode. I should have mentioned that this is a preprocessed C++ file, with many compiler directies, such as #line 1 "somefile.h", and I now think the problem is provoked by the compiler directives. If I globally replace the #line stuff like so: #line 1 "some_file.h" --> s = "some_file.h" the file loads in about 7 seconds. - John From unknown Sun Aug 17 01:50:24 2025 X-Loop: don@donarmstrong.com Subject: bug#1024: Large C++ files load slowly, regardless of font-lock-maximum-size Reply-To: Alan Mackenzie , 1024@debbugs.gnu.org Resent-From: Alan Mackenzie Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs , don@donarmstrong.com Resent-Date: Fri, 26 Sep 2008 07:55:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1024 X-Emacs-PR-Package: emacs,cc-mode X-Emacs-PR-Keywords: Received: via spool by 1024-submit@emacsbugs.donarmstrong.com id=B1024.12224152033770 (code B ref 1024); Fri, 26 Sep 2008 07:55:03 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.7 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1024) by emacsbugs.donarmstrong.com; 26 Sep 2008 07:46:43 +0000 Received: from mail.muc.de (qmailr@colin.muc.de [193.149.48.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8Q7kc7C003764 for <1024@emacsbugs.donarmstrong.com>; Fri, 26 Sep 2008 00:46:40 -0700 Received: (qmail 33600 invoked by uid 3782); 26 Sep 2008 07:46:36 -0000 Received: from acm.muc.de (pD9E5006E.dip.t-dialin.net [217.229.0.110]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Fri, 26 Sep 2008 09:46:35 +0200 Received: (qmail 1917 invoked by uid 1000); 26 Sep 2008 07:53:19 -0000 Date: Fri, 26 Sep 2008 07:53:19 +0000 To: jw_spambox@yahoo.com, 1024@debbugs.gnu.org Cc: martin rudalics Message-ID: <20080926075319.GA1659@muc.de> References: <48DB8026.4040201@gmx.at> <706144.90919.qm@web56508.mail.re3.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <706144.90919.qm@web56508.mail.re3.yahoo.com> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de Hi, John, On Thu, Sep 25, 2008 at 08:22:34PM -0700, John W wrote: > > Could you please have a look at the description of bug#851 > > http://debbugs.gnu.org/cgi/bugreport.cgi?bug=851 > > and try the recipe proposed there by Chong Yidong? > Sure. I tried this patch > +++ cc-engine.el 2008/04/01 21:41:21 1.56.2.11 This slowdown happened because of an earlier bug fix. Part of that fix is scanning the entire buffer, "fixing" things which could derail the syntax and font locking, e.g. preprocessor lines like this: #warning this isn't fixed yet! ^ , where the apostrophe was being treated like a string opener. That fix was not coded with a view to speed, unfortunately. It was later fixed in cc-mode.el version 1.75 (CVS trunk at savannah) and version 1.58.2.12 (in the Emacs 22 branch) on 2008-05-24. The fix was incorporated into Emacs 22.3, released a few days ago. Also, thanks for generating and posting the stack dump, which made it trivially easy to track down the problem. > - John -- Alan Mackenzie (Nuremberg, Germany).