Tomek
Tomek

Reputation: 651

emacs: kill a buffer and remove it from the buffer list

In Emacs, when a buffer is killed, it is still displayed on the buffer list (though it's empty after opening it from the list). Is is possible to remove the buffer from the buffer list?

Upvotes: 1

Views: 1121

Answers (2)

songyuanyao
songyuanyao

Reputation: 173044

You can define a function to achieve it automatically:

(defun my-kill-buffer ()
  (interactive)
  (kill-buffer)
  (if (get-buffer "*Buffer List*")
      (save-excursion
        (set-buffer "*Buffer List*")
        (revert-buffer))
))

Upvotes: 0

choroba
choroba

Reputation: 242383

Just refresh the buffer list by pressing g.

Upvotes: 4

Related Questions