Elisp: Quoting Symbol of Function (Number Sign Prefix)

By Xah Lee. Date: .

Quote Symbol with Number Sign

function
(function symb)

shortcut syntax: #'symb

return the argument without evaluating it, and indicate to Byte Compiler that symb is a function.

This is often used in keybinding code. E.g.

(keymap-global-set "C-2" #'pop-global-mark)

The advantage over

(keymap-global-set "C-2" 'pop-global-mark)

is that it tells emacs compiler that the symbol is a function. In practice, there is little difference.

Reference

Elisp, symbol