Sanel Zukan | 14 Mar 2012 14:49
Picon

[PATCH] Sort buffer names

Hi,

Here is patch for sorted buffer names when ':ls" was given. I often
use this command and when you have a bit of loaded files with various
additional modes that opens own buffers, things becomes quite messy.

This patch will apply sort on buffer names, so hidden buffers (those
with " *xxx*") will be put first, then modes specific buffers (e.g.
"*xxx*") and then goes files/directories.

One nice feature would be numbering buffers, just like Vim does, so
each buffer can be opened with ":b<n>". What do you guys think about
it?

Regards,
Sanel
Attachment (buffer-sort.patch): application/octet-stream, 582 bytes
_______________________________________________
implementations-list mailing list
implementations-list <at> lists.ourproject.org
https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
Frank Fischer | 14 Mar 2012 15:38
Picon

Re: [PATCH] Sort buffer names

On Wed, Mar 14, 2012 at 02:49:42PM +0100, Sanel Zukan wrote:
> Hi,
> 
> Here is patch for sorted buffer names when ':ls" was given. I often
> use this command and when you have a bit of loaded files with various
> additional modes that opens own buffers, things becomes quite messy.
> 
> This patch will apply sort on buffer names, so hidden buffers (those
> with " *xxx*") will be put first, then modes specific buffers (e.g.
> "*xxx*") and then goes files/directories.

Thanks, applied in 1689501f.

> One nice feature would be numbering buffers, just like Vim does, so
> each buffer can be opened with ":b<n>". What do you guys think about
> it?

This is at least not easy to achieve. The problem is that Emacs does
not (AFAIK) assign unique numbers to the buffers. Instead Emacs
manages a buffer-list which is rearranged each time some buffer gets
active (it is moved to the front of this list). Therefore there is no
standard way to identify buffers by number.

Frank
Sanel Zukan | 14 Mar 2012 16:07
Picon

Re: [PATCH] Sort buffer names

Cool! Thanks :)

> This is at least not easy to achieve.

Then is ok as it is definitely not must-have feature :)  And thank you
for detail explanation.

Regards,
Sanel

On Wed, Mar 14, 2012 at 3:38 PM, Frank Fischer
<frank.fischer <at> mathematik.tu-chemnitz.de> wrote:
> On Wed, Mar 14, 2012 at 02:49:42PM +0100, Sanel Zukan wrote:
>> Hi,
>>
>> Here is patch for sorted buffer names when ':ls" was given. I often
>> use this command and when you have a bit of loaded files with various
>> additional modes that opens own buffers, things becomes quite messy.
>>
>> This patch will apply sort on buffer names, so hidden buffers (those
>> with " *xxx*") will be put first, then modes specific buffers (e.g.
>> "*xxx*") and then goes files/directories.
>
> Thanks, applied in 1689501f.
>
>> One nice feature would be numbering buffers, just like Vim does, so
>> each buffer can be opened with ":b<n>". What do you guys think about
>> it?
>
> This is at least not easy to achieve. The problem is that Emacs does
(Continue reading)


Gmane