From 5f99d515c921ee5546483ddab15e08f9b23280d9 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 2 Mar 2019 11:05:40 -0800 Subject: [PATCH] Avoid staticvec duplicates * src/alloc.c (staticpro) [ENABLE_CHECKING]: Check for duplicates. * src/keyboard.c (syms_of_keyboard): Define while-no-input-ignore-events and inhibit--record-char here ... (syms_of_keyboard_for_pdumper): ... instead of here. This avoids duplicates in staticvec. --- src/alloc.c | 2 ++ src/keyboard.c | 20 +++++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/alloc.c b/src/alloc.c index 7d63e3c79b6..452d31f9398 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -5725,6 +5725,8 @@ purecopy (Lisp_Object obj) void staticpro (Lisp_Object *varaddress) { + for (int i = 0; i < staticidx; i++) + eassert (staticvec[i] != varaddress); if (staticidx >= NSTATICS) fatal ("NSTATICS too small; try increasing and recompiling Emacs."); staticvec[staticidx++] = varaddress; diff --git a/src/keyboard.c b/src/keyboard.c index 6e805ec7e69..38074458373 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -11844,6 +11844,17 @@ preserve data in modified buffers that would otherwise be lost. If nil, Emacs crashes immediately in response to fatal signals. */); attempt_orderly_shutdown_on_fatal_signal = true; + DEFVAR_LISP ("while-no-input-ignore-events", + Vwhile_no_input_ignore_events, + doc: /* Ignored events from while-no-input. */); + + DEFVAR_BOOL ("inhibit--record-char", + inhibit_record_char, + doc: /* If non-nil, don't record input events. +This inhibits recording input events for the purposes of keyboard +macros, dribble file, and `recent-keys'. +Internal use only. */); + pdumper_do_now_and_after_load (syms_of_keyboard_for_pdumper); } @@ -11878,17 +11889,8 @@ syms_of_keyboard_for_pdumper (void) eassert (initial_kboard == NULL); initial_kboard = allocate_kboard (Qt); - DEFVAR_LISP ("while-no-input-ignore-events", - Vwhile_no_input_ignore_events, - doc: /* Ignored events from while-no-input. */); Vwhile_no_input_ignore_events = Qnil; - DEFVAR_BOOL ("inhibit--record-char", - inhibit_record_char, - doc: /* If non-nil, don't record input events. -This inhibits recording input events for the purposes of keyboard -macros, dribble file, and `recent-keys'. -Internal use only. */); inhibit_record_char = false; } -- 2.39.5