From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#17788: 24.3; ruler-mode: column indicators "hop" left if you drag them diagonally Date: Mon, 16 Jun 2014 12:16:11 +0200 Message-ID: <87mwddjh1w.fsf@rosalinde.fritz.box> References: <84ppiahtix.fsf@gmail.com> <87fvj5omej.fsf@rosalinde.fritz.box> <84zjhdixgw.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1402915849 20152 80.91.229.3 (16 Jun 2014 10:50:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 16 Jun 2014 10:50:49 +0000 (UTC) Cc: 17788@debbugs.gnu.org To: Andrea Rossetti Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 16 12:50:42 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 1WwUUm-0005z3-Rq for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 Jun 2014 12:50:37 +0200 Original-Received: from localhost ([::1]:42907 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwUUm-0006Z2-Dp for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 Jun 2014 06:50:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36747) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwTyQ-0001UL-OI for bug-gnu-emacs@gnu.org; Mon, 16 Jun 2014 06:17:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WwTyI-0001pi-Sg for bug-gnu-emacs@gnu.org; Mon, 16 Jun 2014 06:17:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57610) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwTyI-0001pc-QQ for bug-gnu-emacs@gnu.org; Mon, 16 Jun 2014 06:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WwTyH-00057l-Md for bug-gnu-emacs@gnu.org; Mon, 16 Jun 2014 06:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 16 Jun 2014 10:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17788 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17788-submit@debbugs.gnu.org id=B17788.140291380319666 (code B ref 17788); Mon, 16 Jun 2014 10:17:01 +0000 Original-Received: (at 17788) by debbugs.gnu.org; 16 Jun 2014 10:16:43 +0000 Original-Received: from localhost ([127.0.0.1]:48760 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WwTxy-000578-S5 for submit@debbugs.gnu.org; Mon, 16 Jun 2014 06:16:43 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:65033) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WwTxs-00056o-MD for 17788@debbugs.gnu.org; Mon, 16 Jun 2014 06:16:41 -0400 Original-Received: from rosalinde.fritz.box ([89.245.86.96]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0Lg1Tn-1WP80F0lnX-00pbt1; Mon, 16 Jun 2014 12:16:28 +0200 In-Reply-To: <84zjhdixgw.fsf@gmail.com> (Andrea Rossetti's message of "Mon, 16 Jun 2014 01:06:55 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.91 (gnu/linux) X-Provags-ID: V03:K0:IWnLQmjztBqWY/NXGldbBMGH4yDYhjHScbJ8SC8PQAdBmuPxfQ5 UMSmCxKilDWuu4LzC8Lzc4tROzxYdH4QjWssvK6ukW7rN7JD/SU+ZyW9Js7f0RVICNkKQWN n82dvaQ51yO30sO6CG0CNPotg8U6jhKhX78WRd/svI4APGnhWkzWNAKcXTsLWkamEgmQA6L JJvd7cZN7iCdN6nnKxiBA== 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:90429 Archived-At: On Mon, 16 Jun 2014 01:06:55 +0200 Andrea Rossetti wrote: > Thanks Stephen for having tested at your side. > >> (1) I see # jump whenever the mouse pointer is moved off the ruler while >> holding down mouse-2, regardless of which direction you drag in >> ... > > Yes, (1) is the same for me. > >> (2) If you don't set the left margin, I see # jump as follows: >> - If you drag from # straight down (due south), # jumps three >> columns to the left. >> - If you drag from # southeast by one character, # jumps two columns >> to the left. >> - If you drag from # southeast by two characters, # jumps one column >> to the left. >> - If you drag from # southeast by more than two characters, # does >> not jump to the left. >> - If you drag from # southwest, # slides (but doesn't jump) to >> whatever column you stop the drag on. Moreover, once you drag # >> southwest, you can slide # anywhere while holding mouse-2 with the >> mouse pointer in the text area, just like when it is on the rule. >> > > I can't replicate any of the cases in (2); I always get 1 column hop. > >> (3) If you set the left margin, the the number of columns jumped by >> dragging due south equals (margin width + 3), if I'm not mistaken. > > In my setup I see the indicator jumps left for (margin width + 1) > columns. I'm afraid some other window parameters may be involved, > for example: > > - if you have a leftside fringe (I have it) Me too (as well as right fringe). > - if you have a leftside scrollbar (I only have it rightside) I do indeed that the scroll bar on the left (it's also a non-toolkit scroll bar, FWIW). > - (maybe?) if your window manager sets thick window borders > (I have just 3-4 pixel borders) Do you mean X-window borders, i.e., Emacs frame borders? If so, I have one pixel wide borders. > I wrote a (quite rough) patch that seems to resolve all "hop" > problems on my installation. May I please ask if anyone has time > and patience to try the patch and report if it provides some benefit. With your patch, I still get a jump of # when I drag the mouse pointer down out of the ruler, but now only by two columns to the left, regardless of whether I set the left margin or not. > -(defsubst ruler-mode-window-col (n) > +(defsubst ruler-mode-window-col (start-or-end-event) > "Return a column number relative to the selected window. > -N is a column number relative to selected frame." > - (- n > - (car (window-edges)) > - (or (car (window-margins)) 0) > - (fringe-columns 'left) > +START-OR-END-EVENT is the start point or end point of a mouse > +click or mouse drag event. > + > +See also: `event-start', `event-end', `posn-col-row', `posn-area'. > +" > + (- (car (posn-col-row start-or-end-event)) > + (if (eq (posn-area start) 'header-line) ^^^^^ I guess this should be `start-or-end-event' (otherwise the byte compiler warns about a free variable). > + (+ (or (car (window-margins)) 0) (fringe-columns 'left)) > + 0) Steve Berman