From: Adam Beneschan on
This isn't really about Ada, but I figure it probably affects readers
of this newsgroup more than many others.

I've been using GNU Emacs for my Ada sources for a long time.
Recently, I needed it on a new machine, so I installed a recent
version of GNU Emacs. A major annoyance is that the Electric Buffer
List now truncates file names to 20-22 characters; older versions
would try to display the whole file name but truncate some of the
other information. (I like using an 80-character width.) This may
not be a problem for a typical C user, but many of the publicly
available Ada packages use file names built from all the ancestor and
child package names, with an .ads or .adb extension (spec/body). If I
go to the Electric Buffer List to select a buffer, and I've already
loaded both the .ads and .adb files, I can't tell from the list which
is which, and I have to try to guess whether I'm selecting the .ads or
the .adb file.

I asked the Emacs newsgroup whether there was a solution. There seem
to be some possible lame solutions, which I haven't looked into, but I
also recall someone commenting that I should just switch to using
shorter file names like the rest of the world. Pretty inane, not just
the idea that I should redo all my own file naming conventions to suit
the editor, but they didn't even consider that I might be using
someone else's package of files and don't have control over the
naming. Anyway, (1) I figured I'd get more sympathy for my whining on
this newsgroup, plus (2) I thought maybe some other Ada user who had
run into a similar problem had a solution. If so, I'd appreciate any
thoughts.

-- thanks, Adam
From: Simon Wright on
I hadn't come across electric-buffer-list before; I use
mouse-buffer-menu, bound (not by me) to C-down-mouse-1.

Customised mouse-buffer-menu-mode-mult to 1.
From: Stephen Leake on
Adam Beneschan <adam(a)irvine.com> writes:

> This isn't really about Ada, but I figure it probably affects readers
> of this newsgroup more than many others.

we spend a lot of time talking about Ada tools, so this is fine.

> I've been using GNU Emacs for my Ada sources for a long time.
> Recently, I needed it on a new machine, so I installed a recent
> version of GNU Emacs. A major annoyance is that the Electric Buffer
> List now truncates file names to 20-22 characters; older versions
> would try to display the whole file name but truncate some of the
> other information. (I like using an 80-character width.) This may
> not be a problem for a typical C user, but many of the publicly
> available Ada packages use file names built from all the ancestor and
> child package names, with an .ads or .adb extension (spec/body). If I
> go to the Electric Buffer List to select a buffer, and I've already
> loaded both the .ads and .adb files, I can't tell from the list which
> is which, and I have to try to guess whether I'm selecting the .ads or
> the .adb file.

I've never used an Electric Buffer List; what command do I invoke to get
it?

I find iswitchb to be very productive. It gives you a list of all
buffers in the mini-buffer area, then does partial name matching on what
you type. Here's the relevant part of my .emacs:

(require 'iswitchb)
(setq iswitchb-default-method 'samewindow)
(add-hook 'minibuffer-setup-hook 'iswitchb-minibuffer-setup)
(add-hook 'iswitchb-define-mode-map-hook
(lambda ()
(define-key iswitchb-mode-map [right] 'iswitchb-next-match)
(define-key iswitchb-mode-map [left] 'iswitchb-prev-match)
(define-key iswitchb-mode-map [f12] 'iswitchb-find-file)))

(define-key global-map [f11] 'iswitchb-buffer)

> I asked the Emacs newsgroup whether there was a solution. There seem
> to be some possible lame solutions, which I haven't looked into, but I
> also recall someone commenting that I should just switch to using
> shorter file names like the rest of the world.

Nonsense!

Although you should use a wider screen; 80 columns is just too limiting :).

--
-- Stephe
From: Stephen Leake on
Simon Wright <simon(a)pushface.org> writes:

> I hadn't come across electric-buffer-list before; I use
> mouse-buffer-menu, bound (not by me) to C-down-mouse-1.

Ah; invoke electric-buffer-list.

A little poking with the elisp debugger, and I found this variable:

Buffer-menu-buffer+size-width is a variable defined in `buff-menu.el'.
Its value is 26

Documentation:
How wide to jointly make the buffer name and size columns.

You can customize this variable.

--
-- Stephe
From: Adam Beneschan on
On May 24, 7:44 pm, Stephen Leake <stephen_le...(a)stephe-leake.org>
wrote:
> Simon Wright <si...(a)pushface.org> writes:
> > I hadn't come across electric-buffer-list before; I use
> > mouse-buffer-menu, bound (not by me) to C-down-mouse-1.
>
> Ah; invoke electric-buffer-list.
>
> A little poking with the elisp debugger, and I found this variable:
>
> Buffer-menu-buffer+size-width is a variable defined in `buff-menu.el'.
> Its value is 26
>
> Documentation:
> How wide to jointly make the buffer name and size columns.
>
> You can customize this variable.

Thanks, that's very helpful. I'll play around with it a bit more to
see if I can really make this work the way I'd like (ideally, setting
up a key binding that would let me switch this value back and forth if
needed), but I think this is the main answer.

I'll also think about your suggestion to allow myself a wider screen.
I think my reluctance has been a throwback to the old days when a lot
of printouts were only allowed 80 columns, which is itself a throwback
to the number of characters on a Hollerith card. Here it's 2010 and
my life still revolves around Hollerith cards. Sigh....... (Then
again, I'm using a language that refuses to use square or curly
brackets or some other special characters in its syntax because they
weren't available on old punch-card machines.)

On the other hand, I probably won't be doing things Simon's way. I
kind of like being able to keep my hands in one place, rather than
having to move them to use some sort of rodent-like attachment. But I
appreciate the input from both of you.

-- Adam