Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

When I run M-x kill-buffer for a buffer which was openend via gnuclient, I first get this prompt...

Kill buffer (default 'my-buffer-name'): 

Then I get a second prompt/message...

Buffer 'my-buffer-name' belongs to gnuserv client(s); kill anyway? (yes or no) 

How can I disable the second gnuserv/client message? (I don't need it).

share|improve this question

1 Answer 1

up vote 0 down vote accepted

The following script works for both with gnuclient or emacsclient, though its (original) docstring says, "Kill buffer, taking gnuclient into account." ... from emacswiki: KillKey

(defun my-kill ()
  "Kill buffer, taking gnuclient into account."
  (interactive)
  (if (buffer-modified-p)
      (error "Buffer has unsaved changes")
    (if server-buffer-clients
 (server-edit)
      (kill-buffer (current-buffer)))))

The above addresses the question, as asked, but aside from that, I have worked around the issue by using emacs' built-in server and emacsclient (vs. gnuclient, as mentioned in the question).

With this new server/client combination, I can open files in emacs, from a bash shell, as if they were opened (visited) from within emacs itself.

In a launcher script, eg. named e, this basic command does the trick; no more annoying prompts when I kill the buffer...

It also has the added advantage of allowing features like restoring VisibleBookmarks, etc to function for that file/buffer.

emacsclient -e "(find-file \"$1\")" &>/dev/null

I think that something similar could be done with GNU server/client, but I quite like emacsclient, so I'll run with it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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