Skip to content

Commit

Permalink
Hot load core ZMQ functions
Browse files Browse the repository at this point in the history
Do so instead of a call to `zmq-load` at top-level.

closes #17

* zmq.el: Replace top-level `zmq-load` call with aliasing of core ZMQ
functions to `zmq-load`, but only if the core functionality hasn't
been loaded yet.  Loading of the core functionality will overwrite
these aliased definitions with the proper ones.
  • Loading branch information
nnicandro committed Jun 29, 2024
1 parent b835a83 commit 14e01c0
Showing 1 changed file with 61 additions and 1 deletion.
62 changes: 61 additions & 1 deletion zmq.el
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,67 @@ Emacs process."
(recursive-edit))))))))
(user-error "Modules are not supported"))))

(zmq-load)
(unless (featurep 'zmq-core)
(dolist (fun '(zmq--cleanup-globrefs
zmq-socket
zmq-send
zmq-recv
zmq-bind
zmq-connect
zmq-join
zmq-unbind
zmq-disconnect
zmq-leave
zmq-close
zmq-proxy
zmq-proxy-steerable
zmq-socket-monitor
zmq-socket-set
zmq-socket-get
zmq-context
zmq-context-terminate
zmq-context-shutdown
zmq-context-get
zmq-context-set
zmq-message
zmq-message-size
zmq-message-data
zmq-message-more-p
zmq-message-copy
zmq-message-move
zmq-message-close
zmq-message-set
zmq-message-get
zmq-message-recv
zmq-message-send
zmq-message-gets
zmq-message-routing-id
zmq-message-set-routing-id
zmq-message-group
zmq-message-set-group
zmq-poll
zmq-poller
zmq-poller-add
zmq-poller-modify
zmq-poller-remove
zmq-poller-destroy
zmq-poller-wait
zmq-poller-wait-all
zmq-version
zmq-has
zmq-z85-decode
zmq-z85-encode
zmq-curve-keypair
zmq-curve-public
zmq-equal
zmq-message-p
zmq-socket-p
zmq-context-p
zmq-poller-p))
(defalias fun
(lambda (&rest args)
(zmq-load)
(apply fun args)))))

(provide 'zmq)

Expand Down

0 comments on commit 14e01c0

Please sign in to comment.