0

I have server-mode enabled so that I can use emacsclient to execute functions from other parts of my system. My main example is that I have a polybar module that calls emacsclient for some details about the active Emacs frame. When polybar is periodically calling emacsclient, I've noticed that the server uses up more CPU, seemingly in pursuit of deleting each new client. This makes editing feel a bit slower.

Here is a CPU sample of me editing a file.

enter image description here

How can I execute some elisp in the Emacs server environment without creating a whole new client each time (by calling emacsclient)?

4
  • I'd recommend looking at the source code of emacsclient to reimplement it in your preferred programming language and using that to make a persistent process that sends requests to Emacs without establishing a new connection every time. – wasamasa Nov 23 '20 at 18:30
  • What's the question? What problem are you trying to solve? – Drew Nov 23 '20 at 19:02
  • These calls seem to add significant overhead to editing, so I was wondering if there's a way to execute some elisp in the Emacs server environment without creating a whole new client each time. – loafofpiecrust Nov 23 '20 at 23:36
  • Then ask that question in your question, please: "How do I...?" – Drew Nov 23 '20 at 23:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.