Mercurial > hg > xemacs-beta
comparison src/redisplay.c @ 1320:4f58e6e65139
[xemacs-hg @ 2003-02-22 02:08:32 by ben]
oops
redisplay.c: Don't get in an infinite loop running post-redisplay actions.
author | ben |
---|---|
date | Sat, 22 Feb 2003 02:08:33 +0000 |
parents | b531bf8658e9 |
children | a19b0eb5dfc1 |
comparison
equal
deleted
inserted
replaced
1319:48817884fdbb | 1320:4f58e6e65139 |
---|---|
6713 Vpost_redisplay_actions = nconc2 (Vpost_redisplay_actions, | 6713 Vpost_redisplay_actions = nconc2 (Vpost_redisplay_actions, |
6714 list1 (Fcons (make_opaque_ptr | 6714 list1 (Fcons (make_opaque_ptr |
6715 ((void *) fun), arg))); | 6715 ((void *) fun), arg))); |
6716 } | 6716 } |
6717 | 6717 |
6718 static int running_post_redisplay_actions; | |
6719 | |
6718 static void | 6720 static void |
6719 run_post_redisplay_actions (void) | 6721 run_post_redisplay_actions (void) |
6720 { | 6722 { |
6723 int depth; | |
6724 | |
6725 if (running_post_redisplay_actions) | |
6726 return; | |
6727 | |
6728 depth = internal_bind_int (&running_post_redisplay_actions, 1); | |
6729 /* If the function pushes further actions, they will be tacked onto | |
6730 the end of the list, and we'll run them when we're done with the | |
6731 current ones. */ | |
6721 while (!NILP (Vpost_redisplay_actions)) | 6732 while (!NILP (Vpost_redisplay_actions)) |
6722 { | 6733 { |
6723 Lisp_Object car = XCAR (Vpost_redisplay_actions); | 6734 Lisp_Object car = XCAR (Vpost_redisplay_actions); |
6724 void (*fun) (Lisp_Object) = | 6735 void (*fun) (Lisp_Object) = |
6725 (void (*)(Lisp_Object)) get_opaque_ptr (XCAR (car)); | 6736 (void (*)(Lisp_Object)) get_opaque_ptr (XCAR (car)); |
6726 (*fun) (XCDR (car)); | 6737 (*fun) (XCDR (car)); |
6727 free_opaque_ptr (XCAR (car)); | 6738 free_opaque_ptr (XCAR (car)); |
6728 free_cons (car); | 6739 free_cons (car); |
6729 Vpost_redisplay_actions = XCDR (Vpost_redisplay_actions); | 6740 Vpost_redisplay_actions = XCDR (Vpost_redisplay_actions); |
6730 } | 6741 } |
6742 unbind_to (depth); | |
6731 } | 6743 } |
6732 | 6744 |
6733 #ifdef ERROR_CHECK_TRAPPING_PROBLEMS | 6745 #ifdef ERROR_CHECK_TRAPPING_PROBLEMS |
6734 | 6746 |
6735 static Lisp_Object | 6747 static Lisp_Object |