I need a command to run whenever a new frame is created in Emacs. So far I've been using after-make-frame-functions
, but this hook only gets called on frames created by make-frame
. I actually need something that runs whenever the emacsclient -c
command creates a new window.
Is there a way to achieve that?
I'm having some difficulty understanding your question. The Emacs server calls make-frame
when it needs to create a new frame, so after-make-frame-functions
should work in that case too. So what's your actual problem?
Is it that you want your function to run even if the Emacs server doesn't create a new frame? If so, try adding your function to server-switch-hook
as well as after-make-frame-functions
.
server-switch-hook
is a variable defined inserver.el
.Documentation: Hook run when switching to a buffer for the Emacs server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With