Subject: Re: bug#24585: 25.1; avoid hack in ggtags.el to run compilation-auto-jump timer

From: Leo Liu <[email-masked]>
Date: Sat, 08 Oct 2016 01:07:30 +0800

On 2016-10-07 08:46 -0400, Stefan Monnier wrote:
> Not sure what you mean by "fired", but in any case, no: font-lock is not
> used for that (tho it has been used at some point before
> compilation-auto-jump was introduced, IIRC).  Instead, it's done via
> syntax-propertize (which can be triggered in all kinds of ways,
> including font-lock).

This

(defun compilation-mode-font-lock-keywords ()
  "Return expressions to highlight in Compilation mode."
  (append
   '((compilation--ensure-parse))
   compilation-mode-font-lock-keywords))

and the only place in compile.el that mentions syntax-propertize is in a
comment.

> How 'bout something like the following:
>
> - Add a new var compilation-pending-auto-jump set buffer-locally to
>   non-nil when compilation-error-properties calls run-with-timer.
> - in compilation-auto-jump, check this var before doing anything and set
>   it back to nil.
> - in ggtags, call compilation-auto-jump to make sure this timer is run
>   before yours.

I think the issue is compilation-error-properties can happen after
compilation-finish-functions. And calling compilation--ensure-parse in
ggtags-global-handle-exit doesn't seem to help.

Leo