Subject: Re: bug#75557: gnus-highlight-selected-tree is broken (fix)

From: Stefan Monnier <[email-masked]>
Date: Sat, 01 Mar 2025 23:30:55 -0500

> My only question is if we should perhaps make `buffer-live-p` throw an
> error in case it is passed something of the wrong type.  Yes, it is a
> backwards-incompatible change, but OTOH it would catch real bugs like
> the above, instead of silently returning nil.
>
> For example, we can currently do all of this nonsense:
>
>     (buffer-live-p 123)                          => nil
>     (buffer-live-p [foo])                        => nil
>     (buffer-live-p (make-symbol "foo"))          => nil
>     (buffer-live-p (lambda () (message "foo")))  => nil
>
> Eli, Stefan, WDYT?

I'm pretty sure it would introduce bugs because I know I wrote code
which relies on `buffer-live-p` behaving "like a type check"
(i.e. accepting any object).
I'd be surprised if I was the only one.

        Stefan "who doesn't like the tendency of ELisp functions to
                accept buffer names in place of buffer objects."