charles, i agree with you that your approach is good. i think a good solution
would be to use cooperation between redisplay and individual modes -- e.g.
create an extent property called `align-spaces' that can be put on text. this
should be settable either way -- force alignment or force non-alignment. you
could, for example, have code in C mode that scanned for what appeared to be
successive lines with aligned declarations on them, and put the `align-spaces'
property on the text.
Charles G Waldman wrote:
Jonathan Harris writes:
> Maybe I'm Missing The Point but Charles' approach seems wrongheaded to
> me.
Why, thank you for the compliment! That's the nicest thing anybody's
said to me all day! ;-)
> If I understand correctly Charles' approach is to work out at
> redisplay time which characters in a buffer need to be aligned with
> which other characters so that tabular data is displayed correctly. This
> is tricky and likely to be expensive.
Maybe it's a little tricky but my current one-pass implementation is
not expensive at all. And, you can always turn it off.
If I put in the backtracking that Martin suggests, then it will get a lot
more expensive. But, as Martin also points out, "computers are
fast". I've got cycles to burn... hell, I've even toyed with the idea
of antialiasing...
> But isn't this exactly the problem that tabs are meant to solve? The
> package list example looks so bad with a proportional font because
> spaces are used instead of tabs. There's no reason that tabs couldn't be
> used instead.
How about the calendar example? Hmm, I guess you could set a
tab-width of 3 and use tabs instead of spaces.
But I think it would be a huge amount of work to change all the
packages to use tabs instead of spaces. The problem is widespread; it
affects GNUS and VM and dired and efs and pcl-cvs and ...
Suppose I change all these packages to use tabstops instead of spaces
for alignment. Having done so, I would have a nice-looking package
list and nice-looking calendar, but when I go to edit some arbitrary
file that uses spaces for indentation I don't get aligned text. Or,
if I'm viewing man pages. Or using W3 to view some <pre> text that's
supposed to be aligned. And how about when I'm in my *shell* buffer
and type "ls" ?
Taking care of the alignment inside of redisplay is a *universal*
solution, rather than changing 10,000 individual .el files.
> And frankly I don't think that the "int i; double d"
> problem is worth solving.
I'm on the fence about this one. I may not think it's quite as
important as Martin does, but it *would* be nice. I don't like the
idea of introducing backtracking, though.
> No-one else tries to solve the `mmmm' problem (actually I think that
> 'W's are usually considered the widest letter?).
So you would call it the `WWW' problem? (Sorry, couldn't resist).
> In word processors the user sets tab stops in inches and it's up to
> the user to make sure that the tab stops are wide enough to
> accommodate the data. I don't see why we should try to do more.
I thought XEmacs was all about "doing more" !
--
Ben
In order to save my hands, I am cutting back on my mail. I also write
as succinctly as possible -- please don't be offended. If you send me
mail, you _will_ get a response, but please be patient, especially for
XEmacs-related mail. If you need an immediate response and it is not
apparent in your message, please say so. Thanks for your understanding.
See also
http://www.666.com/ben/chronic-pain/