Subject: 23.0.60; mouse-set-point fails with word wrapping enabled

From: Stephen Berman <[email-masked]>
Date: Fri, 04 Jul 2008 22:41:20 +0200

I have found that with word-wrap enabled, at some point in the buffer of
a wrapped text setting point by clicking mouse-1 fails, with the result
that point is set not where I click but at the same column exactly one
visible line below (i.e., also within a wrapped line).  I haven't
managed to find a general recipe for reproducing this, but I do have a
sample file which shows the problem.  Start Emacs with -Q, visit the
attached file and set word-wrap to t.  I can set point by clicking
mouse-1 on any position in the buffer -- until the first `x' after the
line wrapping in the line that begins with `13.30': clicking mouse-1 on
this position set points on the space immediately below.  Likewise for
every position following this one, till the end of the text.  Now scroll
the text up one line at a time, until the line beginning with `15.05' is
at the top of the window.  Now setting point by clicking mouse-1 works
again as expected.  But scrolling down one line, so that the line
beginning with `13.30' is at the top of the window, restores the
previous aberrant behavior.

A probably related observation is the following.  If I click mouse-1 in
the space between the last character of a wrapped line and the right
fringe, starting on the second space after the last character, then
point gets set on the subsequent wrapped portion, and advancing the
clicked position towards the fringe advances the cursor display on the
wrapped portion.  If I click on the right fringe, then point gets set
(back) to the first character after the wrapping.  But this behavior
changes at the line that begins with `13.30': clicking in the spaces has
the effect described, but clicking on the right fringe does not reset
point.  But in the line beginning with `20.00', clicking in the space
before the first wrapped portion advances the cursor in the second
wrapped portion below it, and clicking in the right fringe before the
first wrapped portion does reset point to the beginning of the second
wrapped portion.

In GNU Emacs 23.0.60.1 (i686-pc-linux-gnu, GTK+ Version 2.12.0)
 of 2008-07-01 on escher
Windowing system distributor `The X.Org Foundation', version 11.0.70200000
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=local
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t