unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stephen Berman <stephen.berman@gmx.net>
To: Andrea Rossetti <andrea.rossetti@gmail.com>
Cc: 17788@debbugs.gnu.org
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	[thread overview]
Message-ID: <87mwddjh1w.fsf@rosalinde.fritz.box> (raw)
In-Reply-To: <84zjhdixgw.fsf@gmail.com> (Andrea Rossetti's message of "Mon, 16 Jun 2014 01:06:55 +0200")

On Mon, 16 Jun 2014 01:06:55 +0200 Andrea Rossetti <andrea.rossetti@gmail.com> 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





  parent reply	other threads:[~2014-06-16 10:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-15 19:17 bug#17788: 24.3; ruler-mode: column indicators "hop" left if you drag them diagonally Andrea Rossetti
2014-06-15 22:09 ` Stephen Berman
2014-06-15 23:06   ` Andrea Rossetti
2014-06-15 23:14     ` Andrea Rossetti
2014-06-16  7:11     ` martin rudalics
2014-06-16 20:26       ` Andrea Rossetti
2014-06-16 21:34         ` Stephen Berman
2014-06-17 23:50         ` Andrea Rossetti
2014-06-16 10:16     ` Stephen Berman [this message]
2014-06-16 19:03       ` Andrea Rossetti
2014-06-16  7:11 ` martin rudalics
2020-09-09 11:47 ` Lars Ingebrigtsen
2022-02-22 14:23   ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mwddjh1w.fsf@rosalinde.fritz.box \
    --to=stephen.berman@gmx.net \
    --cc=17788@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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).