Subject: bug#38033: 27.0.50; Regression: emacsclient -c error on first frame

From: Yuri D'Elia <[email-masked]>
Date: Sat, 02 Nov 2019 17:47:14 +0100

On the current master branch, when using emacsclient, there's a new
error which is emitted when the first frame is created:

Debugger entered--Lisp error: (error "KEY must be an integer, cons, symbol, or string")
  key-description([#<buffer *scratch*>])
  undefined()

To reproduce, call `emacsclient -c` without an existing emacs instance
and/or start emacs --daemon and create a new frame.

The error is shown only when creating the _first_ frame.

I bisected the error down to commit
e3cebbb839fc94f314659bf667c6790edebf4297: Replay key if kboard is
interrupted while initializing (Bug#37782)

Reverting the commit fixes the issue.

In GNU Emacs 27.0.50 (build 16, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw scroll bars)
 of 2019-11-02 built on eab18045nb
Repository revision: 455e753a2b8fa2e83d23be1771f3371ba90b85f9
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Debian GNU/Linux bullseye/sid

Configured using:
 'configure --with-x-toolkit=lucid --with-modules --without-gsettings
 --with-cairo CC=gcc 'CFLAGS=-O3 -march=native -pipe '
 LDFLAGS=-fwhole-program'

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND DBUS GLIB NOTIFY INOTIFY ACL
LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ LIBOTF ZLIB
TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON
PDUMPER LCMS2 GMP

Important settings:
  value of $LC_COLLATE: C
  value of $LC_TIME: en_DK.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix