From: martin rudalics <rudalics@gmx.at>
To: Andrea Rossetti <andrea.rossetti@gmail.com>, 17768@debbugs.gnu.org
Subject: bug#17768: 24.3; problem with two ruler-mode windows
Date: Fri, 13 Jun 2014 09:29:23 +0200 [thread overview]
Message-ID: <539AA853.3050202@gmx.at> (raw)
In-Reply-To: <84sin9n0kf.fsf@gmail.com>
> 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
next prev parent reply other threads:[~2014-06-13 7:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-12 23:57 bug#17768: 24.3; problem with two ruler-mode windows Andrea Rossetti
2014-06-13 7:29 ` martin rudalics [this message]
2014-06-14 16:45 ` Eli Zaretskii
2014-06-15 15:09 ` martin rudalics
2014-06-15 16:17 ` Eli Zaretskii
2014-06-16 21:05 ` Stefan Monnier
2014-06-14 17:22 ` Andrea Rossetti
2014-06-15 15:09 ` martin rudalics
2014-06-15 18:06 ` Andrea Rossetti
2014-06-15 23:22 ` Andrea Rossetti
2014-06-16 7:10 ` martin rudalics
2014-06-16 7:10 ` martin rudalics
2014-06-16 8:45 ` bug#17768: Andrea Rossetti
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=539AA853.3050202@gmx.at \
--to=rudalics@gmx.at \
--cc=17768@debbugs.gnu.org \
--cc=andrea.rossetti@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.