GNU bug report logs - #10792
24.0.93; emacs goes comatose opening C header

Previous Next

Packages: emacs, cc-mode;

Reported by: John Yates <john <at> yates-sheets.org>

Date: Sat, 11 Feb 2012 19:40:05 UTC

Severity: normal

Merged with 10716, 10750

Found in version 24.0.93

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 10792 in the body.
You can then email your comments to 10792 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#10792; Package emacs. (Sat, 11 Feb 2012 19:40:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to John Yates <john <at> yates-sheets.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 11 Feb 2012 19:40:05 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: John Yates <john <at> yates-sheets.org>
To: bug-gnu-emacs <at> gnu.org
Cc: Alan Mackenzie <acm <at> muc.de>
Subject: 24.0.93; emacs goes comatose opening C header
Date: Sat, 11 Feb 2012 12:26:36 -0500
When I attemt to visit the following header emacs locks up.  If
I make the contents of the macro significantly shorted emacs is
able to open and fontlock it successfully.  To me this suggests
some form of n-squared processing.

-----------------------------------

#define PARSE_TYPE_LIST \
_EMIT_(PT_ZERO,            "*ZERO*"            ) _DELIM_ \
_EMIT_(PT_CHAR1,           "CHAR"              ) _DELIM_ \
_EMIT_(PTN_CHAR1,          "CHAR"              ) _DELIM_ \
_EMIT_(PT_CHAR,            "CHAR"              ) _DELIM_ \
_EMIT_(PTN_CHAR,           "CHAR"              ) _DELIM_ \
_EMIT_(PT_VAR_CHAR,        "VARCHAR"           ) _DELIM_ \
_EMIT_(PTN_VAR_CHAR,       "VARCHAR"           ) _DELIM_ \
_EMIT_(PT_VAR_FIXED_CHAR,  "CHAR"              ) _DELIM_ \
_EMIT_(PTN_VAR_FIXED_CHAR, "CHAR"              ) _DELIM_ \
_EMIT_(PT_INT1,            "INT1"              ) _DELIM_ \
_EMIT_(PT_INT2,            "INT2"              ) _DELIM_ \
_EMIT_(PT_INT4,            "INT4"              ) _DELIM_ \
_EMIT_(PT_INT8,            "INT8"              ) _DELIM_ \
_EMIT_(PT_NUMERIC4,        "NUMERIC"           ) _DELIM_ \
_EMIT_(PT_NUMERIC8,        "NUMERIC"           ) _DELIM_ \
_EMIT_(PT_NUMERIC16,       "NUMERIC"           ) _DELIM_ \
_EMIT_(PT_DATE_MMM_D_Y,    "DATE"              ) _DELIM_ \
_EMIT_(PTN_DATE_MMM_D_Y,   "DATE"              ) _DELIM_ \
_EMIT_(PT_DATE_N_DMMMY,    "DATE"              ) _DELIM_ \
_EMIT_(PT_DATE_D_DMMMY,    "DATE"              ) _DELIM_ \
_EMIT_(PT_DATE_N_DMY,      "DATE"              ) _DELIM_ \
_EMIT_(PT_DATE_D_DMY,      "DATE"              ) _DELIM_ \
_EMIT_(PT_DATE_N_MDY,      "DATE"              ) _DELIM_ \
_EMIT_(PT_DATE_D_MDY,      "DATE"              ) _DELIM_ \
_EMIT_(PT_DATE_N_YMD,      "DATE"              ) _DELIM_ \
_EMIT_(PT_DATE_D_YMD,      "DATE"              ) _DELIM_ \
_EMIT_(PT_TIME_N_24,       "TIME"              ) _DELIM_ \
_EMIT_(PT_TIME_D_24,       "TIME"              ) _DELIM_ \
_EMIT_(PT_TIME_N_12,       "TIME"              ) _DELIM_ \
_EMIT_(PT_TIME_D_12,       "TIME"              ) _DELIM_ \
_EMIT_(PT_TIME_N_24_TZ,    "TIME_TZ"           ) _DELIM_ \
_EMIT_(PT_TIME_D_24_TZ,    "TIME_TZ"           ) _DELIM_ \
_EMIT_(PT_TIME_N_12_TZ,    "TIME_TZ"           ) _DELIM_ \
_EMIT_(PT_TIME_D_12_TZ,    "TIME_TZ"           ) _DELIM_ \
_EMIT_(PT_TIME_N_24_TRUNC, "[TIME]"            ) _DELIM_ \
_EMIT_(PT_TIME_D_24_TRUNC, "[TIME]"            ) _DELIM_ \
_EMIT_(PT_TIME_N_12_TRUNC, "[TIME]"            ) _DELIM_ \
_EMIT_(PT_TIME_D_12_TRUNC, "[TIME]"            ) _DELIM_ \
_EMIT_(PT_BOOL_1_0,        "BOOL (1/0)"        ) _DELIM_ \
_EMIT_(PT_BOOL_T_F,        "BOOL (T/F)"        ) _DELIM_ \
_EMIT_(PTN_BOOL_T_F,       "BOOL (T/F)"        ) _DELIM_ \
_EMIT_(PT_BOOL_TRUE_FALSE, "BOOL (TRUE/FALSE)" ) _DELIM_ \
_EMIT_(PTN_BOOL_TRUE_FALSE,"BOOL (TRUE/FALSE)" ) _DELIM_ \
_EMIT_(PT_BOOL_Y_N,        "BOOL (Y/N)"        ) _DELIM_ \
_EMIT_(PTN_BOOL_Y_N,       "BOOL (Y/N)"        ) _DELIM_ \
_EMIT_(PT_BOOL_YES_NO,     "BOOL (YES/NO)"     ) _DELIM_ \
_EMIT_(PTN_BOOL_YES_NO,    "BOOL (YES/NO)"     ) _DELIM_ \
_EMIT_(PT_FLOAT,           "FLOAT"             ) _DELIM_ \
_EMIT_(PT_DOUBLE,          "DOUBLE"            ) _DELIM_ \
_EMIT_(PT_NVAR_FIXED_CHAR, "NCHAR"             ) _DELIM_ \
_EMIT_(PTN_NVAR_FIXED_CHAR,"NCHAR"             ) _DELIM_ \
_EMIT_(PT_NVAR_CHAR,       "NVARCHAR"          ) _DELIM_ \
_EMIT_(PTN_NVAR_CHAR,      "NVARCHAR"          ) _DELIM_ \
_EMIT_(PT_INT1_ZERO_CHECK, "INT1"              ) _DELIM_ \
_EMIT_(PT_INT2_ZERO_CHECK, "INT2"              ) _DELIM_ \
_EMIT_(PT_INT4_ZERO_CHECK, "INT4"              ) _DELIM_ \
_EMIT_(PT_SYNTH1,          "SYNTH1"            ) _DELIM_ \
_EMIT_(PT_SYNTH2,          "SYNTH2"            ) _DELIM_ \
_EMIT_(PT_SYNTH4,          "SYNTH4"            ) _DELIM_ \
_EMIT_(PT_END,             "*END*"             )

-----------------------------------


In GNU Emacs 24.0.93.1 (x86_64-pc-linux-gnu, GTK+ Version 3.2.3)
 of 2012-02-08 on zelenka, modified by Debian
 (emacs-snapshot package, version 2:20120208-1)
Windowing system distributor `The X.Org Foundation', version 11.0.11001000
Configured using:
 `configure '--build' 'x86_64-linux-gnu' '--host' 'x86_64-linux-gnu'
 '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib'
 '--localstatedir=/var' '--infodir=/usr/share/info'
 '--mandir=/usr/share/man' '--with-pop=yes'
 '--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/24.0.93/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.0.93/site-lisp:/usr/share/emacs/site-lisp'
 '--without-compress-info' '--with-crt-dir=/usr/lib/x86_64-linux-gnu/'
 '--with-x=yes' '--with-x-toolkit=gtk3' '--with-imagemagick=yes'
 'build_alias=x86_64-linux-gnu' 'host_alias=x86_64-linux-gnu'
 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  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.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<escape> x r e p o r t - <tab> <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.

Load-path shadows:
/usr/share/emacs/24.0.93/site-lisp/debian-startup hides
/usr/share/emacs/site-lisp/debian-startup

Features:
(shadow sort gnus-util mail-extr message format-spec rfc822 mml easymenu
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mailabbrev mail-utils gmm-utils mailheader
emacsbug time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel
x-win x-dnd tool-bar dnd fontset image fringe lisp-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs
button faces cus-face files text-properties overlay sha1 md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process dbusbind dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty emacs)




Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#10792; Package emacs,cc-mode. (Sat, 11 Feb 2012 19:57:02 GMT) Full text and rfc822 format available.

Message #8 received at 10792 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: John Yates <john <at> yates-sheets.org>
Cc: acm <at> muc.de, 10792 <at> debbugs.gnu.org
Subject: Re: bug#10792: 24.0.93; emacs goes comatose opening C header
Date: Sat, 11 Feb 2012 21:55:06 +0200
> Date: Sat, 11 Feb 2012 12:26:36 -0500
> From: John Yates <john <at> yates-sheets.org>
> Cc: Alan Mackenzie <acm <at> muc.de>
> 
> When I attemt to visit the following header emacs locks up.  If
> I make the contents of the macro significantly shorted emacs is
> able to open and fontlock it successfully.

In bug #10664 (which is about a similar problem), Alan posted a patch.
Can you try it and see if that fixes your problem?




Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#10792; Package emacs,cc-mode. (Sat, 11 Feb 2012 20:08:01 GMT) Full text and rfc822 format available.

Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: John Yates <john <at> yates-sheets.org>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: 24.0.93; emacs goes comatose opening C header
Date: Sat, 11 Feb 2012 20:05:07 +0000
Hello, John

On Sat, Feb 11, 2012 at 12:26:36PM -0500, John Yates wrote:
> When I attemt to visit the following header emacs locks up.  If
> I make the contents of the macro significantly shorted emacs is
> able to open and fontlock it successfully.  To me this suggests
> some form of n-squared processing.

For once, this problem has nothing to do with font locking.  It happens
when the buffer length exceeds 3000 bytes.  :-)

> -----------------------------------

> #define PARSE_TYPE_LIST \
> _EMIT_(PT_ZERO,            "*ZERO*"            ) _DELIM_ \
> _EMIT_(PT_CHAR1,           "CHAR"              ) _DELIM_ \
> _EMIT_(PTN_CHAR1,          "CHAR"              ) _DELIM_ \

..... ..... ..... ..... ..... ..... ..... ..... ..... .....

> _EMIT_(PT_SYNTH2,          "SYNTH2"            ) _DELIM_ \
> _EMIT_(PT_SYNTH4,          "SYNTH4"            ) _DELIM_ \
> _EMIT_(PT_END,             "*END*"             )
 
-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#10792; Package emacs,cc-mode. (Sat, 11 Feb 2012 20:16:02 GMT) Full text and rfc822 format available.

Message #14 received at 10792 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: acm <at> muc.de, 10792 <at> debbugs.gnu.org, John Yates <john <at> yates-sheets.org>
Subject: Re: bug#10792: 24.0.93; emacs goes comatose opening C header
Date: Sat, 11 Feb 2012 21:14:16 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

> In bug #10664 (which is about a similar problem)

No, this is #10716.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#10792; Package emacs,cc-mode. (Sat, 11 Feb 2012 20:20:01 GMT) Full text and rfc822 format available.

Message #17 received at 10792 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 10792 <at> debbugs.gnu.org, john <at> yates-sheets.org
Subject: Re: bug#10792: 24.0.93; emacs goes comatose opening C header
Date: Sat, 11 Feb 2012 22:17:55 +0200
> Date: Sat, 11 Feb 2012 20:05:07 +0000
> From: Alan Mackenzie <acm <at> muc.de>
> Cc: 10792 <at> debbugs.gnu.org
> 
> On Sat, Feb 11, 2012 at 12:26:36PM -0500, John Yates wrote:
> > When I attemt to visit the following header emacs locks up.  If
> > I make the contents of the macro significantly shorted emacs is
> > able to open and fontlock it successfully.  To me this suggests
> > some form of n-squared processing.
> 
> For once, this problem has nothing to do with font locking.

It doesn't?  If I attach GDB to Emacs, I get this Lisp backtrace:

  Lisp Backtrace:
  "c-end-of-macro" (0x827d74)
  "c-syntactic-end-of-macro" (0x827fc4)
  "c-state-safe-place" (0x828224)
  "c-literal-limits" (0x828484)
  "c-set-fl-decl-start" (0x8286d4)
  "c-context-set-fl-decl-start" (0x828924)
  0x3422320 PVEC_COMPILED
  "mapc" (0x828d04)
  "c-font-lock-fontify-region" (0x828f54) <<<<<<<<<<<<<<<<<<<<<
  "font-lock-fontify-region" (0x8292d8)   <<<<<<<<<<<<<<<<<<<<<
  "run-hook-with-args" (0x8292d4)
  "byte-code" (0x8294a0)
  "jit-lock-fontify-now" (0x829894)       <<<<<<<<<<<<<<<<<<<<<
  "jit-lock-function" (0x829c24)          <<<<<<<<<<<<<<<<<<<<<
  "recenter" (0x82f6b4)
  "end-of-buffer" (0x82f954)
  "call-interactively" (0x82fb84)

> It happens when the buffer length exceeds 3000 bytes.  :-)

You mean, the macro definition length, right?




Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#10792; Package emacs,cc-mode. (Sat, 11 Feb 2012 20:25:01 GMT) Full text and rfc822 format available.

Message #20 received at 10792 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 10792 <at> debbugs.gnu.org, john <at> yates-sheets.org
Subject: Re: bug#10792: 24.0.93; emacs goes comatose opening C header
Date: Sat, 11 Feb 2012 20:22:53 +0000
Hello, Eli.

On Sat, Feb 11, 2012 at 10:17:55PM +0200, Eli Zaretskii wrote:
> > Date: Sat, 11 Feb 2012 20:05:07 +0000
> > From: Alan Mackenzie <acm <at> muc.de>
> > Cc: 10792 <at> debbugs.gnu.org

> > On Sat, Feb 11, 2012 at 12:26:36PM -0500, John Yates wrote:
> > > When I attemt to visit the following header emacs locks up.  If
> > > I make the contents of the macro significantly shorted emacs is
> > > able to open and fontlock it successfully.  To me this suggests
> > > some form of n-squared processing.

> > For once, this problem has nothing to do with font locking.

> It doesn't?

It hangs for me with font lock disabled.

> If I attach GDB to Emacs, I get this Lisp backtrace:

>   Lisp Backtrace:
>   "c-end-of-macro" (0x827d74)
>   "c-syntactic-end-of-macro" (0x827fc4)
>   "c-state-safe-place" (0x828224)
>   "c-literal-limits" (0x828484)
>   "c-set-fl-decl-start" (0x8286d4)
>   "c-context-set-fl-decl-start" (0x828924)
>   0x3422320 PVEC_COMPILED
>   "mapc" (0x828d04)
>   "c-font-lock-fontify-region" (0x828f54) <<<<<<<<<<<<<<<<<<<<<
>   "font-lock-fontify-region" (0x8292d8)   <<<<<<<<<<<<<<<<<<<<<
>   "run-hook-with-args" (0x8292d4)
>   "byte-code" (0x8294a0)
>   "jit-lock-fontify-now" (0x829894)       <<<<<<<<<<<<<<<<<<<<<
>   "jit-lock-function" (0x829c24)          <<<<<<<<<<<<<<<<<<<<<
>   "recenter" (0x82f6b4)
>   "end-of-buffer" (0x82f954)
>   "call-interactively" (0x82fb84)

> > It happens when the buffer length exceeds 3000 bytes.  :-)

> You mean, the macro definition length, right?

Sorry, yes.

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#10792; Package emacs,cc-mode. (Sat, 11 Feb 2012 20:40:02 GMT) Full text and rfc822 format available.

Message #23 received at 10792 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 10792 <at> debbugs.gnu.org, john <at> yates-sheets.org
Subject: Re: bug#10792: 24.0.93; emacs goes comatose opening C header
Date: Sat, 11 Feb 2012 22:38:25 +0200
> Date: Sat, 11 Feb 2012 20:22:53 +0000
> Cc: john <at> yates-sheets.org, 10792 <at> debbugs.gnu.org
> From: Alan Mackenzie <acm <at> muc.de>
> 
> > > For once, this problem has nothing to do with font locking.
> 
> > It doesn't?
> 
> It hangs for me with font lock disabled.

How did you disable font lock?

If I type "M-x global-font-lock-mode RET" before visiting a file with
that macro, Emacs doesn't hang for me.  This is with today's trunk.




Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#10792; Package emacs,cc-mode. (Sat, 11 Feb 2012 21:56:01 GMT) Full text and rfc822 format available.

Message #26 received at 10792 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 10792 <at> debbugs.gnu.org, john <at> yates-sheets.org
Subject: Re: bug#10792: 24.0.93; emacs goes comatose opening C header
Date: Sat, 11 Feb 2012 21:53:53 +0000
Hello, Eli.

On Sat, Feb 11, 2012 at 10:38:25PM +0200, Eli Zaretskii wrote:
> > Date: Sat, 11 Feb 2012 20:22:53 +0000
> > Cc: john <at> yates-sheets.org, 10792 <at> debbugs.gnu.org
> > From: Alan Mackenzie <acm <at> muc.de>

> > > > For once, this problem has nothing to do with font locking.

> > > It doesn't?

> > It hangs for me with font lock disabled.

> How did you disable font lock?

By persistent hammering on C-g.

> If I type "M-x global-font-lock-mode RET" before visiting a file with
> that macro, Emacs doesn't hang for me.  This is with today's trunk.

Uh, OK.

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#10792; Package emacs,cc-mode. (Sat, 11 Feb 2012 22:42:01 GMT) Full text and rfc822 format available.

Message #29 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: John Yates <john <at> yates-sheets.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, bug-gnu-emacs <at> gnu.org
Subject: Re: 24.0.93; emacs goes comatose opening C header
Date: Sat, 11 Feb 2012 22:39:23 +0000
Hi, John

On Sat, Feb 11, 2012 at 12:26:36PM -0500, John Yates wrote:
> When I attemt to visit the following header emacs locks up.  If
> I make the contents of the macro significantly shorted emacs is
> able to open and fontlock it successfully.  To me this suggests
> some form of n-squared processing.

> #define PARSE_TYPE_LIST \
> _EMIT_(PT_ZERO,            "*ZERO*"            ) _DELIM_ \
> _EMIT_(PT_CHAR1,           "CHAR"              ) _DELIM_ \
> _EMIT_(PTN_CHAR1,          "CHAR"              ) _DELIM_ \
  ..... ..... ..... ..... .....
> _EMIT_(PT_SYNTH1,          "SYNTH1"            ) _DELIM_ \
> _EMIT_(PT_SYNTH2,          "SYNTH2"            ) _DELIM_ \
> _EMIT_(PT_SYNTH4,          "SYNTH4"            ) _DELIM_ \
> _EMIT_(PT_END,             "*END*"             )

Would you try this patch, please, and let me know how it goes.
Thanks for the bug report.



*** orig/cc-engine.el	2012-02-11 20:16:13.000000000 +0000
--- cc-engine.el	2012-02-11 22:30:58.000000000 +0000
***************
*** 2130,2136 ****
      (widen)
      (save-excursion
        (let ((c c-state-nonlit-pos-cache)
! 	    pos npos lit macro-beg)
  	;; Trim the cache to take account of buffer changes.
  	(while (and c (> (car c) c-state-nonlit-pos-cache-limit))
  	  (setq c (cdr c)))
--- 2130,2136 ----
      (widen)
      (save-excursion
        (let ((c c-state-nonlit-pos-cache)
! 	    pos npos lit macro-beg macro-end)
  	;; Trim the cache to take account of buffer changes.
  	(while (and c (> (car c) c-state-nonlit-pos-cache-limit))
  	  (setq c (cdr c)))
***************
*** 2144,2171 ****
  	    ;; Add an element to `c-state-nonlit-pos-cache' each iteration.
  	    (and
  	     (<= (setq npos (+ pos c-state-nonlit-pos-interval)) here)
  	     (progn
  	       (setq lit (car (cddr (c-state-pp-to-literal pos npos))))
  	       (cond
  		((null lit)
- 		 (setq pos npos)
  		 t)
  		((<= (cdr lit) here)
! 		 (setq pos (cdr lit))
  		 t)
  		(t
- 		 (setq pos (car lit))
  		 nil))))
  
! 	  (goto-char pos)
! 	  (when (and (c-beginning-of-macro) (/= (point) pos))
! 	      (setq macro-beg (point))
! 	      (c-syntactic-end-of-macro)
! 	      (or (eobp) (forward-char))
! 	      (setq pos (if (<= (point) here)
! 			    (point)
! 			  macro-beg)))
! 	    (setq c-state-nonlit-pos-cache (cons pos c-state-nonlit-pos-cache)))
  
  	(if (> pos c-state-nonlit-pos-cache-limit)
  	    (setq c-state-nonlit-pos-cache-limit pos))
--- 2144,2182 ----
  	    ;; Add an element to `c-state-nonlit-pos-cache' each iteration.
  	    (and
  	     (<= (setq npos (+ pos c-state-nonlit-pos-interval)) here)
+ 
+ 	     ;; Test for being in a literal.
  	     (progn
  	       (setq lit (car (cddr (c-state-pp-to-literal pos npos))))
  	       (cond
  		((null lit)
  		 t)
  		((<= (cdr lit) here)
! 		 (setq npos (cdr lit))
! 		 t)
! 		(t
! 		 nil)))
! 
! 	     ;; Test for being in a macro.
! 	     (progn
! 	       (goto-char npos)
! 	       (setq macro-beg
! 		     (and (c-beginning-of-macro) (/= (point) npos) (point)))
! 	       (when macro-beg
! 		 (c-syntactic-end-of-macro)
! 		 (or (eobp) (forward-char))
! 		 (setq macro-end (point)))
! 	       (cond
! 		((null macro-beg)
! 		 t)
! 		((<= macro-end here)
! 		 (setq npos macro-end)
  		 t)
  		(t
  		 nil))))
  
! 	  (setq pos npos)
! 	  (setq c-state-nonlit-pos-cache (cons pos c-state-nonlit-pos-cache)))
  
  	(if (> pos c-state-nonlit-pos-cache-limit)
  	    (setq c-state-nonlit-pos-cache-limit pos))



-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#10792; Package emacs,cc-mode. (Sun, 12 Feb 2012 00:31:01 GMT) Full text and rfc822 format available.

Message #32 received at submit <at> debbugs.gnu.org (full text, mbox):

From: John Yates <john <at> yates-sheets.org>
To: Alan Mackenzie <acm <at> muc.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, bug-gnu-emacs <at> gnu.org
Subject: Re: 24.0.93; emacs goes comatose opening C header
Date: Sat, 11 Feb 2012 19:28:39 -0500
Alan,

Congratuations!  You have saved my weekend!

I use Julien Danjou's emacs-snapshot  (deb http://emacs.naquadah.org/
unstable/).  After manually applying the patch (and deleting the .elc
:-) I am able to open both files.  There is some sluggishness but I
understand that these are probably cc-engine torture tests.  Further I
am running uncompiled code.  On the brighter side the font-locking of
these macro-intensive sources is _much_ more uniform and satisfying
than at any time in the past.

Looking forward to this fix showing up in a future snapshot.

Thanks again,

/john




Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#10792; Package emacs,cc-mode. (Sun, 12 Feb 2012 00:56:01 GMT) Full text and rfc822 format available.

Message #35 received at submit <at> debbugs.gnu.org (full text, mbox):

From: John Yates <john <at> yates-sheets.org>
To: Alan Mackenzie <acm <at> muc.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, bug-gnu-emacs <at> gnu.org
Subject: Re: 24.0.93; emacs goes comatose opening C header
Date: Sat, 11 Feb 2012 19:53:38 -0500
Just a quick follow up to say that I go cc-engine compiled.  The
scrolling performance is greatly improved.  On a 2.5 year old 3 GHz
AMD Phenom II X4 945 there is just the slightest hint of a delay.

Thanks again,

/john

On Sat, Feb 11, 2012 at 7:28 PM, John Yates <john <at> yates-sheets.org> wrote:
> Alan,
>
> Congratuations!  You have saved my weekend!
>
> I use Julien Danjou's emacs-snapshot  (deb http://emacs.naquadah.org/
> unstable/).  After manually applying the patch (and deleting the .elc
> :-) I am able to open both files.  There is some sluggishness but I
> understand that these are probably cc-engine torture tests.  Further I
> am running uncompiled code.  On the brighter side the font-locking of
> these macro-intensive sources is _much_ more uniform and satisfying
> than at any time in the past.
>
> Looking forward to this fix showing up in a future snapshot.
>
> Thanks again,
>
> /john



-- 
John Yates
257 Nashoba Rd
Concord, MA 01742
978 371-4923




Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#10792; Package emacs,cc-mode. (Tue, 14 Feb 2012 05:48:01 GMT) Full text and rfc822 format available.

Message #38 received at 10792 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> gnu.org>
To: John Yates <john <at> yates-sheets.org>
Cc: Alan Mackenzie <acm <at> muc.de>, 10792 <at> debbugs.gnu.org
Subject: Re: bug#10792: 24.0.93; emacs goes comatose opening C header
Date: Tue, 14 Feb 2012 13:45:22 +0800
John Yates <john <at> yates-sheets.org> writes:

> Looking forward to this fix showing up in a future snapshot.

Alan's committed this to trunk (revno 107261).  I assume the bug is
fixed; closing.




bug closed, send any further explanations to 10792 <at> debbugs.gnu.org and John Yates <john <at> yates-sheets.org> Request was from Chong Yidong <cyd <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 14 Feb 2012 05:48:03 GMT) Full text and rfc822 format available.

Forcibly Merged 10716 10750 10792. Request was from Chong Yidong <cyd <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 14 Feb 2012 13:51:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 14 Mar 2012 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 158 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.