emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: font lock with functions


From: Adam Porter
Subject: Re: font lock with functions
Date: Tue, 31 Mar 2020 05:42:47 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

David Engster <address@hidden> writes:

> It is very easy during testing to completely hang your Emacs session
> if one of the font-lock functions hangs. One usually needs to kill
> Emacs in this case.

Often using "pkill -SIGUSR2 emacs" can help.  If that works to interrupt
Emacs and display a backtrace, you can then switch to the buffer being
font-locked and disable the mode doing the font-locking (i.e. removing
the font-lock keywords).  Then when you close the backtrace, Emacs
should not go back into the font-locking loop in your code.  At least,
this usually worked for me when I was working on prism.el.  Sometimes
some random mashing of C-g helps as well.  And once in a while, running
"pkill -SIGUSR2 emacs" in a shell loop a few hundred times, while
randomly mashing C-g in Emacs, works as a last resort.  :)

If even that doesn't help, then you may want to code in one Emacs
instance and test the code in another.

And, yes, Anders's font-lock packages are very helpful.  I've catalogued
some of those and other tools here:

https://github.com/alphapapa/emacs-package-dev-handbook#highlighting--font-locking




reply via email to

[Prev in Thread] Current Thread [Next in Thread]