[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ruler-mode is broken
From: |
Lute Kamstra |
Subject: |
Re: ruler-mode is broken |
Date: |
Fri, 10 Oct 2003 11:06:28 +0200 |
User-agent: |
Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) |
David PONCE <address@hidden> writes:
>> By the way, on my Emacs, both the minimal and the half style of
>> fringe-mode set the actual fringes to:
>>
>> (window-fringes) => (5 6 nil)
>>
>> So maybe you can reproduce the bug in ruler mode by using these
>> values.
>
> I tried these values and ruler-mode worked fine here.
That is probably because your frame-char-width is not 5 + 6. (If I'm
right, you should be able to reproduce the bug if you set the left
fringe width and the right fringe width to approximately half the
character width, making sure they add up to the character width.)
I think I figured out what the problem is. The function
ruler-mode-ruler seems to assume that:
fullw = lsb + lf + lm + w + rm + rf + rsb
However, when the left fringe width and the right fringe width are
both non zero and add up to the character width, you have that lf and
rf both round up to 1 and therefore their sum to 2 resulting in:
fullw + 1 = lsb + lf + lm + w + rm + rf + rsb
As fullw is used to set the length of the ruler string and the other
variables are used to put text properties on this string at the
appropriate places, ruler-mode-ruler tries to put the rightmost text
property beyond the string length.
A trivial solution would be not to calculate fullw independently, but
to simply set it to the sum of the other lengths. This has ugly
results, however: if the left fringe has a width that is not a
multiple of the character width and ruler mode uses a normal width
character to cover the fringe in the ruler, the ruler is not aligned
with the text in the window.
There seem to be two solutions to this: (1) let ruler mode set the
fringe to an convenient width, and (2) use a character with the exact
same width as the fringe in the mode line. The first options seems
too intrusive, so I'd go for the second. If memory serves me, you can
make a space of any length using the display text property.
Lute.
Re: ruler-mode is broken, David PONCE, 2003/10/08
Re: ruler-mode is broken, David PONCE, 2003/10/08
- Re: ruler-mode is broken,
Lute Kamstra <=
- Re: ruler-mode is broken, Miles Bader, 2003/10/10
- Re: ruler-mode is broken, Lute Kamstra, 2003/10/10
- Re: ruler-mode is broken, Kim F. Storm, 2003/10/14
- Re: ruler-mode is broken, Miles Bader, 2003/10/14
- Re: ruler-mode is broken, Kim F. Storm, 2003/10/14
- Re: ruler-mode is broken, Miles Bader, 2003/10/14
- Re: ruler-mode is broken, Kim F. Storm, 2003/10/15
- Re: ruler-mode is broken, Miles Bader, 2003/10/15
- Re: ruler-mode is broken, Kim F. Storm, 2003/10/15
- Re: ruler-mode is broken, Miles Bader, 2003/10/15