* What is special about the minibuffer in regard to font locking?
@ 2022-01-23 8:25 ndame via Users list for the GNU Emacs text editor
2022-01-23 16:30 ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-01-23 17:17 ` ndame
0 siblings, 2 replies; 4+ messages in thread
From: ndame via Users list for the GNU Emacs text editor @ 2022-01-23 8:25 UTC (permalink / raw)
To: help-gnu-emacs@gnu.org
There is an existing bug report about font locking in the minibuffer
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=46092
and I'm wondering how the minibuffer is special which prevents font locking there.
AFAIK, normal buffer functions (eobp), etc. work there and it also supports text properties, so what else is required from a buffer by font locking which is not supported in the minibuffer?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: What is special about the minibuffer in regard to font locking?
2022-01-23 8:25 What is special about the minibuffer in regard to font locking? ndame via Users list for the GNU Emacs text editor
@ 2022-01-23 16:30 ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-01-23 17:17 ` ndame
1 sibling, 0 replies; 4+ messages in thread
From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2022-01-23 16:30 UTC (permalink / raw)
To: help-gnu-emacs
ndame via Users list for the GNU Emacs text editor [2022-01-23 08:25:30] wrote:
> There is an existing bug report about font locking in the minibuffer
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=46092
> and I'm wondering how the minibuffer is special which prevents font locking there.
I don't think there's anything fundamental here.
Probably just code like:
(define-minor-mode font-lock-mode
[...]
(when (or noninteractive (eq (aref (buffer-name) 0) ?\s))
(setq font-lock-mode nil))
[...]
-- Stefan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: What is special about the minibuffer in regard to font locking?
2022-01-23 8:25 What is special about the minibuffer in regard to font locking? ndame via Users list for the GNU Emacs text editor
2022-01-23 16:30 ` Stefan Monnier via Users list for the GNU Emacs text editor
@ 2022-01-23 17:17 ` ndame
2022-01-23 17:56 ` ndame
1 sibling, 1 reply; 4+ messages in thread
From: ndame @ 2022-01-23 17:17 UTC (permalink / raw)
To: help-gnu-emacs@gnu.org
> I don't think there's anything fundamental here.
> Probably just code like:
Thanks, I thought it was something more complicated.
And lo! If you go to eval-expression, paste this code
into the prompt:
(progn (setq font-lock-mode t) (emacs-lisp-mode))
and eval it right there in context (C-x C-e) then
the pasted code is font locked.
So syntax highlight works, but it breaks something
else, because then you can't get out of the
minibuffer with C-g for some reason. Probably
because of the mode change?
But you can do an M-x top-level to get out and
then the minibuffer works again with C-g, because
it's reset to minibuffer-inactive-mode.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: What is special about the minibuffer in regard to font locking?
2022-01-23 17:17 ` ndame
@ 2022-01-23 17:56 ` ndame
0 siblings, 0 replies; 4+ messages in thread
From: ndame @ 2022-01-23 17:56 UTC (permalink / raw)
To: help-gnu-emacs@gnu.org
> And lo! If you go to eval-expression, paste this code
> into the prompt:
Turns out it doesn't work with emacs -Q. It only worked
for me, because I commented out the part in my emacs
which prevents it working from the minibuffer:
(when (or noninteractive (eq (aref (buffer-name) 0) ?\s))
(setq font-lock-mode nil))
So it's not just a matter of adding a function to minibuffer
set up hook.
The C-g stops working problem still occurs with -Q, though,
if I change the major mode of the minibuffer to elisp mode.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-01-23 17:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-23 8:25 What is special about the minibuffer in regard to font locking? ndame via Users list for the GNU Emacs text editor
2022-01-23 16:30 ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-01-23 17:17 ` ndame
2022-01-23 17:56 ` ndame
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).