emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

jit lock sit-for provokes redisplay provokes imenu


From: Marshall, Simon
Subject: jit lock sit-for provokes redisplay provokes imenu
Date: Thu, 20 Jul 2006 10:55:47 +0100

In trying to monitor a problem with imenu and to find out why emacs seems so
slow and unresponsive while editing, I also noticed that it is getting
called repeatedly after emacs has been idle for a while.  I currently have
these timers active:

timer-idle-list is a variable defined in `C source code'.
Its value is 
([t 0 0 125000 t show-paren-function nil t]
 [t 0 0 500000 0.5 blink-cursor-start nil t]
 [t 0 0 500000 t jit-lock-context-fontify nil t]
 [nil 0 30 0 t jit-lock-stealth-fontify nil t])

After ~30s of idle time, I see imenu-update-menubar being called
continuously by emacs.  At a guess, imenu is being triggered because
jit-lock has kicked in.  At the time, I had several frames open, including
one containing a finished *compilation* buffer and another containing a
large C++ buffer.  Also, the minibuffer (in a separate frame) was showing a
message every time imenu-update-menubar was called.

This is the backtrace when I paused emacs.  Unfortunately, I thought it
useful to compile with Sun cc (rather than gcc like most people) and so I am
debugging with sunstudio/dbx.  I don't know how to debug what Lisp forms are
being evaluated.  However, frame 38 shows that some bytecode called
Fredisplay.  The only lisp code I can find that calls redisplay is subr.el's
sit-for.  It is worth noting that jit-lock-stealth-fontify calls sit-for.
Putting message forms in it suggests that redisplay is a consequence of its
sit-fors.

Changing its calls of sit-for to pass t for NODISP does not seem to stop the
repeated calls of imenu-update-menubar.

Changing its calls of (sit-for ...) to (not (input-pending-p)) does stop
them, though of course changes the behaviour of jit-lock.

Any thoughts before I recompile with gcc?

=>[1] re_match_2_internal(bufp = 0x4c0bc4, string1 = 0x1ea4228 "[...]" ...,
size2 = 217774, pos = 2267, regs = 0x4b5ce4, stop = 14692), line 5360 in
"regex.c"
  [2] re_search_2(bufp = 0x4c0bc4, str1 = 0x1ea4228 "[...]" ..., size2 =
217774, startpos = 2267, range = -2267, regs = 0x4b5ce4, stop = 14692), line
4383 in "regex.c"
  [3] search_buffer(string = 1623676992, pos = 14693, pos_byte = 14693, lim
= 1, lim_byte = 1, n = -1, RE = 1, trt = 541931520, inverse_trt = 541931520,
posix = 0), line 1109 in "search.c"
  [4] search_command(string = 1623676992, bound = 541931520, noerror =
541931568, count = 541931520, direction = -1, RE = 1, posix = 0), line 947
in "search.c"
  [5] Fre_search_backward(regexp = 1623676992, bound = 541931520, noerror =
541931568, count = 541931520), line 2192 in "search.c"
  [6] Ffuncall(nargs = 4, args = 0xffbeaa90), line 2926 in "eval.c"
  [7] Fbyte_code(bytestr = 1621914496, vector = -2136224256, maxdepth = 8),
line 679 in "bytecode.c"
  [8] funcall_lambda(fun = -2136177120, nargs = 1, arg_vector = 0xffbead8c),
line 3104 in "eval.c"
  [9] Ffuncall(nargs = 2, args = 0xffbead88), line 2961 in "eval.c"
  [10] Fbyte_code(bytestr = 1621914448, vector = -2137086912, maxdepth = 3),
line 679 in "bytecode.c"
  [11] funcall_lambda(fun = -2136176640, nargs = 0, arg_vector =
0xffbeb074), line 3104 in "eval.c"
  [12] Ffuncall(nargs = 1, args = 0xffbeb070), line 2961 in "eval.c"
  [13] Fbyte_code(bytestr = 1621914272, vector = -2137086720, maxdepth = 2),
line 679 in "bytecode.c"
  [14] funcall_lambda(fun = -2136175552, nargs = 1, arg_vector =
0xffbeb290), line 3104 in "eval.c"
  [15] apply_lambda(fun = -2136175552, args = -1586393080, eval_flag = 1),
line 3026 in "eval.c"
  [16] Feval(form = -1586393072), line 2288 in "eval.c"
  [17] Flet(args = -1586398248), line 1039 in "eval.c"
  [18] Feval(form = -1586393056), line 2193 in "eval.c"
  [19] Fprogn(args = -1585935904), line 434 in "eval.c"
  [20] Feval(form = -1585935960), line 2193 in "eval.c"
  [21] Fif(args = -1585935976), line 382 in "eval.c"
  [22] Feval(form = -1585935984), line 2193 in "eval.c"
  [23] Feval(form = -1586392776), line 2304 in "eval.c"
  [24] Fprogn(args = -1586399152), line 434 in "eval.c"
  [25] funcall_lambda(fun = -1586399160, nargs = 0, arg_vector =
0xffbebc6c), line 3095 in "eval.c"
  [26] Ffuncall(nargs = 1, args = 0xffbebc68), line 2972 in "eval.c"
  [27] run_hook_with_args(nargs = 1, args = 0xffbebc68, cond =
to_completion), line 2574 in "eval.c"
  [28] Frun_hooks(nargs = 1, args = 0xffbebd9c), line 2437 in "eval.c"
  [29] Ffuncall(nargs = 2, args = 0xffbebd98), line 2896 in "eval.c"
  [30] call1(fn = 542022568, arg1 = 542148848), line 2696 in "eval.c"
  [31] safe_run_hooks_1(hook = 0), line 2037 in "keyboard.c"
  [32] internal_condition_case(bfun = 0x1bea68 =
&`emacs`keyboard.c`safe_run_hooks_1(Lisp_Object hook), handlers = 541931568,
hfun = 0x1beab8 = &`emacs`keyboard.c`safe_run_hooks_error(Lisp_Object
data)), line 1473 in "eval.c"
  [33] safe_run_hooks(hook = 542148848), line 2065 in "keyboard.c"
  [34] update_menu_bar(f = 0x936a00, save_match_data = 0), line 9173 in
"xdisp.c"
  [35] prepare_menu_bars(), line 9059 in "xdisp.c"
  [36] redisplay_internal(preserve_echo_area = 1), line 10874 in "xdisp.c"
  [37] redisplay_preserve_echo_area(from_where = 2), line 11480 in "xdisp.c"
  [38] Fredisplay(force = 541931520), line 6568 in "dispnew.c"
  [39] Ffuncall(nargs = 1, args = 0xffbec6d0), line 2915 in "eval.c"
  [40] Fbyte_code(bytestr = 1614173560, vector = -2143922752, maxdepth = 3),
line 679 in "bytecode.c"
  [41] funcall_lambda(fun = -2143922884, nargs = 1, arg_vector =
0xffbec9bc), line 3104 in "eval.c"
  [42] Ffuncall(nargs = 2, args = 0xffbec9b8), line 2961 in "eval.c"
  [43] Fbyte_code(bytestr = 1614890816, vector = -2143205268, maxdepth = 6),
line 679 in "bytecode.c"
  [44] Feval(form = -1606334672), line 2253 in "eval.c"
  [45] internal_lisp_condition_case(var = 541931520, bodyform = -1606334672,
handlers = -1606334000), line 1418 in "eval.c"
  [46] Fbyte_code(bytestr = 1614890696, vector = -2143205640, maxdepth = 4),
line 869 in "bytecode.c"
  [47] funcall_lambda(fun = -2143205716, nargs = 0, arg_vector =
0xffbed198), line 3104 in "eval.c"
  [48] Ffuncall(nargs = 1, args = 0xffbed194), line 2961 in "eval.c"
  [49] Fapply(nargs = 2, args = 0xffbed194), line 2344 in "eval.c"
  [50] Ffuncall(nargs = 3, args = 0xffbed190), line 2896 in "eval.c"
  [51] Fbyte_code(bytestr = 1614936284, vector = -2143160064, maxdepth = 4),
line 679 in "bytecode.c"
  [52] Feval(form = -1606289204), line 2253 in "eval.c"
  [53] internal_lisp_condition_case(var = 541931520, bodyform = -1606289204,
handlers = -1606289120), line 1418 in "eval.c"
  [54] Fbyte_code(bytestr = 1614936012, vector = -2143160224, maxdepth = 5),
line 869 in "bytecode.c"
  [55] funcall_lambda(fun = -2143160408, nargs = 1, arg_vector =
0xffbed81c), line 3104 in "eval.c"
  [56] Ffuncall(nargs = 2, args = 0xffbed818), line 2961 in "eval.c"
  [57] call1(fn = 541979536, arg1 = -2136104384), line 2696 in "eval.c"
  [58] timer_check(do_it_now = 1), line 4477 in "keyboard.c"
  [59] readable_events(flags = 1), line 3516 in "keyboard.c"
  [60] get_input_pending(addr = 0x4bf8c0, flags = 1), line 6596 in
"keyboard.c"
  [61] detect_input_pending_run_timers(do_display = 1), line 9959 in
"keyboard.c"
  [62] wait_reading_process_output(time_limit = 30, microsecs = 0, read_kbd
= -1, do_display = 1, wait_for_cell = 541931520, wait_proc = (nil),
just_wait_proc = 0), line 4653 in "process.c"
  [63] sit_for(timeout = 30, reading = 1, do_display = 1), line 6544 in
"dispnew.c"
  [64] read_char(commandflag = 1, nmaps = 3, maps = 0xffbedf38, prev_event =
541931520, used_mouse_menu = 0xffbedfbc), line 2775 in "keyboard.c"
  [65] read_key_sequence(keybuf = 0xffbee128, bufsize = 30, prompt =
541931520, dont_downcase_last = 0, can_return_switch_frame = 1,
fix_current_buffer = 1), line 8863 in "keyboard.c"
  [66] command_loop_1(), line 1538 in "keyboard.c"
  [67] internal_condition_case(bfun = 0x1bb738 = &command_loop_1(), handlers
= 541988464, hfun = 0x1badf0 = &cmd_error(Lisp_Object data)), line 1473 in
"eval.c"
  [68] command_loop_2(), line 1328 in "keyboard.c"
  [69] internal_catch(tag = 541989888, func = 0x1bb350 = &command_loop_2(),
arg = 541931520), line 1213 in "eval.c"
  [70] command_loop(), line 1307 in "keyboard.c"
  [71] recursive_edit_1(), line 1000 in "keyboard.c"
  [72] Frecursive_edit(), line 1061 in "keyboard.c"
  [73] main(argc = 1, argv = 0xffbee634), line 1794 in "emacs.c"

In GNU Emacs 22.0.50.2 (sparc-sun-solaris2.8, Motif Version 2.1.0)  of
2006-07-19 on perth X server distributor `Hummingbird Ltd.', version
11.0.100015 configured using `configure
'--prefix=/rvcarma/marshals/software/slash/usr/local'
'--with-x-toolkit=motif' 'CFLAGS=-g''




reply via email to

[Prev in Thread] Current Thread [Next in Thread]