* src/keyboard.c (pop_kboard): Set current_kboard to the kboard of the
selected frame when the stored kboard object has been deleted before
pop_kboard.
(restore_kboard_configuration): Call pop_kboard only after setting up
single_kboard mode.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-418
** frames-on-display-list should also accept frames.
+** I smell something funny around pop_kboard's "deleted kboard" case.
+ Determine what are the circumstances of this case, and fix any
+ bug that comes to light.
+
** Consider the `tty-type' frame parameter and the `display-tty-type'
function. They serve the exact same purpose. I think it may be
a good idea to eliminate one of them, preferably `tty-type'.
pop_kboard ()
{
#ifdef MULTI_KBOARD
+ struct device *d;
struct kboard_stack *p = kboard_stack;
- current_kboard = p->kboard;
+ int ok = 0;
+ current_kboard = NULL;
+ for (d = device_list; d; d = d->next_device)
+ {
+ if (d->kboard == p->kboard)
+ {
+ current_kboard = p->kboard;
+ break;
+ }
+ }
+ if (current_kboard == NULL)
+ {
+ /* The display we remembered has been deleted. */
+ current_kboard = FRAME_KBOARD (SELECTED_FRAME ());
+ }
kboard_stack = p->next;
xfree (p);
#endif
restore_kboard_configuration (was_locked)
Lisp_Object was_locked;
{
- pop_kboard ();
if (NILP (was_locked))
any_kboard_state ();
else
single_kboard_state ();
+ pop_kboard ();
return Qnil;
}
\f