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-framewhen it needs to create a new frame, soafter-make-frame-functionsshould 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-hookas well asafter-make-frame-functions.