GNU bug report logs - #58804
Inconsistency between ruler-mode, fill-column and whitespace-mode

Previous Next

Package: emacs;

Reported by: Heime <heimeborgia <at> protonmail.com>

Date: Wed, 26 Oct 2022 20:24:02 UTC

Severity: normal

To reply to this bug, email your comments to 58804 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#58804; Package emacs. (Wed, 26 Oct 2022 20:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Heime <heimeborgia <at> protonmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 26 Oct 2022 20:24:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Heime <heimeborgia <at> protonmail.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: Inconsistency between ruler-mode, fill-column and whitespace-mode
Date: Wed, 26 Oct 2022 20:22:37 +0000
Having set both fill-column and whitespace-line-column to 72, I noticed the following.

ruler-mode has the left end marker at column 72, but it should be at column 71 because
column numbers start from 0.  Here an improvement would be appreciated.  That is, having
the ability to show a ruler variant that starts from value 1.  When one uses a block cursor,
the ruler left marker would then mark exactly column 72.  The user will knew that if he inputs
the next character he would have reached the line limit and the ruler left marker would coincide
with that position.








Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58804; Package emacs. (Thu, 27 Oct 2022 05:39:02 GMT) Full text and rfc822 format available.

Message #8 received at 58804 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Heime <heimeborgia <at> protonmail.com>
Cc: 58804 <at> debbugs.gnu.org
Subject: Re: bug#58804: Inconsistency between ruler-mode,
 fill-column and whitespace-mode
Date: Thu, 27 Oct 2022 08:38:22 +0300
> Date: Wed, 26 Oct 2022 20:22:37 +0000
> From:  Heime via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> Having set both fill-column and whitespace-line-column to 72, I noticed the following.
> 
> ruler-mode has the left end marker at column 72

Do you mean "right end marker"?  I see no end marker at the left part
of the display here, only the ¶ marker at the right.

> but it should be at column 71 because column numbers start from 0.

I don't follow: ruler-mode counts columns starting from zero, as
everything in Emacs.  If you move point to a column other than the
leftmost one, you will see "0" at the left edge of the ruler display.
So having the marker at column 72 is exactly right.

Are you seeing this in "emacs -Q"?

> Here an improvement would be appreciated.  That is, having
> the ability to show a ruler variant that starts from value 1.  When one uses a block cursor,
> the ruler left marker would then mark exactly column 72.  The user will knew that if he inputs
> the next character he would have reached the line limit and the ruler left marker would coincide
> with that position.

It sounds like you want column numbers that start from 1, not zero?
That should be a session-wide mode (if we want such an enhancement),
since otherwise there could be confusion.  We currently support
one-based column only in the mode-line display under
column-number-mode.  Maybe you have turned that on, which is why you
think there's a mismatch in ruler-mode?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58804; Package emacs. (Thu, 27 Oct 2022 06:16:01 GMT) Full text and rfc822 format available.

Message #11 received at 58804 <at> debbugs.gnu.org (full text, mbox):

From: Heime <heimeborgia <at> protonmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 58804 <at> debbugs.gnu.org
Subject: Re: bug#58804: Inconsistency between ruler-mode,
 fill-column and whitespace-mode
Date: Thu, 27 Oct 2022 06:15:23 +0000
------- Original Message -------
On Thursday, October 27th, 2022 at 5:38 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:


> > Date: Wed, 26 Oct 2022 20:22:37 +0000
> > From: Heime via "Bug reports for GNU Emacs,
> > the Swiss army knife of text editors" bug-gnu-emacs <at> gnu.org
> > 
> > Having set both fill-column and whitespace-line-column to 72, I noticed the following.
> > 
> > ruler-mode has the left end marker at column 72
> 
> 
> Do you mean "right end marker"? I see no end marker at the left part
> of the display here, only the ¶ marker at the right.

Right End Marker actually.
 
> > but it should be at column 71 because column numbers start from 0.
> 
> 
> I don't follow: ruler-mode counts columns starting from zero, as
> everything in Emacs. If you move point to a column other than the
> leftmost one, you will see "0" at the left edge of the ruler display.
> So having the marker at column 72 is exactly right.

When one is using a box cursor, it is very confusing.  If one has 
whitespace-style with 'lines-char, the column with the Right Ruler Marker 
gets highlighted.  When users have a box cursor, it is convenient that
the Right Ruler Marker is placed on the last column where it is acceptable
to introduce a last character without exceeding line-column.  Don't have
users always having to remember to add or subtract 1 in their head, but 
have use visual reference for the last valid column.

Perhaps, you could introduce a new marker for that, and decide which one 
to use?  You could have an option to select the starting number, 0 or 1.

Or you might have something better in mind that would work well visually.
Particularly for those of us using box cursor.

> Are you seeing this in "emacs -Q"?
> 
> > Here an improvement would be appreciated. That is, having
> > the ability to show a ruler variant that starts from value 1. When one uses a block cursor,
> > the ruler left marker would then mark exactly column 72. The user will knew that if he inputs
> > the next character he would have reached the line limit and the ruler left marker would coincide
> > with that position.
 
> It sounds like you want column numbers that start from 1, not zero?
> That should be a session-wide mode (if we want such an enhancement),
> since otherwise there could be confusion. We currently support
> one-based column only in the mode-line display under
> column-number-mode. Maybe you have turned that on, which is why you
> think there's a mismatch in ruler-mode?

Yes, to start from 1, not zero - when one uses a "box cursor".  And yes,
I have both ruler-mode, whitespace-mode, and column-number-mode, all three
enabled.  I would appreciate if I could make the necessary customisations
for all three to match.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58804; Package emacs. (Thu, 27 Oct 2022 06:36:01 GMT) Full text and rfc822 format available.

Message #14 received at 58804 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Heime <heimeborgia <at> protonmail.com>
Cc: 58804 <at> debbugs.gnu.org
Subject: Re: bug#58804: Inconsistency between ruler-mode,
 fill-column and whitespace-mode
Date: Thu, 27 Oct 2022 09:34:39 +0300
> Date: Thu, 27 Oct 2022 06:15:23 +0000
> From: Heime <heimeborgia <at> protonmail.com>
> Cc: 58804 <at> debbugs.gnu.org
> 
> > > but it should be at column 71 because column numbers start from 0.
> > 
> > 
> > I don't follow: ruler-mode counts columns starting from zero, as
> > everything in Emacs. If you move point to a column other than the
> > leftmost one, you will see "0" at the left edge of the ruler display.
> > So having the marker at column 72 is exactly right.
> 
> When one is using a box cursor, it is very confusing.  If one has 
> whitespace-style with 'lines-char, the column with the Right Ruler Marker 
> gets highlighted.

So I guess this is a bug in whitespace-mode?  Its doc string says:

   lines-char           lines which have columns beyond
                        ‘whitespace-line-column’ are highlighted via
                        putting a face on the first character that goes
                        beyond the ‘whitespace-line-column’ column.

So highlighting the character whose column is whitespace-line-column,
not whitespace-line-column+1, seems to be a bug?

> When users have a box cursor, it is convenient that
> the Right Ruler Marker is placed on the last column where it is acceptable
> to introduce a last character without exceeding line-column.

That's what happens now (and box cursor is the default cursor style).
The problem seems to be in whitespace-mode, not in ruler-mode.

> > It sounds like you want column numbers that start from 1, not zero?
> > That should be a session-wide mode (if we want such an enhancement),
> > since otherwise there could be confusion. We currently support
> > one-based column only in the mode-line display under
> > column-number-mode. Maybe you have turned that on, which is why you
> > think there's a mismatch in ruler-mode?
> 
> Yes, to start from 1, not zero - when one uses a "box cursor".

I don't think I understand the relevance of the cursor-type to this
issue.

> And yes, I have both ruler-mode, whitespace-mode, and
> column-number-mode, all three enabled.  I would appreciate if I
> could make the necessary customisations for all three to match.

That would need some new minor mode or user option, I guess, and
suitable changes in several places to follow the optional behavior.
Patches welcome.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58804; Package emacs. (Thu, 27 Oct 2022 07:11:01 GMT) Full text and rfc822 format available.

Message #17 received at 58804 <at> debbugs.gnu.org (full text, mbox):

From: Heime <heimeborgia <at> protonmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 58804 <at> debbugs.gnu.org
Subject: Re: bug#58804: Inconsistency between ruler-mode,
 fill-column and whitespace-mode
Date: Thu, 27 Oct 2022 07:10:30 +0000
------- Original Message -------
On Thursday, October 27th, 2022 at 6:34 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:


> > Date: Thu, 27 Oct 2022 06:15:23 +0000
> > From: Heime heimeborgia <at> protonmail.com
> > Cc: 58804 <at> debbugs.gnu.org
> > 
> > > > but it should be at column 71 because column numbers start from 0.
> > > 
> > > I don't follow: ruler-mode counts columns starting from zero, as
> > > everything in Emacs. If you move point to a column other than the
> > > leftmost one, you will see "0" at the left edge of the ruler display.
> > > So having the marker at column 72 is exactly right.
> > 
> > When one is using a box cursor, it is very confusing. If one has
> > whitespace-style with 'lines-char, the column with the Right Ruler Marker
> > gets highlighted.
> 
> So I guess this is a bug in whitespace-mode? Its doc string says:

Looking carefully, all are correct.  But quite confusing when using them
together.  Particularly for some of us who like to work in an intuitive 
and visual manner. 
 
What would help is for the user to be able to adapt numbering system
to their working style.  Perhaps leave everything as is by default,
but allow some user modifications to ruler-mode and column-number-mode.
"whitespace-mode" works well as it is.

> lines-char lines which have columns beyond
> ‘whitespace-line-column’ are highlighted via
> putting a face on the first character that goes
> beyond the ‘whitespace-line-column’ column.
> 
> So highlighting the character whose column is whitespace-line-column,
> not whitespace-line-column+1, seems to be a bug?
> 
> > When users have a box cursor, it is convenient that
> > the Right Ruler Marker is placed on the last column where it is acceptable
> > to introduce a last character without exceeding line-column.
> 
> 
> That's what happens now (and box cursor is the default cursor style).
> The problem seems to be in whitespace-mode, not in ruler-mode.
> 
> > > It sounds like you want column numbers that start from 1, not zero?
> > > That should be a session-wide mode (if we want such an enhancement),
> > > since otherwise there could be confusion. We currently support
> > > one-based column only in the mode-line display under
> > > column-number-mode. Maybe you have turned that on, which is why you
> > > think there's a mismatch in ruler-mode?
> > 
> > Yes, to start from 1, not zero - when one uses a "box cursor".
> 
> I don't think I understand the relevance of the cursor-type to this
> issue.

The cursor-type is the source of the confusion.  With a bar, one can easily see
that it is the beginning of the character beyond fill-column, which also corresponds
to column-number-mode.  But things get non-intuitive when using a box cursor.
 
> > And yes, I have both ruler-mode, whitespace-mode, and
> > column-number-mode, all three enabled. I would appreciate if I
> > could make the necessary customisations for all three to match.
> 
> 
> That would need some new minor mode or user option, I guess, and
> suitable changes in several places to follow the optional behavior.
> Patches welcome.

An option would be easier for users.




This bug report was last modified 1 year and 153 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.