emacs buffer menu does not show all buffers [duplicate] - emacs

This question already has an answer here:
Changing the size of the menu from the "Buffers" item in the menu bar in emacs
(1 answer)
Closed 9 years ago.
When I pull down the emacs buffer menu, if I have a lot of buffers, I see only a subset of them listed. So, I then have to do List All Buffers. Is there a way to configure the Buffer Menu so that it will show all buffers? Xemacs always did that, but we no longer are able to use that.

Adjust buffers-menu-max-size:
(setq buffers-menu-max-size nil)
From the C-h v buffers-menu-max-size on my version of Emacs 24.3:
Maximum number of entries which may appear on the Buffers menu.
If this is 10, then only the ten most-recently-selected buffers are shown.
If this is nil, then all buffers are shown.
A large number or nil slows down menu responsiveness.

Related

Emacs sr-speedbar

I am currently trying to learn Emacs more in depth so that I can do more with my Emacs than just simple editing stuff...
I am making good progress and at the moment I am trying to configure the 'sr-speedbar' module to my liking, but some details I can't figure out myself:
Say that I've 2 open buffer windows A and B plus the speedbar window. If I open a file by pressing Enter in the speedbar window, then the new file always get opened in the same buffer window B (which I opened last). Can I somehow specify that the new content should be opened in buffer window A?
Currently the speedbar window refreshes itself automatically to the new location whenever I open a new file using 'C-x C-f'. This is actually pretty useful, but sometimes I don't want this when I am quickly trying things out in a tmp file. And the refresh also "destroys" my "tree-view" of the speedbar, where I expanded the directory contents rather than opening them directly. The question is, how can I suppress this "refreshing behaviour"? Can I somehow disable the automatic mode and trigger it manually if I need it?
And do you guys have more useful tips regarding speedbar navigation? How does a Emacs guru use speedbar or are there better alternatives?
Thx in advance for your help!
You can turn off the auto-refresh in your init file like this -
(require 'sr-speedbar)
(setq sr-speedbar-auto-refresh nil)
and/or turn it on and off later with the function sr-speedbar-refresh-toggle.
The defaults it (and speedbar) comes with are a bit odd though - it also doesn't show files that it doesn't recognize, uses images for buttons, and is set on the right side - so you can set these if you'd like -
(setq speedbar-show-unknown-files t) ; show all files
(setq speedbar-use-images nil) ; use text for buttons
(setq sr-speedbar-right-side nil) ; put on left side
I do use sr-speedbar for projects that have enough of a directory structure - otherwise I use the usual switch-to-buffer (C-x b), ibuffer (C-x C-b), and dired (C-x d), and another function that switches to the previous buffer. Also bound to single keys because they get used so much.
But... I'm still learning Emacs - I haven't tried helm, projectile, or project-explorer yet - they look interesting also.

Switch a buffer after C-x C-b command USING KEYBOARD [duplicate]

This question already has answers here:
Emacs: help me understand file/buffer management
(6 answers)
Closed 8 years ago.
After having typed C-x C-b there will a new window showing currently opened buffers... that is easy. But how can I switch to one of them using only my keyboard? Now I have to move my mouse an click on the one of my interest, and that looks stupid:(
Thanks!
It's a standard read-only buffer with some special bindings. Switch to the window first with C-x o, then you can browse buffers with n, p. Open one in the new window with RET. You can even search the buffer if desired.
Check ido mode. Actually similar questions have been asked quite a few time.

Emacs ediff mode [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
ediff-split-window-function horizontal==vertical?
Using GNU Emacs 23.4.1. With M-x ediff-files
1-How to make the 2 files vertically beside each other. By default they are one top, one down. I want one left and one right.
2-How to scroll automatically to next difference?
To split the panes side-by-side:
(setq ediff-split-window-function 'split-window-horizontally
ediff-window-setup-function 'ediff-setup-windows-plain)
(You can explore ediff's settings using M-x customize-group RET ediff RET.)
n and p will take you to the next or previous diff chunk, respectively. Press ? to get the full menu, which includes handy keys to copy changes from buffer 1 to buffer 2 and vice versa.

Selecting different buffers in the buffer menu [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How can I more easily switch between buffers in Emacs?
GNU Emacs 24.1.1
Hello,
When I want to switch buffers I use the following C-x C-b if I have many buffers active. But I find it very inefficient.
And it will display a lists of open buffers in the next buffer (I don't like this in the next buffer). Normally I have 4 buffers open at the same time.
Using the above I will then have to put the cursor (C-o) to get focus in the buffer-list buffer, when scroll up or down to select the buffer I want.
Sometimes I use C-x-b if I don't have many active buffers. However, I always have many.
However, I am looking for something then will open up a small buffer with a list of buffers (the minimum needed - just enough to show all buffers), and will automatically have focus. I scroll to select the buffer I want. And it will appear in the buffer I had focus on before I open the list of buffers. The buffer-list will then disappear.
Does anyone know of anything like this to make switching buffers easier.
Many thanks for any advice,
Apart from ido-mode, good buffer switching solutions are:
Plain-old C-x b + icomplete-mode
ibuffer - just rebind C-x C-b to ibuffer to see it in action:
(global-set-key (kbd "C-x C-b") 'ibuffer)
Helm - an incremental narrowing and selection framework useful to find just about anything (buffers included).
Check ido-mode. C-x C-b is the old way.
The ido lets you interactively do things with buffers and files.

How do I set the number of items in the mouse buffer menu in Emacs?

When I press ctrl+left-mouse-button in Emacs, I get the mouse buffer menu. This is my favourite way of switching buffers, but the list of buffers doesn't have to be too long before it re-organises the list into sub menus (fundamental, LISP, others etc...). I really hate this because I find it much harder to find the buffer I'm looking for.
My question is: How can I set the number of items in the mouse buffer menu that emacs will show before it breaks the menu into submenus? (I want to increase it, obviously!)
The following two variables give you some control over this:
mouse-buffer-menu-maxlen
mouse-buffer-menu-mode-mult
My interpretation is that the latter is the maximum number of buffers in a given major mode before that mode gets its own sub-menu, and the former is the maximum number of buffers allowed in any sub/menu before it is split into multiple menus.
setq as appropriate, or
M-x customize-group RET mouse RET
full code with details to add to .emacs file is below
also note that mouse-buffer-menu-mode-mult takes precedence
to evaluate the below and see effect immediately, highlight and type M-x eval-region or put cursor inside each () and type M-C-x
;; "ctrl - left click" buffer menu: increase number of items shown
;; set max length of this list. default 20. see next.
(setq mouse-buffer-menu-maxlen 30)
;; set # buffer in a mode before grouping begins. takes precedence over previous
;; set to 1 to always group by mode. default 4
(setq mouse-buffer-menu-mode-mult 8)