GNU bug report logs - #17768
24.3; problem with two ruler-mode windows

Previous Next

Package: emacs;

Reported by: Andrea Rossetti <andrea.rossetti <at> gmail.com>

Date: Thu, 12 Jun 2014 23:59:02 UTC

Severity: normal

Found in version 24.3

Done: Andrea Rossetti <andrea.rossetti <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Andrea Rossetti <andrea.rossetti <at> gmail.com>, 17768 <at> debbugs.gnu.org
Subject: bug#17768: 24.3; problem with two ruler-mode windows
Date: Fri, 13 Jun 2014 09:29:23 +0200
>    The left margin mouse adjustment seems to work properly if
> I change the elisp code of file ruler-mode.el, function
> ruler-mode-mouse-set-left-margin:
>
> from
>
> (setq col (- (car (posn-col-row start)) (car (window-edges))
>                       (scroll-bar-columns 'left))

The value returned by `posn-col-row' is relative to the edges of the
window where the event occurred.  It is called from `posn-x-y' whose
info entry states that "These coordinates are relative to the window
given by `posn-window'".  However any such information is left out from
doc-string and info on `posn-col-row'.  This might have confused the
author of ruler-mode and certainly confuses me now.

Could someone look into the doc-string and info entry of `posn-col-row'
and maybe improve them to avoid such confusion.  For example:

     This function returns a cons cell `(COL .  ROW)', containing the
     estimated column and row corresponding to buffer position

... what does "buffer position" mean here ...

     POSITION.  The return value is given in units of the frame's
     default character width and height, as computed from the X and Y
     values corresponding to POSITION.  (So, if the actual characters
     have non-default sizes, the actual row and column may differ from
     these computed values.)

     Note that ROW is counted from the top of the text area.  If the
     window

... which window is meant here ...

     possesses a header line (*note Header Lines::), it is _not_
     counted as the first line.

... this sounds obvious but what ´does "not counting" stand for?

But maybe there's nothing confusing here and it's only me to
misinterpret things.

> into
>
> (setq col (- (car (posn-col-row start))
>                       (scroll-bar-columns 'left))
> ...

This sounds like the correct solution to me.  Could you try testing it
with three and more side-by-side windows and all sorts of clicks ruler
mode can handle and possibly post a corresponding patch?

Many thanks for the report, martin





This bug report was last modified 11 years and 36 days ago.

Previous Next


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