Subject: Re: bug#17768: 24.3; problem with two ruler-mode windows

From: martin rudalics <[email-masked]>
Date: Sun, 15 Jun 2014 17:09:50 +0200

>    First patch applies the changes that we supposed could
 > solve the problem of the wrong offset.

Thanks.  I'll apply it as soon as I can build again here.

 >   I tested patch1 somewhat randomly, opening 4/5 windows horizontally,
 > 1/2 windows vertically, and did also some attempt splitting windows
 > in two frames. Played also a bit on the text-only Emacs (using MSYS shell).
 >
 >    Everything worked fine with patch1, except for an unexpected small
 > and non-blocking issue (let's call it "diagonal-drag" issue) that
 > can be reproduced as follows:
 >
 > - C-x 3 M-x ruler-mode (you should see two windows with ruler)
 > - click S-<mouse-1> on the ruler of the rightmost window, this will set
 >    a left margin, choose a width of around 10~20 chars
 > - drag "diagonally" a column, for example moving down-left the
 >    fill-column, until the cursor goes a few pixels below the ruler area

How do I drag a column?  What is "moving down-left"?  Can you explain in
terms of keystrokes or mouse clicks?

 > - you will see that the dragged column will "jump" innaturally to the
 >    left of around 10~20 chars
 >
 >    Tentative diagnosys: function `ruler-mode-window-col' returns a
 > different column value depending if you are inside or outside the
 > ruler area. The actual problem is probably inherited from `posn-col-row',
 > but I could not clarify any better.

It seems so (from reading the doc-string of `ruler-mode-window-col').
But I would like to reproduce the problem first.  Please advice.

 >    And finally: I noticed another independent bug ("text-scale issue"),
 > i.e. most ruler's mouse operation have wrong offset if you adjust
 > text scale (C-x C-+).

This should be definitively corrected (as well as other text scale
related issues happening, for example, when splitting windows).

 >    If anyone reading is interested to help, here's a proposed action plan:
 >
 > - may you please try to play with patch1, and give advice if it could be
 >    acceptable for a commit

I only need advice from Stefan whether to install it in the branch or on
trunk.

 > - I guess that patch2 is unacceptable (BTW it changes the definition of
 >    ruler-mode-window-col, I assumed that ruler-mode.el is the only
 >    program calling it) but it's the best I could squeeze out of my head...
 >    any help or constructive criticism is welcome :)

The premise of `ruler-mode-window-col' seems wrong so we have to do
something about it.

 > - be aware of the "text-scale" issue but don't test for it; it seems
 >    a totally independent issue so I'd rather send another bug report for it

Please do that.

Thanks, martin