|
From: | JD Smith |
Subject: | Re: Selective font-locking? |
Date: | Mon, 12 Apr 2021 23:33:59 -0400 |
Using `font-lock-fontify-region` instead causes Emacs to become mostly unresponsive. Sending a USR2 reveals: Debugger entered--entering a function: * #f(compiled-function () #<bytecode 0x1fed77d1f329>)() font-lock-default-fontify-region(188 189 nil) font-lock-fontify-region(188 189) #f(compiled-function (fun) #<bytecode 0x1fed77d1f2f9>)(font-lock-fontify-region) run-hook-wrapped(#f(compiled-function (fun) #<bytecode 0x1fed77d1f2f9>) font-lock-fontify-region) jit-lock--run-functions(188 189) jit-lock-fontify-now(188 688) jit-lock-function(188) redisplay_internal\ \(C\ function\)()
Well hmm, this is a bummer. l tested for this issue by inserting an entirely unmatched quote:
and this does affect the syntax (everything is a string). But unfortunately narrowing as follows doesn’t seem to fix this: (save-restriction (narrow-to-region pmark (point-max)) (with-syntax-table python-mode-syntax-table (font-lock-flush start limit) (font-lock-ensure start limit))))))) I’m not sure it’s the same thing, but I found a related issue with `indent-for-tab-command'. In attempting to ignore the prompt for computing indentation, I narrowed to a region which excluded it, but indent.el calls `indent--funcall-widened’, which undoes my narrowing! Is there any way to specify "narrow to this region and don’t let anybody widen it(!)"? |
[Prev in Thread] | Current Thread | [Next in Thread] |