Don't allow quitting while rebuilding Vwindow_list (Bug#47244)
* src/window.c (window_list, next_window, window_list_1): Don't allow quitting in Fnconc and Fmemq (Bug#47244).
This commit is contained in:
parent
d262138383
commit
cbf5bdd253
1 changed files with 21 additions and 0 deletions
21
src/window.c
21
src/window.c
|
@ -2542,8 +2542,13 @@ window_list (void)
|
||||||
if (!CONSP (Vwindow_list))
|
if (!CONSP (Vwindow_list))
|
||||||
{
|
{
|
||||||
Lisp_Object tail, frame;
|
Lisp_Object tail, frame;
|
||||||
|
ptrdiff_t count = SPECPDL_INDEX ();
|
||||||
|
|
||||||
Vwindow_list = Qnil;
|
Vwindow_list = Qnil;
|
||||||
|
/* Don't allow quitting in Fnconc. Otherwise we might end up
|
||||||
|
with a too short Vwindow_list and Fkill_buffer not being able
|
||||||
|
to replace a buffer in all windows showing it (Bug#47244). */
|
||||||
|
specbind (Qinhibit_quit, Qt);
|
||||||
FOR_EACH_FRAME (tail, frame)
|
FOR_EACH_FRAME (tail, frame)
|
||||||
{
|
{
|
||||||
Lisp_Object arglist = Qnil;
|
Lisp_Object arglist = Qnil;
|
||||||
|
@ -2555,6 +2560,8 @@ window_list (void)
|
||||||
arglist = Fnreverse (arglist);
|
arglist = Fnreverse (arglist);
|
||||||
Vwindow_list = nconc2 (Vwindow_list, arglist);
|
Vwindow_list = nconc2 (Vwindow_list, arglist);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unbind_to (count, Qnil);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Vwindow_list;
|
return Vwindow_list;
|
||||||
|
@ -2691,6 +2698,8 @@ static Lisp_Object
|
||||||
next_window (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames,
|
next_window (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames,
|
||||||
bool next_p)
|
bool next_p)
|
||||||
{
|
{
|
||||||
|
ptrdiff_t count = SPECPDL_INDEX ();
|
||||||
|
|
||||||
decode_next_window_args (&window, &minibuf, &all_frames);
|
decode_next_window_args (&window, &minibuf, &all_frames);
|
||||||
|
|
||||||
/* If ALL_FRAMES is a frame, and WINDOW isn't on that frame, just
|
/* If ALL_FRAMES is a frame, and WINDOW isn't on that frame, just
|
||||||
|
@ -2699,6 +2708,9 @@ next_window (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames,
|
||||||
&& !EQ (all_frames, XWINDOW (window)->frame))
|
&& !EQ (all_frames, XWINDOW (window)->frame))
|
||||||
return Fframe_first_window (all_frames);
|
return Fframe_first_window (all_frames);
|
||||||
|
|
||||||
|
/* Don't allow quitting in Fmemq. */
|
||||||
|
specbind (Qinhibit_quit, Qt);
|
||||||
|
|
||||||
if (next_p)
|
if (next_p)
|
||||||
{
|
{
|
||||||
Lisp_Object list;
|
Lisp_Object list;
|
||||||
|
@ -2748,6 +2760,8 @@ next_window (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames,
|
||||||
window = candidate;
|
window = candidate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unbind_to (count, Qnil);
|
||||||
|
|
||||||
return window;
|
return window;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2838,10 +2852,14 @@ static Lisp_Object
|
||||||
window_list_1 (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames)
|
window_list_1 (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames)
|
||||||
{
|
{
|
||||||
Lisp_Object tail, list, rest;
|
Lisp_Object tail, list, rest;
|
||||||
|
ptrdiff_t count = SPECPDL_INDEX ();
|
||||||
|
|
||||||
decode_next_window_args (&window, &minibuf, &all_frames);
|
decode_next_window_args (&window, &minibuf, &all_frames);
|
||||||
list = Qnil;
|
list = Qnil;
|
||||||
|
|
||||||
|
/* Don't allow quitting in Fmemq and Fnconc. */
|
||||||
|
specbind (Qinhibit_quit, Qt);
|
||||||
|
|
||||||
for (tail = window_list (); CONSP (tail); tail = XCDR (tail))
|
for (tail = window_list (); CONSP (tail); tail = XCDR (tail))
|
||||||
if (candidate_window_p (XCAR (tail), window, minibuf, all_frames))
|
if (candidate_window_p (XCAR (tail), window, minibuf, all_frames))
|
||||||
list = Fcons (XCAR (tail), list);
|
list = Fcons (XCAR (tail), list);
|
||||||
|
@ -2856,6 +2874,9 @@ window_list_1 (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames)
|
||||||
XSETCDR (tail, Qnil);
|
XSETCDR (tail, Qnil);
|
||||||
list = nconc2 (rest, list);
|
list = nconc2 (rest, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unbind_to (count, Qnil);
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue