unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* too many buffers
@ 2010-01-17 14:09 andrea
  2010-01-17 15:37 ` Peter Dyballa
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: andrea @ 2010-01-17 14:09 UTC (permalink / raw)
  To: help-gnu-emacs


When I use emacs for long times I end up having a lot of buffers.
It's not a big problem but it can be annoying, and there are some
buffers that should just not stay there:
- magit buffers
- dired buffers (I didn't find a variable useful to limit the opening of
  new buffers)
- completions/help/annotate.

I normally use those things once and if I need them again I'll execute
again the function.

Can I limit the creation of new buffers or maybe I should write some
functions that cleans the situation automatically (using ibuffer maybe)?

And also with org-mode when I use the agenda it visits ALL the buffers
without closing them after, is that normal?

I have more than 50 files in the agenda only...
Thanks






^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: too many buffers
  2010-01-17 14:09 too many buffers andrea
@ 2010-01-17 15:37 ` Peter Dyballa
  2010-01-17 17:58 ` Sean Sieger
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 14+ messages in thread
From: Peter Dyballa @ 2010-01-17 15:37 UTC (permalink / raw)
  To: andrea; +Cc: help-gnu-emacs


Am 17.01.2010 um 15:09 schrieb andrea:

> - completions/help/annotate.

There can only be one *Completions* and one *Help* and one *info* and  
one *scratch* and one ... buffer. Except you create deliberately a  
second one – although I think *Completions* and *Help* stay unique.

>
> I have more than 50 files in the agenda only...

It's not that much... In one session I have 60 buffers open. Right  
now. It can become more in the next days and weeks in case I'll hit  
some problem.

--
Greetings

   Pete

A child of five could understand this!  Fetch me a child of five.





^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: too many buffers
       [not found] <mailman.1572.1263737418.18930.help-gnu-emacs@gnu.org>
@ 2010-01-17 15:45 ` Galen Boyer
  2010-01-17 16:15 ` Florian Diesch
  2010-01-17 21:25 ` Tim X
  2 siblings, 0 replies; 14+ messages in thread
From: Galen Boyer @ 2010-01-17 15:45 UTC (permalink / raw)
  To: help-gnu-emacs

andrea <andrea.crotti.0@gmail.com> writes:

> When I use emacs for long times I end up having a lot of buffers.
> It's not a big problem but it can be annoying, and there are some
> buffers that should just not stay there:
> - magit buffers
> - dired buffers (I didn't find a variable useful to limit the opening of
>   new buffers)
> - completions/help/annotate.
>
> I normally use those things once and if I need them again I'll execute
> again the function.
>
> Can I limit the creation of new buffers or maybe I should write some
> functions that cleans the situation automatically (using ibuffer maybe)?
>
> And also with org-mode when I use the agenda it visits ALL the buffers
> without closing them after, is that normal?
>
> I have more than 50 files in the agenda only...
> Thanks


One way to handle this in a totally different fashion is to start
learning and using ibuffer.  For example, you can just collapse those
into some grouping and put that at the bottom of the ibuffer buffer.

-- 
Galen Boyer

--- news://freenews.netfront.net/ - complaints: news@netfront.net ---


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: too many buffers
       [not found] <mailman.1572.1263737418.18930.help-gnu-emacs@gnu.org>
  2010-01-17 15:45 ` Galen Boyer
@ 2010-01-17 16:15 ` Florian Diesch
  2010-01-17 21:25 ` Tim X
  2 siblings, 0 replies; 14+ messages in thread
From: Florian Diesch @ 2010-01-17 16:15 UTC (permalink / raw)
  To: help-gnu-emacs

andrea <andrea.crotti.0@gmail.com> writes:

> When I use emacs for long times I end up having a lot of buffers.
> It's not a big problem but it can be annoying, and there are some
> buffers that should just not stay there:
> - magit buffers
> - dired buffers (I didn't find a variable useful to limit the opening of
>   new buffers)
> - completions/help/annotate.
>
> I normally use those things once and if I need them again I'll execute
> again the function.
>
> Can I limit the creation of new buffers or maybe I should write some
> functions that cleans the situation automatically (using ibuffer maybe)?

I'm using <http://www.emacswiki.org/emacs/TempbufMode> to automatically
have those buffers closed.


   Florian
-- 
<http://www.florian-diesch.de/software/shell-scripts/>


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: too many buffers
  2010-01-17 14:09 too many buffers andrea
  2010-01-17 15:37 ` Peter Dyballa
@ 2010-01-17 17:58 ` Sean Sieger
  2010-01-18  5:07 ` Thien-Thi Nguyen
  2010-01-20 19:06 ` Sam Steingold
  3 siblings, 0 replies; 14+ messages in thread
From: Sean Sieger @ 2010-01-17 17:58 UTC (permalink / raw)
  To: help-gnu-emacs

andrea <andrea.crotti.0@gmail.com> writes:

    When I use emacs for long times I end up having a lot of buffers.

I see that you have particular questions you would like answered, but my
first thought when I saw your subject line was, are you utilizing C-x
C-b?  Managing buffers with it---visiting *Buffer List*--- makes things
proportional to my tiny mind.





^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: too many buffers
       [not found] <mailman.1572.1263737418.18930.help-gnu-emacs@gnu.org>
  2010-01-17 15:45 ` Galen Boyer
  2010-01-17 16:15 ` Florian Diesch
@ 2010-01-17 21:25 ` Tim X
  2 siblings, 0 replies; 14+ messages in thread
From: Tim X @ 2010-01-17 21:25 UTC (permalink / raw)
  To: help-gnu-emacs

andrea <andrea.crotti.0@gmail.com> writes:

> When I use emacs for long times I end up having a lot of buffers.
> It's not a big problem but it can be annoying, and there are some
> buffers that should just not stay there:
> - magit buffers
> - dired buffers (I didn't find a variable useful to limit the opening of
>   new buffers)
> - completions/help/annotate.
>
> I normally use those things once and if I need them again I'll execute
> again the function.
>
> Can I limit the creation of new buffers or maybe I should write some
> functions that cleans the situation automatically (using ibuffer maybe)?
>
> And also with org-mode when I use the agenda it visits ALL the buffers
> without closing them after, is that normal?
>
> I have more than 50 files in the agenda only...
> Thanks
>

Its quite normal for emacs to have lots of open buffers. I think the
trick is to use some of the facilities and other packages out there to
reduce the apparent clutter presented to the user when using things like
list-buffers or switch to buffer etc. 

Have a look on the emacs wiki at a few of the buffer related packages.
There are actually quite a few options out there. Your bound to find
something that will suit your preferences and requirements - in fact,
the issue will probably be identifying which one is best. Often, trial
and error is the best approach. 

Personally, I'm currently using ido mode and while I have lots of
buffers open, I tend to not notice them. I've also found ibuffer and
friends useful at times. 

Note that Org often keeps a lot of buffers open so that when you do
things like agenda views etc, it doesn't have the lead time of opening
them all again to determine what items may have been added/changed etc.
Of course, the number depends on the how many org files you have and
which ones are automatically included in your agenda views. 
Tim
-- 
tcross (at) rapttech dot com dot au


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: too many buffers
  2010-01-17 14:09 too many buffers andrea
  2010-01-17 15:37 ` Peter Dyballa
  2010-01-17 17:58 ` Sean Sieger
@ 2010-01-18  5:07 ` Thien-Thi Nguyen
  2010-01-20 19:06 ` Sam Steingold
  3 siblings, 0 replies; 14+ messages in thread
From: Thien-Thi Nguyen @ 2010-01-18  5:07 UTC (permalink / raw)
  To: help-gnu-emacs

() andrea <andrea.crotti.0@gmail.com>
() Sun, 17 Jan 2010 15:09:44 +0100

   write some functions that cleans the situation automatically

An example of this is approach is zonk-buffers.el.

thi




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: too many buffers
  2010-01-17 14:09 too many buffers andrea
                   ` (2 preceding siblings ...)
  2010-01-18  5:07 ` Thien-Thi Nguyen
@ 2010-01-20 19:06 ` Sam Steingold
  2010-01-20 21:03   ` Thierry Volpiatto
  3 siblings, 1 reply; 14+ messages in thread
From: Sam Steingold @ 2010-01-20 19:06 UTC (permalink / raw)
  To: andrea; +Cc: help-gnu-emacs

andrea wrote:
> 
> Can I limit the creation of new buffers or maybe I should write some
> functions that cleans the situation automatically (using ibuffer maybe)?

enable midnight.el to clean up unused buffers.
e.g.,
(custom-set-variables '(midnight-delay 7200 t (midnight)))
in your .emacs will remove old unused buffers at 2 am.




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: too many buffers
  2010-01-20 19:06 ` Sam Steingold
@ 2010-01-20 21:03   ` Thierry Volpiatto
  2010-01-20 22:17     ` Suvayu Ali
  0 siblings, 1 reply; 14+ messages in thread
From: Thierry Volpiatto @ 2010-01-20 21:03 UTC (permalink / raw)
  To: help-gnu-emacs

Sam Steingold <sds@gnu.org> writes:

> andrea wrote:
>>
>> Can I limit the creation of new buffers or maybe I should write some
>> functions that cleans the situation automatically (using ibuffer maybe)?
>
> enable midnight.el to clean up unused buffers.
> e.g.,
> (custom-set-variables '(midnight-delay 7200 t (midnight)))
> in your .emacs will remove old unused buffers at 2 am.

Also, avoid opening many dired buffer:

If you use anything <http://www.emacswiki.org/cgi-bin/emacs/Anything>

you will find a command named `anything-find-files' (it is new) in
anything-config.el.

With this command you can navigate to a file you want to open without
opening any dired buffers (use `C-z' to expand subdir and `C-.' to went back
one level).

So if you want to navigate to ~/foo/bar/baz/your_file, you will have
only the buffer your_file open.

I use this command as a replacement of standard C-x C-f.

-- 
Thierry Volpiatto





^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: too many buffers
  2010-01-20 21:03   ` Thierry Volpiatto
@ 2010-01-20 22:17     ` Suvayu Ali
  2010-01-20 22:34       ` Thierry Volpiatto
  0 siblings, 1 reply; 14+ messages in thread
From: Suvayu Ali @ 2010-01-20 22:17 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: help-gnu-emacs

On Wednesday 20 January 2010 01:03 PM, Thierry Volpiatto wrote:
> Sam Steingold<sds@gnu.org>  writes:
>
>> andrea wrote:
>>>
>>> Can I limit the creation of new buffers or maybe I should write some
>>> functions that cleans the situation automatically (using ibuffer maybe)?
>>
>> enable midnight.el to clean up unused buffers.
>> e.g.,
>> (custom-set-variables '(midnight-delay 7200 t (midnight)))
>> in your .emacs will remove old unused buffers at 2 am.
>
> Also, avoid opening many dired buffer:
>
> If you use anything<http://www.emacswiki.org/cgi-bin/emacs/Anything>
>
> you will find a command named `anything-find-files' (it is new) in
> anything-config.el.
>
> With this command you can navigate to a file you want to open without
> opening any dired buffers (use `C-z' to expand subdir and `C-.' to went back
> one level).
>
> So if you want to navigate to ~/foo/bar/baz/your_file, you will have
> only the buffer your_file open.
>
> I use this command as a replacement of standard C-x C-f.

Or you can just put this in your .emacs and use `a' to navigate and open 
files in a dired buffer. :)

(put 'dired-find-alternate-file 'disabled nil)

-- 
Suvayu

Open source is the future. It sets us free.




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: too many buffers
  2010-01-20 22:17     ` Suvayu Ali
@ 2010-01-20 22:34       ` Thierry Volpiatto
  2010-01-21 16:25         ` andrea
  0 siblings, 1 reply; 14+ messages in thread
From: Thierry Volpiatto @ 2010-01-20 22:34 UTC (permalink / raw)
  To: help-gnu-emacs

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

> On Wednesday 20 January 2010 01:03 PM, Thierry Volpiatto wrote:
>> Sam Steingold<sds@gnu.org>  writes:
>>
>>> andrea wrote:
>>>>
>>>> Can I limit the creation of new buffers or maybe I should write some
>>>> functions that cleans the situation automatically (using ibuffer maybe)?
>>>
>>> enable midnight.el to clean up unused buffers.
>>> e.g.,
>>> (custom-set-variables '(midnight-delay 7200 t (midnight)))
>>> in your .emacs will remove old unused buffers at 2 am.
>>
>> Also, avoid opening many dired buffer:
>>
>> If you use anything<http://www.emacswiki.org/cgi-bin/emacs/Anything>
>>
>> you will find a command named `anything-find-files' (it is new) in
>> anything-config.el.
>>
>> With this command you can navigate to a file you want to open without
>> opening any dired buffers (use `C-z' to expand subdir and `C-.' to went back
>> one level).
>>
>> So if you want to navigate to ~/foo/bar/baz/your_file, you will have
>> only the buffer your_file open.
>>
>> I use this command as a replacement of standard C-x C-f.
>
> Or you can just put this in your .emacs and use `a' to navigate and
> open files in a dired buffer. :)
>
> (put 'dired-find-alternate-file 'disabled nil)

Note that the first time you hit "a" in a dired buffer emacs will ask
you if you want to always use this command and will add it for you in
your .emacs ;-)

-- 
Thierry Volpiatto





^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: too many buffers
  2010-01-20 22:34       ` Thierry Volpiatto
@ 2010-01-21 16:25         ` andrea
  2010-01-21 16:43           ` Suvayu Ali
  0 siblings, 1 reply; 14+ messages in thread
From: andrea @ 2010-01-21 16:25 UTC (permalink / raw)
  To: help-gnu-emacs

Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:

> Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

Thanks guys your advices where really useful.
Now I've only enabled tempbuf mode for "stupid" modes and ido.

The only annoying thing was seeing the minibuffer growing so much every
time I was switching.  With ido-mode this problem is solved, so I'm
already satisfied.

>> (put 'dired-find-alternate-file 'disabled nil)

I didn't get this, I try to open a dired buffer but I see the normal
dired.
By the way what is the /put/ and /set/ thing?
Why we need a property instead of a normal variables?





^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: too many buffers
  2010-01-21 16:25         ` andrea
@ 2010-01-21 16:43           ` Suvayu Ali
  2010-01-21 19:22             ` Drew Adams
  0 siblings, 1 reply; 14+ messages in thread
From: Suvayu Ali @ 2010-01-21 16:43 UTC (permalink / raw)
  To: help-gnu-emacs

On Thursday 21 January 2010 08:25 AM, andrea wrote:
>> Suvayu Ali<fatkasuvayu+linux@gmail.com>  writes:
>>> (put 'dired-find-alternate-file 'disabled nil)
>
> I didn't get this, I try to open a dired buffer but I see the normal
> dired.

Every time you open something with `a' in dired, it replaces the 
original dired buffer. So you don't end up opening numerous dired 
buffers while trying to find some file. :)

-- 
Suvayu

Open source is the future. It sets us free.




^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: too many buffers
  2010-01-21 16:43           ` Suvayu Ali
@ 2010-01-21 19:22             ` Drew Adams
  0 siblings, 0 replies; 14+ messages in thread
From: Drew Adams @ 2010-01-21 19:22 UTC (permalink / raw)
  To: help-gnu-emacs

> > I didn't get this, I try to open a dired buffer but I see the normal
> > dired.
> 
> Every time you open something with `a' in dired, it replaces the 
> original dired buffer. So you don't end up opening numerous dired 
> buffers while trying to find some file. :)

`a' is command `dired-find-alternate-file', which simply calls
`find-alternate-file', which replaces the current buffer with the new, target
buffer. That might or might not be what you want.

I'm a big fan of `find-alternate-file' (which is bound globally to `C-x C-v') -
I use it very often. But I use it only when I explicitly want it.

Be aware that `a' in Dired always replaces (kills) the current Dired buffer.
IOW, it will not only replace one Dired buffer with another Dired buffer - it
will also replace a Dired buffer with a file buffer. It does not distinguish
between visiting a file and visiting a directory.

That is, if you use `a' on a directory line then it replaces the current Dired
buffer and opens a new one for the line's directory. But if you use `a' on a
file line then it does the same thing: it replaces the current Dired buffer with
a buffer visiting the line's file.

So if you do not want to kill the current Dired buffer then do not use `a' on a
file line.

An alternative approach is to load `dired+.el' and use command
`toggle-dired-find-file-reuse-dir'. That makes the usual Dired file/directory
access keys replace (kill) the current Dired buffer, but only when you visit
another directory.

IOW, it makes `RET', `mouse-2', `e', and `f' reuse (replace) Dired buffers, just
like `a' does. But unlike `a', these keys will not kill the Dired buffer when
you visit a file.

In sum, if you want to always reuse Dired buffers, then turn this on and forget
about it - just use the usual Dired keys.

To cancel this behavior, use the toggle command again. To set this behavior by
default, put this in your .emacs:

 (toggle-dired-find-file-reuse-dir 1)

http://www.emacswiki.org/emacs/DiredPlus






^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2010-01-21 19:22 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-17 14:09 too many buffers andrea
2010-01-17 15:37 ` Peter Dyballa
2010-01-17 17:58 ` Sean Sieger
2010-01-18  5:07 ` Thien-Thi Nguyen
2010-01-20 19:06 ` Sam Steingold
2010-01-20 21:03   ` Thierry Volpiatto
2010-01-20 22:17     ` Suvayu Ali
2010-01-20 22:34       ` Thierry Volpiatto
2010-01-21 16:25         ` andrea
2010-01-21 16:43           ` Suvayu Ali
2010-01-21 19:22             ` Drew Adams
     [not found] <mailman.1572.1263737418.18930.help-gnu-emacs@gnu.org>
2010-01-17 15:45 ` Galen Boyer
2010-01-17 16:15 ` Florian Diesch
2010-01-17 21:25 ` Tim X

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).