Subject: bug#25166: 26.0.50; It shouldn't be possible to set the function cell of nil and t

From: Noam Postavsky <[email-masked]>
Date: Sat, 28 Oct 2017 12:45:57 -0400

Stefan Monnier <[email-masked]> writes:

>> PS for an example of why singling out nil makes sense (but this
>> doesn't apply to t) see [1].
>> Summary: (autoload #'nil "something" nil t) silently succeeds but
>> makes forward-word, backward-word, etc, (fail to) funcall nil.
>
> Why would someone do (autoload #'nil "something" nil t) ?

By accident.  It's a bug in use-package.

    (use-package foo-pkg :commands <commands-to-autoload>)

Creates autoloads for all the commands in <commands-to-autoload>, which
can be a symbol, or a list of symbols.  But nil is also a symbol, so
passing an empty list makes an autoload for nil (because use-package
checks for symbolp before listp), rather than making autoloads for 0
commands.