[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Mysterious fontification/C++ context issue - Patch for beginning-of-
From: |
Chong Yidong |
Subject: |
Re: Mysterious fontification/C++ context issue - Patch for beginning-of-defun-raw. |
Date: |
Sat, 16 Dec 2006 13:14:49 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux) |
martin rudalics <address@hidden> writes:
>>>M-> ran almost instantaneously before `beginning-of-defun-raw' changed.
>>>And you did fill CC Mode's cache already before the change. I could
>>>imagine it's because font-locking runs `beginning-of-defun' repeatedly
>>>for decreasing buffer positions and the `syntax-ppss' cache doesn't
>>>handle these cases optimally.
>>
>> I thought "no, can't be, 'cause I was careful to treat this correctly", so
>> I went and measured it to give a clear proof of it, and much to my surprise
>> you seemed to be right:
>>
>> And sure enough the problem was that in xdisp.c
>> syntax-begin-function is not nil but set to c-beginning-of-syntax which
>> doesn't make any sense: if you don't want to use a heuristic, then set the
>> damn thing to nil.
>
> Jumping to the end of xdisp.c still takes four seconds. I continue to
> feel puzzled. Note that Alan binds `syntax-begin-function' to nil in
> his `beginning-of-defun-raw' hence why should this have any impact in
> the first place? I must take another look in the basements of that.
There is indeed something fishy going on: xdisp.c has 722096
characters, and
(progn (goto-char 700000) (redisplay)) takes 0.25s
(progn (goto-char 720500) (redisplay)) takes 0.28s
(progn (goto-char 720522) (redisplay)) takes 0.26s
(progn (goto-char 720550) (redisplay)) takes 2.34s
(progn (goto-char 721000) (redisplay)) takes 2.24s
(progn (goto-char 722096) (redisplay)) takes 2.31s
Maybe a cache is overflowing somewhere.
- Re: Mysterious fontification/C++ context issue - Patch for beginning-of-defun-raw., (continued)
- Re: Mysterious fontification/C++ context issue - Patch for beginning-of-defun-raw., martin rudalics, 2006/12/17
- Re: Mysterious fontification/C++ context issue - Patch for c-basic-common-init, Alan Mackenzie, 2006/12/17
- Re: Mysterious fontification/C++ context issue - Patch for c-basic-common-init, Chong Yidong, 2006/12/17
- Re: Mysterious fontification/C++ context issue - Patch for c-basic-common-init, Alan Mackenzie, 2006/12/17
- Re: Mysterious fontification/C++ context issue - Patch for c-basic-common-init, Chong Yidong, 2006/12/17
- Re: Mysterious fontification/C++ context issue - Patch for beginning-of-defun-raw., Stefan Monnier, 2006/12/17
- Re: Mysterious fontification/C++ context issue - Patch for beginning-of-defun-raw., Stefan Monnier, 2006/12/15
- Re: Mysterious fontification/C++ context issue - Patch for beginning-of-defun-raw., martin rudalics, 2006/12/16
- Re: Mysterious fontification/C++ context issue - Patch for beginning-of-defun-raw.,
Chong Yidong <=
- Re: Mysterious fontification/C++ context issue - Patch for beginning-of-defun-raw., martin rudalics, 2006/12/16
- Re: Mysterious fontification/C++ context issue - Patch for beginning-of-defun-raw., martin rudalics, 2006/12/16
- Re: Mysterious fontification/C++ context issue - Patch for beginning-of-defun-raw., Chong Yidong, 2006/12/16
- Re: Mysterious fontification/C++ context issue - Patch for beginning-of-defun-raw., martin rudalics, 2006/12/16
- Re: Mysterious fontification/C++ context issue - Patch for beginning-of-defun-raw., Chong Yidong, 2006/12/16
- Re: Mysterious fontification/C++ context issue - Patch for beginning-of-defun-raw., Chong Yidong, 2006/12/16
- Re: Mysterious fontification/C++ context issue - Patch for beginning-of-defun-raw., martin rudalics, 2006/12/16
- Re: Mysterious fontification/C++ context issue - Patch for beginning-of-defun-raw., Stefan Monnier, 2006/12/16
- Re: Mysterious fontification/C++ context issue - Patch for beginning-of-defun-raw., martin rudalics, 2006/12/16
- Re: Mysterious fontification/C++ context issue - Patch for beginning-of-defun-raw., Stefan Monnier, 2006/12/16