[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#25166: 26.0.50; It shouldn't be possible to set the function cell of
From: |
Noam Postavsky |
Subject: |
bug#25166: 26.0.50; It shouldn't be possible to set the function cell of nil and t |
Date: |
Sat, 28 Oct 2017 12:45:57 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) |
Stefan Monnier <monnier@iro.umontreal.ca> 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.