unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* font-lock latency
@ 2002-09-02 21:50 Simon Josefsson
  2002-09-03  5:01 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Josefsson @ 2002-09-02 21:50 UTC (permalink / raw)


This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.

Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
and to the gnu.emacs.bug news group.

In GNU Emacs 21.2.1 (i386-debian-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2002-03-22 on raven, modified by Debian
configured using `configure  i386-debian-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes --with-x=yes --with-x-toolkit=athena --without-gif'
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: nil
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

This has really started to annoy me, and isn't fixed in CVS, so I'm
reporting it.  I did not investigate the causes so this may be known,
but I didn't find anything in PROBLEMS.  It doesn't happen in Emacs 20
or Emacs 19.

$ emacs -q --no-site-file foo.c
M-x font-lock-mode RET

change the line

#include "foo.h"

into

#include "foo.

and wait a couple of seconds.  Then add the " back.  Font locking in
the buffer is now messed up and the only way to restore it is to wait
a couple of seconds again.

I find myself wasting many seconds each day staring at the screen
waiting for it to redisplay. ;-)

Is there a workaround?  Ideally I think this should not be present at
all by default.  IMHO, highlighting of unterminated strings should be
disabled if this can't be fixed properly.

foo.c looks like:

#include "foo.h"

int
main()
{
  int i;
  for (i=0;i<42;i++)
    puts("foo");
  return i;
}


Recent input:
<down-mouse-5> <mouse-5> <double-down-mouse-5> <double-mouse-5> 
<down-mouse-5> <mouse-5> <down-mouse-1> <mouse-1> <down-mouse-5> 
<mouse-5> <double-down-mouse-5> <double-mouse-5> <triple-down-mouse-5> 
<triple-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<down-mouse-1> <mouse-1> M-x f o n t - o c <backspace> 
<backspace> l o c k - m o d e <return> <down-mouse-1> 
<mouse-1> <backspace> SPC f o o " C-_ C-_ M-x r e p 
o r <tab> e <backspace> <return>

Recent messages:
Loading image...done
Loading tooltip...done
For information about the GNU Project and its goals, type C-h C-p.
Loading cc-mode...done
Loading font-lock...
Loading regexp-opt...done
Loading font-lock...done
Font-Lock mode enabled
Undo! [2 times]
Loading emacsbug...done

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: font-lock latency
  2002-09-02 21:50 font-lock latency Simon Josefsson
@ 2002-09-03  5:01 ` Eli Zaretskii
  2002-09-03 10:21   ` Simon Josefsson
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2002-09-03  5:01 UTC (permalink / raw)
  Cc: bug-gnu-emacs


On Mon, 2 Sep 2002, Simon Josefsson wrote:

> $ emacs -q --no-site-file foo.c
> M-x font-lock-mode RET
> 
> change the line
> 
> #include "foo.h"
> 
> into
> 
> #include "foo.
> 
> and wait a couple of seconds.  Then add the " back.  Font locking in
> the buffer is now messed up and the only way to restore it is to wait
> a couple of seconds again.

Does it help to type "M-g M-g" instead of waiting?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: font-lock latency
  2002-09-03  5:01 ` Eli Zaretskii
@ 2002-09-03 10:21   ` Simon Josefsson
  2002-09-03 16:17     ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Josefsson @ 2002-09-03 10:21 UTC (permalink / raw)
  Cc: bug-gnu-emacs

Eli Zaretskii <eliz@is.elta.co.il> writes:

> On Mon, 2 Sep 2002, Simon Josefsson wrote:
>
>> $ emacs -q --no-site-file foo.c
>> M-x font-lock-mode RET
>> 
>> change the line
>> 
>> #include "foo.h"
>> 
>> into
>> 
>> #include "foo.
>> 
>> and wait a couple of seconds.  Then add the " back.  Font locking in
>> the buffer is now messed up and the only way to restore it is to wait
>> a couple of seconds again.
>
> Does it help to type "M-g M-g" instead of waiting?

Not completely, the main() function body is correctly re-highlighted,
but the main() function definition line is still incorrect.  Pressing
M-g M-g again does nothing.  After a few seconds it looks OK.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: font-lock latency
  2002-09-03 10:21   ` Simon Josefsson
@ 2002-09-03 16:17     ` Eli Zaretskii
  2002-09-03 16:41       ` Simon Josefsson
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2002-09-03 16:17 UTC (permalink / raw)
  Cc: bug-gnu-emacs


On Tue, 3 Sep 2002, Simon Josefsson wrote:

> > Does it help to type "M-g M-g" instead of waiting?
> 
> Not completely, the main() function body is correctly re-highlighted,
> but the main() function definition line is still incorrect.

It might help to move point to the incorrectly highlighted line and press 
M-g M-g again.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: font-lock latency
  2002-09-03 16:17     ` Eli Zaretskii
@ 2002-09-03 16:41       ` Simon Josefsson
  2002-09-05  2:47         ` Richard Stallman
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Josefsson @ 2002-09-03 16:41 UTC (permalink / raw)
  Cc: bug-gnu-emacs

Eli Zaretskii <eliz@is.elta.co.il> writes:

> On Tue, 3 Sep 2002, Simon Josefsson wrote:
>
>> > Does it help to type "M-g M-g" instead of waiting?
>> 
>> Not completely, the main() function body is correctly re-highlighted,
>> but the main() function definition line is still incorrect.
>
> It might help to move point to the incorrectly highlighted line and press 
> M-g M-g again.

Doesn't help, the line is still incorrectly highlighted.  I even tried
pressing M-g M-g on every line of the buffer, but it was still wrong.
C-l doesn't help either.  Only way to get it right is to wait a few
(3?) seconds.

Is it possible to disable the unterminated strings/comments/etc
highlighting alltogether?  I think I would find it annoying to have
the rest of the buffer change color, even if the buffer was correctly
re-colorized when I terminate the string/comment/etc.

Is it possible to decrease the delay before it is re-highlighted
correctly?  I thought `jit-lock-stealth-time' would do this, but it
doesn't seem to have any effect.

Thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: font-lock latency
  2002-09-03 16:41       ` Simon Josefsson
@ 2002-09-05  2:47         ` Richard Stallman
  2002-09-05  3:58           ` Simon Josefsson
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Stallman @ 2002-09-05  2:47 UTC (permalink / raw)
  Cc: eliz, bug-gnu-emacs

    Doesn't help, the line is still incorrectly highlighted.  I even tried
    pressing M-g M-g on every line of the buffer, but it was still wrong.
    C-l doesn't help either.  Only way to get it right is to wait a few
    (3?) seconds.

If some code that runs after 3 seconds gets it right,
the first thing to do is find that code,
and see how it gets the right results.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: font-lock latency
  2002-09-05  2:47         ` Richard Stallman
@ 2002-09-05  3:58           ` Simon Josefsson
  2002-09-09  1:33             ` Simon Josefsson
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Josefsson @ 2002-09-05  3:58 UTC (permalink / raw)
  Cc: eliz, bug-gnu-emacs

Richard Stallman <rms@gnu.org> writes:

>     Doesn't help, the line is still incorrectly highlighted.  I even tried
>     pressing M-g M-g on every line of the buffer, but it was still wrong.
>     C-l doesn't help either.  Only way to get it right is to wait a few
>     (3?) seconds.
>
> If some code that runs after 3 seconds gets it right,
> the first thing to do is find that code,
> and see how it gets the right results.

The code is `jit-lock-stealth-fontify'.  I now realized that if I set
`jit-lock-stealth-time' to 0 _before_ I enable font-lock-mode, it does
what I want -- that is, update the buffer immediately.

jit-lock.el looks like voodoo to me, so I'm not going to try to find
out what caused the original problem.  Unless it has negative
consequences, I think the default of `jit-lock-stealth-time' should be
changed to 0 so that this bug isn't visible.  Assuming noone finds the
original cause of the problem, that is.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: font-lock latency
  2002-09-05  3:58           ` Simon Josefsson
@ 2002-09-09  1:33             ` Simon Josefsson
  0 siblings, 0 replies; 8+ messages in thread
From: Simon Josefsson @ 2002-09-09  1:33 UTC (permalink / raw)
  Cc: bug-gnu-emacs

Simon Josefsson <jas@extundo.com> writes:

> Richard Stallman <rms@gnu.org> writes:
>
>>     Doesn't help, the line is still incorrectly highlighted.  I even tried
>>     pressing M-g M-g on every line of the buffer, but it was still wrong.
>>     C-l doesn't help either.  Only way to get it right is to wait a few
>>     (3?) seconds.
>>
>> If some code that runs after 3 seconds gets it right,
>> the first thing to do is find that code,
>> and see how it gets the right results.
>
> The code is `jit-lock-stealth-fontify'.  I now realized that if I set
> `jit-lock-stealth-time' to 0 _before_ I enable font-lock-mode, it does
> what I want -- that is, update the buffer immediately.
>
> jit-lock.el looks like voodoo to me, so I'm not going to try to find
> out what caused the original problem.  Unless it has negative
> consequences, I think the default of `jit-lock-stealth-time' should be
> changed to 0 so that this bug isn't visible.  Assuming noone finds the
> original cause of the problem, that is.

I revoke that suggestion, setting `jit-lock-stealth-fontify' to 0
seems to trigger other problems.  After editing a file for a while
(difficult to reproduce) I get a backtrace like the below when
pressing any key.

I am now running with j-l-s-f set to 1 even though it annoys me, and I
haven't seen the backtrace yet.

Debugger entered--Lisp error: (args-out-of-range 6 4)
  font-lock-fontify-keywords-region(35308 35328 nil)
  font-lock-default-fontify-region(35308 35317 nil)
  font-lock-fontify-region(35308 35317)
  run-hook-with-args(font-lock-fontify-region 35308 35317)
  jit-lock-fontify-now(35308 35808)
  jit-lock-function(35308)

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-09-09  1:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-02 21:50 font-lock latency Simon Josefsson
2002-09-03  5:01 ` Eli Zaretskii
2002-09-03 10:21   ` Simon Josefsson
2002-09-03 16:17     ` Eli Zaretskii
2002-09-03 16:41       ` Simon Josefsson
2002-09-05  2:47         ` Richard Stallman
2002-09-05  3:58           ` Simon Josefsson
2002-09-09  1:33             ` Simon Josefsson

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).