From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#17768: 24.3; problem with two ruler-mode windows Date: Fri, 13 Jun 2014 09:29:23 +0200 Message-ID: <539AA853.3050202@gmx.at> References: <84sin9n0kf.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1402644635 23129 80.91.229.3 (13 Jun 2014 07:30:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 13 Jun 2014 07:30:35 +0000 (UTC) To: Andrea Rossetti , 17768@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 13 09:30:27 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WvLwO-0000Jl-AE for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Jun 2014 09:30:24 +0200 Original-Received: from localhost ([::1]:57217 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvLwK-0003to-QO for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Jun 2014 03:30:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50814) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvLwB-0003rz-64 for bug-gnu-emacs@gnu.org; Fri, 13 Jun 2014 03:30:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WvLw3-0000cb-M9 for bug-gnu-emacs@gnu.org; Fri, 13 Jun 2014 03:30:11 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54973) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvLw3-0000bi-JS for bug-gnu-emacs@gnu.org; Fri, 13 Jun 2014 03:30:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WvLw2-0005H4-TN for bug-gnu-emacs@gnu.org; Fri, 13 Jun 2014 03:30:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Jun 2014 07:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17768 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17768-submit@debbugs.gnu.org id=B17768.140264458420213 (code B ref 17768); Fri, 13 Jun 2014 07:30:02 +0000 Original-Received: (at 17768) by debbugs.gnu.org; 13 Jun 2014 07:29:44 +0000 Original-Received: from localhost ([127.0.0.1]:46123 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WvLvj-0005Fx-OG for submit@debbugs.gnu.org; Fri, 13 Jun 2014 03:29:44 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:62041) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WvLvg-0005Fe-GK for 17768@debbugs.gnu.org; Fri, 13 Jun 2014 03:29:41 -0400 Original-Received: from [93.82.72.67] ([93.82.72.67]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0LsD9n-1Wl4gE2lTz-013uE1; Fri, 13 Jun 2014 09:29:33 +0200 In-Reply-To: <84sin9n0kf.fsf@gmail.com> X-Provags-ID: V03:K0:IhowbjDCO8SiP8DB38OswXFBaMlHV8bbaRNoZoAtKCQKsfOE2/V lE226s/DOHg4WMPOU/ZDvNINzgJBQzkwZHBWb39rVtNmcBy4Gp5iIzScguTkZ3s3ZuRmv78 JmJ+qdq4nUQ2fxbuVtYrUIAiR54V5kZtkCZsR/RwNTljTBNvLF67rSzkMiYTs2PARNsZr2q AiLdNpcQ/Dk1n3AG1eVig== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:90310 Archived-At: > 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 =2E.. 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 =2E.. which window is meant here ... possesses a header line (*note Header Lines::), it is _not_ counted as the first line. =2E.. this sounds obvious but what =C2=B4does "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