Subject: Re: bug#79380: 31.0.50; Flymake does not check Elisp code anymore, [PATCH] Fix null values of elisp-flymake-byte-compile-executable

From: Daniel Mendler <[email-masked]>
Date: Sat, 06 Sep 2025 12:08:46 +0200

Eli Zaretskii <[email-masked]> writes:

>> From: Spencer Baugh <[email-masked]>
>> Cc: [email-masked],  Eli Zaretskii <[email-masked]>
>> Date: Fri, 05 Sep 2025 14:26:49 -0400
>> 
>> > Right, even better.  Like this:
>> 
>> Ping, I'd like to install this patch to fix the breakage on master.
>
> I was waiting for Daniel to test the patch and say that there are no
> further issues with it.
>
> Daniel, please chime in and ack.

Works for me, yes.

But there is still a small inconsistency in the patch. If the defcustom
is set to an invalid type there will be an error. But if it is set to an
invalid executable we will get a warning. Is this desired?

I suggest to error in both cases to avoid false Flymake errors if the
executable is configured incorrectly, and maybe also flatten the
conditionals (getting rid of the case-of-case). I would have written
something like this:

(defun elisp-flymake-byte-compile--executable ()
  "Return absolute file name of the Emacs executable for flymake byte-compilation."
  (pcase elisp-flymake-byte-compile-executable
    (`nil (expand-file-name invocation-name invocation-directory))
    ((and (pred stringp) file)
     (when-let* (((not (file-name-absolute-p file)))
                 (pr (project-current)))
       (setq file (expand-file-name file (project-root pr))))
     (unless (file-executable-p file)
       (error "No such `elisp-flymake-byte-compile-executable': %s" file))
     file)
    (file (error "Invalid `elisp-flymake-byte-compile-executable': %S" file))))

>> Here's an updated version since Eli separately pushed the fix to the
>> defcustom.
>
> Thanks.  However, the log message still says the defcustom is being
> modified, which the patch doesn't do.

Daniel