1

Often times, when I'm done a task, I'd like to close out of all buffers I was using for it. However, I usually don't, because I think it'd be a pain.

What I'd like is to be able to kill all buffers spawned from a particular one -- usually, when I begin a task, there is a buffer I open first, and I'd like to be able to kill all buffers spawned from that one -- all buffers opened with C-x C-f or whatever while I was initially in that buffer, or recursively. Does this exist?

Drew
  • 75,699
  • 9
  • 109
  • 225
extremeaxe5
  • 639
  • 3
  • 10
  • I think the question is unclear and you'll need to describe just what you're doing, e.g. by giving a step-by-step recipe to reproduce the behavior/context, starting from `emacs -Q` (no init file). There is no generic notion/behavior of buffers spawning buffers. We cannot guess what "tasks" you might be performing. – Drew Mar 29 '19 at 02:00
  • @Drew OK, well I guess you mostly answered what I was wondering. I was just wondering if there was some simple information stored somewhere (for all buffers) about a parent. I guessed that this was not the case. – extremeaxe5 Mar 29 '19 at 03:35
  • It still might help if you describe more what you are doing. It's possible that someone here might be able to help. Sometimes a clearer description can turn on the light. – Drew Mar 29 '19 at 04:30
  • There's no data stored that relates one buffer to another. However, some of the project-management packages might provide a different approach to this problem, depending on what you mean by 'task'. I don't use them, so I'm not so familiar, but there may well be a way to kill all buffers visiting files in the same directory, or files in the same git repo – Tyler Mar 29 '19 at 16:18
  • 1
    Your question seems pretty clear to me, BTW, so let me try at an answer: there are [four functions](https://www.gnu.org/software/emacs/manual/html_node/elisp/Creating-Buffers.html) in Emacs that create buffers, but, as @Tyler points out, none of them save the "parent buffer" as a state of the created buffer. However, using Ibuffer, you can create [groups](https://www.emacswiki.org/emacs/IbufferMode) based on buffer name or major-mode (Gnus-style) or even version control status, path, or parent directory, which you can then select and destroy all at once. – Dmitri Mar 30 '19 at 00:25
  • 1
    Check out [this question](https://emacs.stackexchange.com/questions/202/close-all-dired-buffers) for more ideas. – Dmitri Mar 30 '19 at 00:27

0 Answers0