#' (sharp quote)是 function 的简写,所以可以用 C-h f 和 C-h S 来阅读 docstring 和 manual。
sharp-quote 原来用来 quote 但编译一个 lambda 的,现在没必要了,因为 lambda 自带了这个效果。
sharp-quote 现在可以用来提示 byte-compiler (和编写、阅读代码的人)后面接的是一个函数,而不是变量或其它别的普通的符号。
比如,sharp-quote 一个未定义的函数,byte-compiler 会给出一个警告:
~$ cat foo.el
(mapc #'not-defined nil)
~$ emacs -batch -f batch-byte-compile foo.el
In end of data:
foo.el:2:1:Warning: the function ‘not-defined’ is not known to be defined.
如果用 quote 的话,就不会有这个警告:
~$ cat foo.el
(mapc 'not-defined nil)
~$ emacs -batch -f batch-byte-compile foo.el
~$
Flycheck 这样的工具也能实时捕捉到这种问题,也有助及时发现 bug。
这里有一篇介绍 sharp-quote 的文章: