[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Problem with new display in buffer-menu command
From: |
kevin.gal |
Subject: |
RE: Problem with new display in buffer-menu command |
Date: |
Mon, 04 Dec 2006 14:09:35 -0600 (CST) |
In the buffer-menu display, long file names are now truncated
(indicated by a ":"). Since the display lines are not wrapped, as
well, this can result in a display looking like this:
. viper-keys-new-test-c: 6 C++/lah
~/usr/local/share/emacs/22.0.91/lisp/emulation/v
viper-keys-new-test-c: 6 C++/lah
~/usr/local/share/emacs/22.0.91/lisp/emulation/v
%* emulation 4097 Dired by name
~/usr/local/share/emacs/22.0.91/lisp/emulation/
% lisp 39305 Dired by name
~/usr/local/share/emacs/22.0.91/lisp/
In your message, the first two file names are indented much more than
the following ones. Is that true in the menu too? If so, that seems
like a bug, isn't it?
No, they are all lined up in the menu. It was either a bad cut-and-paste, on
my part, and/or the mailer messed it up.
One of the two top files ends in .h file and the other ends in .cpp,
but the user cannot tell which is which from this display without
first visiting one.
We could omit text from the middle of the name instead of from the end.
Would that be better?
No Two different files with the same extension might differ only by the middle
characters in their base name, which would result in the same problem.
Normally, one would expect the full filename to
appear when moving the mouse over the truncated filename. But,
instead, the message "mouse-1: select this buffer" is always
displayed, instead, which isn't helpful in this situation.
That seems like a good idea. I think that we have no ability to
attach different help strings to parts of a menu item, but we could
attach the full file name as the help string to the whole menu item.
I just realized that the above suggestion ONLY works when Emacs is running in a
window manager. So, for a complete solution, perhaps the following would be a
better approach.
Instead of having one default display width for the Buffer column, support
having a default range (or small set) of widths to pick from. When the need to
truncate (with the current default width) is first determined, change the
current default width to a larger one (in the default range or from the default
set of widths) which is capable of displaying the full file name. Then simply
re-call the logic to re-generate the display with the new current default
width. If a file name length exceeds the maximum width permitted (perhaps half
of the current Emacs line width might be a good choice), then truncate using
the current truncate logic using the maximum width.
Another alternative is to have the first suggested behavior when running in a
window manager and, when not running in a window manager, revert back to using
Emacs 21 behavior.