Subject: bug#53507: 27.1; syntax highlight in the eval-expression prompt

From: ndame <[email-masked]>
Date: Mon, 24 Jan 2022 17:23:44 +0000

There is some progress thanks to Stefan who gave a hint on the emacs help list.

There is a check in font-core.el which disables font lock for buffers starting
with a space and the minibuffer is like that:

;; Don't turn on Font Lock mode if we don't have a display (we're running a
;; batch job) or if the buffer is invisible (the name starts with a space).

(when (or noninteractive (eq (aref (buffer-name) 0) ?\s))
 (setq font-lock-mode nil))

https://github.com/emacs-mirror/emacs/blob/master/lisp/font-core.el#L133

If one comments these lines, reevalutes the function and then goes to 
eval-expression, pastes this code into it:

  (progn (setq font-lock-mode t) (emacs-lisp-mode))

and evals this code right there in context (C-x C-e) then the lisp 
code in the minibuffer gets font locking.

This is good, the only problem left to solve is that snippet affects
quitting from the minibuffer for some reason.