Subject: bug#13676: 24.2.93; Compiler warnings with (defalias #'symbol ...)

From: Stefan Monnier <[email-masked]>
Date: Sun, 10 Feb 2013 23:01:20 -0500

> |  [...]  But unlike `quote', it also serves as a note to the Emacs
> |evaluator and byte-compiler that FUNCTION-OBJECT is intended to be used
> |as a function.  [...]

Right, this means that #'foo is a reference to the function stored in `foo'.

> (defalias #'my-package-end-of-line

So, this is weird, because you're not referring to the function stored
in `my-package-end-of-line' here, instead you really want to set the
`symbol-function' slot of the symbol, so the argument you want to pass
to `defalias' is not a function but a symbol.

Both work in practice, but the intention expressed by the use of #' is
incorrect here.

>   (if (fboundp #'end-of-visual-line)

Similarly, here it should be (fboundp 'end-of-visual-line) since
fboundp's argument should be a symbol, not a function.

        Stefan