3

I would like an emacsclient frame with a specific name to open when I log into my computer. I tried adding emacsclient -e '(select-frame (make-frame (quote ((name . "scratchemacsframe")))))' to my startup applications, but the frame never opens. If I try running this command from the CLI before opening any other frames, I get this error: *ERROR*: Unknown terminal type. Poking around on Google suggests that this is because the emacs daemon doesn't yet know where to draw the frame. If I change the command to add a -d $DISPLAY, my frame opens, but I also get a second undesired frame that opens to *scratch* for some reason.

How can I make emacsclient open a single frame with a specified name before any other frames are opened?

  • How about using the function set-frame-name? (set-frame-name NAME) -- Set the name of the selected frame to NAME. When called interactively, prompt for the name of the frame. On text terminals, the frame name is displayed on the mode line. On graphical displays, it is displayed on the frame's title bar. – lawlist Jan 28 '15 at 18:02
  • @lawlist that won't start a new frame, only change the name of it. – William Everett Jan 28 '15 at 23:31
  • Thank you -- you are of course correct. I'll need to remember to finish my first cup of coffee in the future before posting a comment. :) Things look much different after 4 cups of coffee. – lawlist Jan 29 '15 at 0:03
5

Did you read man emacsclient?

This worked fine for me:

emacsclient --alternate-editor='' --no-wait --create-frame --frame-parameters='(quote (name . "scratchemacs-frame"))' --display $DISPLAY

The --alternate-editor parameter is there so emacsclient will start a new emacs daemon if one isn't already running, and --no-wait makes emacsclient return immediately after creating the new frame instead of waiting for you to kill or finish with the new frame before exiting.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.