(defun foo () "Print \"bar\"" (interactive) (message "bar")) (foo) (global-set-key (kbd "C-<f1>") #'foo)