how to close the tabbar group in emacs - emacs

I use tabbar in emacs.
I can use [C-x k] to kill the buffer.
But how can i kill the group?

Related

Emacs move between split windows not C+x 0

If I move between split windows as in this SO answer https://stackoverflow.com/a/4671868/461887
C-x o
It closes the left hand side buffer/split when doing this. I just want to hop between the splits not close the current split.
How do I do this?
Make sure you are hitting the letter 'o', not the number 0. 0 will close the current window, and 'o' will switch to other window. ('window' in emacs terminology is what you are referring to as a 'buffer' or 'split')
If that doesn't work, try loading emacs with '-q' at the command line which will disable loading of any customizations in your initialization file that might be interfering with emacs' default keybindings.
emacs -q
You can also try C-h b which will pop up a buffer which describes all of your keybindings - search this for C-x o to see what it is bound to.
C-x o It should not close any window, by default.
What does C-h k C-x o say that key is bound to? Can you see what, in your init file binds that command?
If not then recursively bisect your init file to find out what you are doing that causes the closing-window behavior you do not like.
You can use comment-region to comment out 1/2 of your init file, then 3/4, 7/8, 15/16,... until you have narrowed it down to the culprit. You can use C-u with comment-region to uncomment.

In emacs how can I kill multiple buffers without opening each individually

I have a lot (~30) of buffers whose names start with the same substring. Is there a way I can pass a regular expression to the kill buffer command so I can kill all of them in one go?
The command I was looking for M-x kill-matching-buffers.
Run M-x ibuffer (built-in command).
On each line with a buffer you want to delete press 'd'.
When finished press 'x' to commit changes.
A more interactive and versatile approach is with helm-buffers-list:
Type what you want to match.
Select all matches with M-m (helm-toggle-all-marks).
Optionally, refine your selection with C-SPC (helm-toggle-visible-marks),
using C-n/C-p to navigate.
Press TAB, select "kill buffers" from the available options.
Other options are query-replace / occur / grep / revert, and a bunch of others.
C-x C-b to list all buffers
k to mark buffers for kill (D appears next to buffer)
x to execute kill
Using helm:
Open helm using helm-mini. In my case I have it mapped to C-2
Scroll through the list and mark the ones you want to delete with C-Space
Now just press M-S-d / M-D
This deletes all selected buffers and closes helm-mini.

Emacs, How can I display only current task and hide others in org-mode?

Org-mode.
I have a big tasks tree and I want to select only 1 in buffer (write notes just for it) and hide others while editing.
How can I do this?
task-1
subtask-1.1
subtask-1.2
task-2
subtask2.1
...
...
For example I want to display for me only:
subtask-1.2
(notes for this subtask)
Use narrow-to-defun or org-narrow-to-subtree command with point in task. (widen to move back to whole buffer content).
Default shortcuts:
C-x n s # org-narrow-to-subtree (bound in org-mode)
C-x n d # narrow-to-defun
C-x n w # widen
Manual
You also have org-tree-to-indirect-buffer, or C-c C-x b, which will create a new buffer with only this subtree, and reflect any change in one buffer into the other.

I have multiple windows in Emacs, (C-x o) will take me to the "other" window, what does other mean?

I'm new to Emacs. I'm confused about the C-x o command. This command will move the focus to the other window. If I have many windows, which window will be selected as the target? What's the quickest way to do this?
Thanks
"When there are more than two windows, this command moves through all the windows in a cyclic order, generally top to bottom and left to right." - Emacs Manual
http://www.gnu.org/software/libtool/manual/emacs/Other-Window.html
C-x o is as quick as any other if you just have two windows. When you have more than 2 windows though, it can be a pain getting to the one you want using C-x o.
The quickest way to move to a particular window to the left/right/top/bottom of the current window is Wind Move. It comes with Emacs 21 and above. You can use Shift + arrow key to move to a window.
http://www.emacswiki.org/emacs/WindMove
First you've got to notice that "window" in Emacs slang means not what you may think it means. What is normally called a window is called "frame" in Emacs. What Emacs calls "window" is a split window inside a frame.
The easiest way to understand what C-x o does is by trying it out yourself.
In a running Emacs instance, first type C-x 2. Now the frame is split vertically into two windows. The cursor ("point") is in the upper of the two windows. Now type C-x 3 and you will have split the upper window horizontally again. All in all you've got three windows now.
Now type C-x o repeatedly to cycle through the different windows. That's it.
Once you've gotten used to the order in which the windows are cycled through, you can do multiple hops at once, thereby skipping some windows, by using the key combination together with a prefix argument. So say, you want to skip one window and thus jump two at once, type C-2 C-x o. This way you can quickly jump to the window you want.
(To return to a single window, type C-x 1.)
C-x o cycles though your opend windows in current frame. If you often have many opend windows, have a try of dim switch window. It displays window index visually and you can switch to a window using its index.
In case such people like me brows the web with research engines to simplify the switching between more than one window I suggest this bindings key configuration (to put in your init file):
(global-set-key [s-left] 'windmove-left)
(global-set-key [s-right] 'windmove-right)
(global-set-key [s-up] 'windmove-up)
(global-set-key [s-down] 'windmove-down)
It bind windows direction switching to super (windows key) + arrows key direction. These case should come unbound.
EDIT
(windmove-default-keybindings 'super) is simpler code thanks to #phils comment below.
BTW if you work with gnome these keys might be bound to some windows moves so you'll have to change it.

Emacs buffer shown after closing a buffer

How can I modify the way emacs picks which buffer to show after closing a buffer?
When I have multiple columns showing the same buffer, and then open another file in one of the buffers and then close the newly opened buffer, it doesn't switch back to the previous buffer, but to another buffer.
I'll try to explain with an example:
Start with a new emacs at *scratch*
C-x 2 (split into two columns)
C-x C-f 1 (find file 1)
C-x o (switch to other frame)
C-x b 1 (find file 1)
C-x C-f 2 (find file 2)
C-x k (kill buffer)
Now it switches to scratch but I would like it to show 1 in both windows again, is it possible to make emacs behave this way?
This may not be a direct answer to your question, but it might help.
Emacs manages its buffer list, including deciding which buffer gets displayed when you kill one (via kill-buffer). I haven't looked into how it's done, but the documentation is "out there". Lots of people have created custom buffer-stack management magic to change the way emacs does things, maybe some of them are based on bayesian analysis, or whatever. You can imagine the possibilities.
I've never looked into changing the way emacs manages its buffers. Instead I just bind other-window and switch-to-buffer to easy keystrokes (C-x o, C-x b) and I get really good at using them.
you could create a simple function for what you want: it should destroys all other windows, then split the window so that the current buffer is displayed in both. Luckily, emacs has functions that do exactly those things.
(defun cheeso-show-buffer-two-windows ()
"Close all other windows; then split, and show the current
buffer in both windows."
(interactive)
(delete-other-windows)
(split-window-vertically))
Bind that to a keystroke, and badda-bing, you're there. This is a vertical split - the windows are displayed in a vertical stack. If you want it horizontally split (the windows are side-by-side), then replace ... well, you know.
This also doesn't quite help directly, but Winner mode might help you get where you want to get.
Are you using tabbar-mode? I had the same problem and for me tabbar was the cause. Tabbar adds the function tabbar-buffer-kill-buffer-hook to kill-buffer-hook. You can remove it with (remove-hook 'kill-buffer-hook 'tabbar-buffer-kill-buffer-hook).
If you don't use tabbar try M-x describe-variable kill-buffer-hook. One of the functions in this list should be responsible for messing with your buffers.