Subject: Re: bug#52018: 28.0.60; Improve documentation for compilation-finish-functions

From: Thibault Polge <[email-masked]>
Date: Sun, 21 Nov 2021 20:08:56 +0100

> But this is not entirely accurate, is it?

I've done a quick test, and this seems accurate.  As I understand it,
the code you quoted:

>            (let ((out-string (format ":%s [%s]" process-status (cdr status)))
>                  (msg (format "%s %s" mode-name
>                               (replace-regexp-in-string "\n?$" ""
>                                                         (car status)))))

comes from a let block that happens in the context of:

(setq mode-line-process [...]

That is used to, IIUC, decorate the mode line with info about the
compilation result.  This setq, and the let it wraps, ends just
before:

    (force-mode-line-update)
    [...]
    (run-hook-with-args 'compilation-finish-functions cur-buffer msg)))

So the msg that compilation-handle-exit receives is passed, unmodified,
to all 'compilation-finish-functions`.

Best regards,
Thibault