1

How do I go about removing the message "When done with this frame, type C-x 5 0" when launching emacsclient?

I know it's possible to controll the startup message of emacs when not launched as a daemon by changing the display-startup-echo-area-message function, but it has no effect when I launch emacs with "emacsclient -c"

0

The way you launch emacsclient now, the call blocks the terminal session and releases it only after you kill the frame. Hence the message. If you add the -n or --no-wait option, the terminal is released immediately and you will not see the message.

Additionally, you might want to use option -nw to avoid Emacs creating a new frame.

Create a short shell alias that includes all options that you use. I use em.

  • Thanks for the reply! Already tried launching emacsclient with the --no-wait flag though, and the message "When done with this frame, type C-x 5 0" is still there.. – William Sep 23 '18 at 18:02
  • See what happens if you add the '-n' option. It opens the buffer in the existing frame and message should refer to 'C-x #' to close the buffer, but only if the terminal process is waiting for completion. Also, there is a remote chance that this depends on emacs version. You should always give the emacs version and platform (Windows especially has many quirks) you are using. – Heikki Sep 24 '18 at 5:48
  • I'm running emacs 26.1 on void linux on my raspberry pi 3b+. Tried launching "emacsclient -cn", and the terminal gets released immediately as it should but the message still pops up.. For some reason though the message dissappears if I first kill the frame with "C-x 5 0" and relaunch emacsclient but only if I target a file like this "emacsclient -cn docs.org" – William Sep 24 '18 at 6:12
  • I had never thought of running emacsclient without a file argument. Normally, you always want to open a file for editing or display. Running 'emacsclient -cn', I get the scratch buffer and the message to kill the frame. Doing it, pushes scratch buffer back into the buffer stack (bury-buffer) and displays the previous buffer. Looks like you have hit an edge case where emacs is not working completely predictably. – Heikki Sep 24 '18 at 6:33
  • 1
    Will look into it! Thanks for taking your time to help me out though, appreciate it. For now I managed to fix it with a ugly hack - when running "ranger" I just pass in an extra random argument that doesn't exist like this 'emacsclient -cn -e "(ranger)" blahblah' and the message is gone. – William Sep 24 '18 at 8:03
0

I checked the code and found there is a server-after-make-frame-hook.

So you can add this code in your Emacs init file to workaround this message:

(add-hook 'server-after-make-frame-hook
          (lambda ()
            (setq inhibit-message t)
            (run-with-idle-timer 0 nil (lambda () (setq inhibit-message nil)))))

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.