1

When I open a buffer I keep seeing following message: When done with a buffer, type C-x # in the minibuffer.

=> Is it possible completely to suppress this message?


I am using emacsclient -t -q to open GNU Emacs 26.3.

Following lines are in the .zshrc file.

export ALTERNATE_EDITOR=""
export EDITOR="emacsclient -t"
2
  • 2
    I think you need to add a bit more context... I guess that you open a buffer using emacsclient, right? In that case you can add the option --no-wait. The default for emacsclient is to wait for you to edit the buffer and mark it as done using C-x #, hence the message in the minibuffer. – Lindydancer Jan 28 at 13:06
  • Yes sir, I am using emacsclient -t -q <file.py> to open files. Usually I close it using C-x C-c to get back to shell and re-open the same file. I have added --no-wait parameter but it directly shuts down the emacs before opening it – alper Jan 28 at 16:50
3

The only way to avoid that message with Emacs earlier than 28.1 is to invoke emacsclient with the -n (--nowait) option.


Starting with Emacs 28.1 (basically, current upstream at the time of writing), there is a variable to do that:

Customizing server-client-instructions and toggling it off should turn off that message, but I cannot confirm: either my emacs session is curdled or there is something else that's funky.

The doc string of the variable says:

Documentation:

If non-nil, display instructions on how to exit the client on connection.

If nil, no instructions are displayed.

EDIT: after restarting emacs (actually, a newer version that I had installed - this was an opportunity to kill the old emacs and start with the new version), I can see the variable and it does seem to work as described. The explanation here is that I went from a version that did not have the variable to a version that did.

Here's the commit that added the variable.

EDIT (in response to the OP's comment): to customize the variable, ask for its description with C-h v server-client-instructions RET, hit the customize link where it says "You can customize this variable" and when the customize interface comes up, hit the Toggle button to toggle it off (nil) and then hit Apply and Save to save it permanently.

9
  • What customization should I apply? I tried adding --no-wait but it didn't help – alper Jan 28 at 16:59
  • I was assuming you knew how to use the Customize interface. See edited answer. – NickD Jan 28 at 17:05
  • Hm seems like I don't have any server-client-instructions variable :-( but I have a variable called server-clients which does not have any customize option – alper Jan 28 at 17:21
  • It may be that the variable is recent: I didn't check history in git. I'll do that and report back. – NickD Jan 28 at 17:31
  • It is very recent: it was inroduced in Emacs 28.1 about two months ago. The only way to avoid the message with earlier emacs is emacsclient -n. – NickD Jan 28 at 17:36

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.