GNU bug report logs - #79380
31.0.50; Flymake does not check Elisp code anymore

Previous Next

Package: emacs;

Reported by: Daniel Mendler <mail <at> daniel-mendler.de>

Date: Wed, 3 Sep 2025 21:31:02 UTC

Severity: normal

Found in version 31.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Full log


Message #14 received at 79380 <at> debbugs.gnu.org (full text, mbox):

From: Spencer Baugh <sbaugh <at> janestreet.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 79380 <at> debbugs.gnu.org, mail <at> daniel-mendler.de
Subject: Re: bug#79380: 31.0.50; Flymake does not check Elisp code anymore
Date: Thu, 4 Sep 2025 11:45:12 -0400
[Message part 1 (text/plain, inline)]
On Thu, Sep 4, 2025, 11:33 AM Eli Zaretskii <eliz <at> gnu.org> wrote:

> > Cc: 79380 <at> debbugs.gnu.org
> > Date: Thu, 04 Sep 2025 10:38:32 -0400
> > From:  Spencer Baugh via "Bug reports for GNU Emacs,
> >  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> >
> > Daniel Mendler <mail <at> daniel-mendler.de> writes:
> > > If elisp-flymake-byte-compile-executable is nil (the default), the
> > > absolute file predicate fails and as a result Flymake does not check
> > > Elisp anymore:
> > >
> > > (file-name-absolute-p elisp-flymake-byte-compile-executable)
> >
> > Apologies, I accidentally posted an old version of the patch which was
> > then installed.  The attached should fix it.  Please try it (and then
> > feel free to push it if it works).
> >
> > >From 425e3f4ab95faf7c0e4a749e0c428f4c05f32cfa Mon Sep 17 00:00:00 2001
> > From: Spencer Baugh <sbaugh <at> janestreet.com>
> > Date: Thu, 4 Sep 2025 10:36:17 -0400
> > Subject: [PATCH] Fix null values of elisp-flymake-byte-compile-executable
> >
> > * lisp/progmodes/elisp-mode.el
> > (elisp-flymake-byte-compile--executable): Properly check for
> > nil. (bug#79380)
> > ---
> >  lisp/progmodes/elisp-mode.el | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
> > index e8344852829..c6951810c3e 100644
> > --- a/lisp/progmodes/elisp-mode.el
> > +++ b/lisp/progmodes/elisp-mode.el
> > @@ -2301,13 +2301,14 @@ elisp-flymake-byte-compile--executable
> >    "Return absolute file name of the Emacs executable for flymake
> byte-compilation."
> >    (let ((filename
> >           (cond
> > +          ((null elisp-flymake-byte-compile-executable) nil)
> >            ((file-name-absolute-p elisp-flymake-byte-compile-executable)
> >             elisp-flymake-byte-compile-executable)
> >            ((stringp elisp-flymake-byte-compile-executable)
> >             (when-let* ((pr (project-current)))
> >               (file-name-concat (project-root pr)
> >
>  elisp-flymake-byte-compile-executable))))))
> > -    (if (file-executable-p filename)
> > +    (if (and filename (file-executable-p filename))
> >          filename
> >        (when elisp-flymake-byte-compile-executable
> >          (message "No such `elisp-flymake-byte-compile-executable': %s"
> > --
> > 2.43.7
>
> Shouldn't the tests of the value of the user option use stringp
> instead of null?
>

Is that the convention?  I always feel like it's better to test for null
explicitly, so that if the user sets the variable to a symbol or list or
something they get an error which can help them track down their mistake.

>
[Message part 2 (text/html, inline)]

This bug report was last modified 6 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.