Don't attempt to byte-compile a symbol whose function value is a subr

`(byte-compile #'cons)` will return `t` which is not a function.
Passing in the `subr` to `byte-compile` will just return the `subr` so
everything works out OK.  This is an attempt at fixing issues like
nnicandro/emacs-zmq#32.
This commit is contained in:
Nathaniel Nicandro 2023-02-13 20:04:15 -06:00
parent 85f6ff84ed
commit eebeef1293

View file

@ -339,7 +339,11 @@ nothing."
;; Initialize any callbacks that were added before the ioloop was
;; started
(setq jupyter-ioloop-pre-hook
(mapcar (lambda (f) (unless (byte-code-function-p f) (byte-compile f)))
(mapcar (lambda (f)
(when (symbolp f)
(setq f (symbol-function f)))
(unless (byte-code-function-p f)
(byte-compile f)))
(append jupyter-ioloop-pre-hook
(quote ,(mapcar #'macroexpand-all
(oref ioloop callbacks))))))