Subject: bug#34952: files with/out final newline look the same no matter what

From: Stefan Monnier <[email-masked]>
Date: Fri, 07 Aug 2020 10:20:50 -0400

>> > Oh, yeah, that makes sense.  I'll fix that.
>> Actually, I don't know how.  How do you ask, when you're in the
>> font-lock machinery, what the original point was?

font-lock is "per buffer" whereas point is "per window", so I'm not sure
what "*the* original point" should mean.

>> Like here:
>>        ,@(when (memq 'missing-newline-at-eof whitespace-active-style)
>>            ;; Show missing newline.
>>            `(("[^\n]\\'" 0 (if .... something) t)))))
> What, calling 'point' doesn't work?  Then maybe Stefan could help us
> out.
>> By the way, have I whined about how difficult debugging font-lock stuff
>> is?  I can't put a `debug' in there, for instance, to examine the
>> calling sequence, which would probably tell me what I need to know.
> I think Stefan posted some advice at some point?

You can try `jit-lock-debug-mode` (which delays the jit-lock from
"within redisplay" to "the next idle time").  Otherwise, you can set
`font-lock-support-mode` to nil, then turn font-lock-mode off and back
on (after which font-lock is triggered via `after-change-functions`).

        Stefan