Questions tagged [kill-buffer]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
51 views

How to return focus to dired window after killing buffer opened from dired?

Sometimes I use dired to view or edit several files in one folder, one after the other. Dired is open in one window, and I open the files in another window by typing o in dired. When I finish with one ...
4
votes
1answer
83 views

How to automatically kill a shell buffer when the shell process exits

In shell-mode when you exit the shell process (e.g. by typing exit) the buffer still hangs around (with the message "Process shell<1> finished"). How can I automatically kill the shell buffer when ...
0
votes
0answers
71 views

Removing buffers from buffer list

This is my first day on Emacs, and I am really liking it so far, but I cannot seem to be able to work correctly with buffers. I am trying to kill specific buffers with C-x k, however upon checking the ...
0
votes
1answer
55 views

How select and kill desire many buffers in ido mode?

Emacs 26.1. ido, smex If I want to kill one buffer I use command C-x k Here result: As result I can kill ONE desire buffer. But suppose I need to kill the next buffers: build.gradle, approfile....
2
votes
1answer
110 views

Elfeed - Kill buffers on quit

I've been using Elfeed for some time, and I like it very much. However, there is one small thing I'd like to adjust. When leaving the search window (with elfeed-search-quit-window bound to q in the ...
0
votes
1answer
42 views

is there a way to kill buffers when using the `switch-to-buffer` view

when using C-x b followed by TAB, a list of buffers are brought up. Is there a way to quickly kill the buffers that are not needed (by pressing <delete> or d) on the selected buffer?
2
votes
1answer
76 views

Kill default buffer (with cursor)

Windows 10, Emacs 25.1, Helm I open 3 buffers (3 files). Show only 2 buffers. As you can see the current buffer is my_buffer_1 because cursor is in this buffer. I want to kill this current buffer. ...
2
votes
1answer
52 views

How do I kill all buffers that were opened from browsing rgrep results?

I had a set of buffers open that I want to keep. Then I started a search with M-x rgrep (SPC f g on Spacemacs). While browsing results with n and p, each file containing a result is opened in a new ...
1
vote
1answer
96 views

emacs split window doesn't avoid other pane content

I'll get terminology wrong here, so be gentle with that (only). cd ~/src/ ./emacs * C-x 2 So I've got two windows here, one above the other, and a bunch of files in my buffer list (more than 2). ...
2
votes
2answers
232 views

Delete word backward without coping it to buffer [duplicate]

(I feel like there should be duplicate for this, but I could not find it. Pardon me.) Question How can I delete word backwards without it being copied to buffer? Explanation I developed a habit of ...
2
votes
2answers
113 views

replace-buffer-in-windows issues in switching from emacs 24.5 to emacs 25.2

I installed Emacs 25.2 on a new system and cannot get the desired behavior with killing buffers when an Emacs frame is split into multiple windows. For example, I have C-x 3 bound to a variation of ...
0
votes
3answers
639 views

How to kill magit-diff's buffers on quit?

After making a commit in magit, magit will leave around a magit-diff buffer containing just: Staged changes (empty) [back] This is pretty useless and clutters up my buffers, and I'd just like that ...
1
vote
1answer
84 views

Want to select asterisk buffers after killing the current buffer

I am facing the question about the buffer selected after killing the current buffer. When I kill the current buffer, the recent file buffer is selected ignoring asterisk buffers. Unless there are no ...
0
votes
2answers
214 views

kill-process doesn't kill process

Why does the following sexp hang? (let ((buf "*Async Shell Command*")) (async-shell-command "cat") (while (get-buffer-process buf) (message "still has proc") (kill-...
2
votes
1answer
44 views

How modify this function, that it will detect the visibile buffers in all windows?

I found a function, that will kill all buffers except the current buffer that's open. (defun kill-other-buffers () "Kill all buffers but the current one. Doesn't mess with special buffers." (...
0
votes
1answer
64 views

Adding to kill-buffer-hook results in “setq: Wrong type argument”

Subtract a buffer's (the file's) size from a variable before killing it. Emacs 26. (defvar cumulative-open-bytes '0 ) (defun buffer-settings-calc-bytes () (interactive) (let ((current-open-file-...
0
votes
1answer
120 views

undo-kill-buffer and save-place-mode

I use this function to reopen a file killed by mistake. (defun undo-kill-buffer () (interactive) (let ((active-files (loop for buf in (buffer-list) when (buffer-...
3
votes
3answers
857 views

Dired-like browser for buffers?

I use Spacemacs, and I often use SPC b b to list buffers so that I can kill the buffers I no longer want. Unfortunately, this process takes a while because I have to repeatedly press SPC b b, navigate ...
3
votes
1answer
262 views

How to kill all duplicates of the current frame

The command make-frame creates a duplicate frame of a given frame. Is there a reverse command which kills all duplicates (if any) of the current frame? More precisely assume that the current frame ...
1
vote
1answer
65 views

Detect interactive use of `kill-buffer` in `kill-buffer-hook`

As per title, I want to define a kill buffer hook with the variable kill-buffer-hook and the function should be able to detect when (kill-buffer ) has been called interactively. Is this possible? ...
3
votes
1answer
551 views

How do i close the *compilation* buffer without visitinig its window?

I like to work with a vertically split frame with code in both windows. When i call M-x compile the *compilation* buffer shows in the other window (wich is fine as M-g n would show problematic code in ...
1
vote
2answers
41 views

Reload single file in every window

I have this function that reload a file but it don't work when I have same buffer opened in 2 different windows: (defun reload () "Reload a file it will kill buffer, open file again and jump to ...
1
vote
3answers
604 views

kill-buffer with y-or-n-p instead of yes-or-no-p

Q:  How can I use y-or-n-p -- instead of yes-or-no-p -- when calling kill-buffer for just the duration of a particular function? In other words, I want the behavior of (fset 'yes-or-no-p 'y-or-n-p) ...
1
vote
2answers
1k views

How can I close the current frame upon killing a buffer if that frame was only opened for it?

When I open a file in Emacs.app, via Finder, via the edit-server or during merging on an SVN update, it shows up in a new frame. When I kill that buffer, I pretty much always also want close the frame ...
2
votes
1answer
669 views

server-edit vs kill-buffer to kill an emacsclient buffer

I use emacsclient to open files from my webrowser (pdfs, text files etc). When I'm done with the file, I know I need to close it with C-x # (server-edit); if I use C-x k (kill-buffer) I get a warning ...
0
votes
1answer
111 views

How to override default keybindings?

I am new to the world of Emacs, so please forgive me if my question is too trivial. I am trying to use standard console keybindings for Emacs too, by editing the configuration file. A few of them are ...
17
votes
2answers
2k views

Kill process buffer without confirmation?

I have C-x C-k bound to kill-this-buffer. But when I enter into a buffer which is running a process like Python or MySQL, if I do C-x C-k it asks Buffer "*Python*" has a running process; kill it (...
2
votes
1answer
516 views

How can I delete all the gdb related windows/buffers after `q` in gdb CLI window

I use (setq gdb-many-windows t) and (setq gdb-show-main t) configurations in my init.el, so after executing M-x gdb, there will be six windows in the frame, after typing q in the main gdb cli window ...
3
votes
3answers
466 views

Rename scratch buffer and ask confirmation to kill non-file buffers created by user

I tend to use often non-file buffers kinda like post-it-notes and it is way too easy to kill them inadvertently, as there is no confirmation to kill. Even if you enforce the habit of writing only in ...
33
votes
6answers
4k views

How to reopen just killed buffer, like C-S-t in Firefox Browser?

Sometimes I accidentally kill a buffer and want to reopen it, just like C-S-t to undo closed tab in Firefox, but there is no built-in command in Emacs, the defun undo-kill-buffer in http://www....
8
votes
2answers
199 views

Kill-buffer prompt with option to diff the changes

The save-some-buffers command prompts to save or ignore each modified file, and also provides an option to diff the modified file against the file it is visiting. I'd like the same behavior from kill-...