How to kill the buffer in emacs without being questioned.
M-x kill-matching-buffers. Offer to kill all buffers matching a regular expression. C-x k ( kill-buffer ) kills one buffer, whose name you specify in the minibuffer. The default, used if you type just RET in the minibuffer, is to kill the current buffer.
More generally: You can use M-: (kill-process PROCESS) RET , where PROCESS "may be a process, a buffer, or the name of a process or buffer", with those names being as they appear in the output of list-processes .
If you started Emacs from a terminal, the parent process normally resumes control. The low-level primitive for killing Emacs is kill-emacs . This command calls the hook kill-emacs-hook , then exits the Emacs process and kills it.
Kill Emacs ( save-buffers-kill-terminal ). On a text terminal, suspend Emacs; on a graphical display, iconify (or “minimize”) the selected frame ( suspend-frame ). Killing Emacs means terminating the Emacs program. To do this, type C-x C-c ( save-buffers-kill-terminal ).
This will kill the current visible buffer without confirmation unless the buffer has been modified. In this last case, you have to answer y/n.
(global-set-key [(control x) (k)] 'kill-this-buffer)
I use this
(defun volatile-kill-buffer () "Kill current buffer unconditionally." (interactive) (let ((buffer-modified-p nil)) (kill-buffer (current-buffer)))) (global-set-key (kbd "C-x k") 'volatile-kill-buffer) ;; Unconditionally kill unmodified buffers.
It will kill the buffer unless it's modified.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With