annotate oldXMenu/insque.c @ 83374:0b75ace4f7ad

Fix crash after y-or-n-p prompt triggered by emacsclient. (Reported by Han Boetes, analysis by Kalle Olavi Niemitalo.) * src/keyboard.c (temporarily_switch_to_single_kboard) (record_single_kboard_state, restore_kboard_configuration): New functions. (timer_check): Use record_single_kboard_state instead of naive single_kboard state management. * src/fns.c: Include termhooks.h. (Fy_or_n_p): Use temporarily_switch_to_single_kboard to prevent crashes caused by bogus longjmps in read_char. * src/callint.c (Fcall_interactively): Use temporarily_switch_to_single_kboard instead of single_kboard_state. Make sure it is correctly unwinded. * src/keyboard.c (recursive_edit_unwind): Remove single_kboard stuff. (Frecursive_edit): Use temporarily_switch_to_single_kboard for single_kboard state management. * src/minibuf.c (read_minibuf): Use temporarily_switch_to_single_kboard instead of simply calling single_kboard_state. * src/keyboard.c (push_device_kboard): Remove function. (push_kboard): New function. (push_frame_kboard): Use it. (pop_frame_kboard): Rename to pop_kboard. * src/xdisp.c (display_mode_line, Fformat_mode_line): Update uses. * src/data.c: Include termhooks.h. (Fterminal_local_value, Fset_terminal_local_value): Update. * src/Makefile.in (data.o, fns.o): Add termhooks.h dependency. * src/keyboard.h (push_device_kboard, pop_frame_kboard): Remove declarations. (push_kboard, pop_kboard, temporarily_switch_to_single_kboard) (record_single_kboard_state): New declarations. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-414
author Karoly Lorentey <lorentey@elte.hu>
date Sun, 11 Sep 2005 06:42:03 +0000
parents 3861ff8f4bf1
children e8a3fb527b77 2d92f5c9d6ae
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
65000
3861ff8f4bf1 Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 52401
diff changeset
1 /* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. */
3861ff8f4bf1 Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 52401
diff changeset
2
25858
Dave Love <fx@gnu.org>
parents:
diff changeset
3 /* This file implements the emacs_insque and emacs_remque functions,
Dave Love <fx@gnu.org>
parents:
diff changeset
4 copies of the insque and remque functions of BSD. They and all
Dave Love <fx@gnu.org>
parents:
diff changeset
5 their callers have been renamed to emacs_mumble to allow us to
Dave Love <fx@gnu.org>
parents:
diff changeset
6 include this file in the menu library on all systems. */
Dave Love <fx@gnu.org>
parents:
diff changeset
7
Dave Love <fx@gnu.org>
parents:
diff changeset
8
Dave Love <fx@gnu.org>
parents:
diff changeset
9 struct qelem {
Dave Love <fx@gnu.org>
parents:
diff changeset
10 struct qelem *q_forw;
Dave Love <fx@gnu.org>
parents:
diff changeset
11 struct qelem *q_back;
Dave Love <fx@gnu.org>
parents:
diff changeset
12 char q_data[1];
Dave Love <fx@gnu.org>
parents:
diff changeset
13 };
Dave Love <fx@gnu.org>
parents:
diff changeset
14
Dave Love <fx@gnu.org>
parents:
diff changeset
15 /* Insert ELEM into a doubly-linked list, after PREV. */
Dave Love <fx@gnu.org>
parents:
diff changeset
16
Dave Love <fx@gnu.org>
parents:
diff changeset
17 void
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 25858
diff changeset
18 emacs_insque (elem, prev)
25858
Dave Love <fx@gnu.org>
parents:
diff changeset
19 struct qelem *elem, *prev;
Dave Love <fx@gnu.org>
parents:
diff changeset
20 {
Dave Love <fx@gnu.org>
parents:
diff changeset
21 struct qelem *next = prev->q_forw;
Dave Love <fx@gnu.org>
parents:
diff changeset
22 prev->q_forw = elem;
Dave Love <fx@gnu.org>
parents:
diff changeset
23 if (next)
Dave Love <fx@gnu.org>
parents:
diff changeset
24 next->q_back = elem;
Dave Love <fx@gnu.org>
parents:
diff changeset
25 elem->q_forw = next;
Dave Love <fx@gnu.org>
parents:
diff changeset
26 elem->q_back = prev;
Dave Love <fx@gnu.org>
parents:
diff changeset
27 }
Dave Love <fx@gnu.org>
parents:
diff changeset
28
Dave Love <fx@gnu.org>
parents:
diff changeset
29 /* Unlink ELEM from the doubly-linked list that it is in. */
Dave Love <fx@gnu.org>
parents:
diff changeset
30
Dave Love <fx@gnu.org>
parents:
diff changeset
31 emacs_remque (elem)
Dave Love <fx@gnu.org>
parents:
diff changeset
32 struct qelem *elem;
Dave Love <fx@gnu.org>
parents:
diff changeset
33 {
Dave Love <fx@gnu.org>
parents:
diff changeset
34 struct qelem *next = elem->q_forw;
Dave Love <fx@gnu.org>
parents:
diff changeset
35 struct qelem *prev = elem->q_back;
Dave Love <fx@gnu.org>
parents:
diff changeset
36 if (next)
Dave Love <fx@gnu.org>
parents:
diff changeset
37 next->q_back = prev;
Dave Love <fx@gnu.org>
parents:
diff changeset
38 if (prev)
Dave Love <fx@gnu.org>
parents:
diff changeset
39 prev->q_forw = next;
Dave Love <fx@gnu.org>
parents:
diff changeset
40 }
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 49600
diff changeset
41
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 49600
diff changeset
42 /* arch-tag: a8719d1a-5c3f-4bce-b36b-173106d36165
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 49600
diff changeset
43 (do not change this comment) */