summaryrefslogtreecommitdiff
path: root/src/lisp.h
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1995-02-22 03:06:08 +0000
committerKarl Heuer <kwzh@gnu.org>1995-02-22 03:06:08 +0000
commit9c61c17cd5501fa87fbca0a27736b87336bf4d1c (patch)
tree4c9d374cbe03ea64f623e457d55d64e80d5362d1 /src/lisp.h
parentc7a494565f0fff896f3cb5d587445b66e4291b1b (diff)
downloademacs-9c61c17cd5501fa87fbca0a27736b87336bf4d1c.tar.gz
(struct PERDISPLAY): New member kbd_queue.
Delete obsolescent members kbd_buffer_frame_or_window, kbd_buffer, kbd_fetch_ptr, kbd_store_ptr; these are regular vars again.
Diffstat (limited to 'src/lisp.h')
-rw-r--r--src/lisp.h55
1 files changed, 3 insertions, 52 deletions
diff --git a/src/lisp.h b/src/lisp.h
index bcfa8fa8300..ba2d3d8d415 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -508,62 +508,13 @@ struct PERDISPLAY
carry that information itself (i.e. if it was a character). */
Lisp_Object Vlast_event_frame;
+ Lisp_Object kbd_queue;
+
/* Placeholder for future vars that will be moved here. */
- Lisp_Object unused[20];
+ Lisp_Object unused[23];
Lisp_Object this_command_keys;
- /* Vector to GCPRO the frames and windows mentioned in kbd_buffer.
-
- The interrupt-level event handlers will never enqueue an event on a
- frame which is not in Vframe_list, and once an event is dequeued,
- internal_last_event_frame or the event itself points to the frame.
- So that's all fine.
-
- But while the event is sitting in the queue, it's completely
- unprotected. Suppose the user types one command which will run for
- a while and then delete a frame, and then types another event at
- the frame that will be deleted, before the command gets around to
- it. Suppose there are no references to this frame elsewhere in
- Emacs, and a GC occurs before the second event is dequeued. Now we
- have an event referring to a freed frame, which will crash Emacs
- when it is dequeued.
-
- Similar things happen when an event on a scroll bar is enqueued; the
- window may be deleted while the event is in the queue.
-
- So, we use this vector to protect the frame_or_window field in the
- event queue. That way, they'll be dequeued as dead frames or
- windows, but still valid lisp objects.
-
- If perd->kbd_buffer[i].kind != no_event, then
- (XVECTOR (perd->kbd_buffer_frame_or_window)->contents[i]
- == perd->kbd_buffer[i].frame_or_window. */
- Lisp_Object kbd_buffer_frame_or_window;
-
- /* Circular buffer for pre-read keyboard input. */
- struct input_event *kbd_buffer;
-
- /* Pointer to next available character in kbd_buffer.
- If kbd_fetch_ptr == kbd_store_ptr, the buffer is empty.
- This may be kbd_buffer + KBD_BUFFER_SIZE, meaning that the the
- next available char is in kbd_buffer[0]. */
- struct input_event *kbd_fetch_ptr;
-
- /* Pointer to next place to store character in kbd_buffer. This
- may be kbd_buffer + KBD_BUFFER_SIZE, meaning that the next
- character should go in kbd_buffer[0]. */
- volatile struct input_event *kbd_store_ptr;
-
- /* The above pair of variables forms a "queue empty" flag. When we
- enqueue a non-hook event, we increment kbd_store_ptr. When we
- dequeue a non-hook event, we increment kbd_fetch_ptr. We say that
- there is input available iff the two counters are not equal.
-
- Why not just have a flag set and cleared by the enqueuing and
- dequeuing functions? Such a flag could be screwed up by interrupts
- at inopportune times. */
-
int this_command_key_count;
/* Nonzero means echo each character as typed. */