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

From: ndame <[email-masked]>
Date: Tue, 25 Jan 2022 13:17:49 +0000

>
> Yes -- but I don't think this is something we can change at this point.
> It's likely to break various things.

Naturally, I did not post the final solution. If you check the bug
history they you can see that up to know it was not clear why font
lock does not work in the eval-expression prompt:

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=46092

Stefan gave a hint that it is disabled in font lock mode and
this is the case. That's why I posted that proof of concept
code which shows that font locking does work there if we
remove the disabling code.

It should be implemented properly, hopefully in emacs 29, because
syntax highlight is useful to get elisp code easier to read, and
that's also true for code written into the eval-expression prompt.

>
> So I don't think there's anything to be done on the Emacs side here, but
> perhaps I'm misunderstanding what this report is about?

This report is a wish so that it's implemented for core emacs, so
font lock works by default in the eval expression prompt too, since
font lock is enabled by default in emacs for emacs lisp, so the
user rightly expects that it also works for code typed into
eval-expression.

The problem is as I wrote at the end of my previous mail, if you
follow my steps and enable font lock there then you see that font
locking elisp code does work, but then you can't quit the prompt
with C-g for some reason.

This is still a roadblock which should be investigated why this is.

In order to highlight elisp in eval-expression I changed the major
mode of the minibuffer to emacs-lisp-mode. Is that the reason?
If not so then what is? If so then why is changing the mode stops
C-g from working there?

So there are still roadblocks which have to be overcome to get
this feature work in emacs.