Subject: bug#24336: 25.1; Can't place point with mouse in long lines

From: Nick Helm <[email-masked]>
Date: Tue, 30 Aug 2016 17:13:01 +1200

When visual-line-mode is active, I cannot use the mouse to correctly
place point if the buffer contains a line with a lot of spaces.

To reproduce:

Emacs -Q
M-x visual-line-mode
type some text, eg "this is some text"
C-u 300 <space> (or enough spaces to span more than one window width)
type some more text, eg "this is more text"
Try to place point in the line using the mouse or trackpad.

Point moves, but to the wrong location. The problem seems to also occur
in other buffer locations below the long line, provided the long line is
visible in the current window. That is, if the buffer has other lines
(long or otherwise) with normal spacing, I can't place point correctly
there either.

Turn off visual-line-mode and the problem goes away. Turn it back on and
it recurs. Delete the line or extend the window width so the spaces
occur on a single visual line and the problem goes away.

I can reproduce the problem on 24.5, 25.1RC1, and RC2. I'm using the 
NS build.

In GNU Emacs 25.1.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version 10.9.5 (Build 13F1911))
 of 2016-08-22 built on builder10-9.porkrind.org
Windowing system distributor 'Apple', version 10.3.1404
Configured using:
 'configure --with-ns '--enable-locallisppath=/Library/Application
 Support/Emacs/${version}/site-lisp:/Library/Application
 Support/Emacs/site-lisp''

Configured features:
NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS

Important settings:
  value of $LANG: en_NZ.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Text

Minor modes in effect:
  savehist-mode: t
  ido-ubiquitous-mode: t
  ido-everywhere: t
  global-eldoc-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  visual-line-mode: t
  transient-mark-mode: t

Recent messages:
Loading /Users/nick/.emacs.d/config/mc/mc-run-once.list...done
Reusing Dired buffers is now ON
For information about GNU Emacs and the GNU system, type C-h C-a.
user-error: The mark is not set now, so there is no region

Load-path shadows:
/Users/nick/.emacs.d/lisp/org/ox hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ox
/Users/nick/.emacs.d/lisp/org/ox-texinfo hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ox-texinfo
/Users/nick/.emacs.d/lisp/org/ox-publish hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ox-publish
/Users/nick/.emacs.d/lisp/org/ox-org hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ox-org
/Users/nick/.emacs.d/lisp/org/ox-odt hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ox-odt
/Users/nick/.emacs.d/lisp/org/ox-md hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ox-md
/Users/nick/.emacs.d/lisp/org/ox-man hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ox-man
/Users/nick/.emacs.d/lisp/org/ox-latex hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ox-latex
/Users/nick/.emacs.d/lisp/org/ox-icalendar hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ox-icalendar
/Users/nick/.emacs.d/lisp/org/ox-html hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ox-html
/Users/nick/.emacs.d/lisp/org/ox-beamer hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ox-beamer
/Users/nick/.emacs.d/lisp/org/ox-ascii hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ox-ascii
/Users/nick/.emacs.d/lisp/org/org hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org
/Users/nick/.emacs.d/lisp/org/org-w3m hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-w3m
/Users/nick/.emacs.d/lisp/org/org-version hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-version
/Users/nick/.emacs.d/lisp/org/org-timer hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-timer
/Users/nick/.emacs.d/lisp/org/org-table hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-table
/Users/nick/.emacs.d/lisp/org/org-src hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-src
/Users/nick/.emacs.d/lisp/org/org-rmail hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-rmail
/Users/nick/.emacs.d/lisp/org/org-protocol hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-protocol
/Users/nick/.emacs.d/lisp/org/org-plot hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-plot
/Users/nick/.emacs.d/lisp/org/org-pcomplete hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-pcomplete
/Users/nick/.emacs.d/lisp/org/org-mouse hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-mouse
/Users/nick/.emacs.d/lisp/org/org-mobile hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-mobile
/Users/nick/.emacs.d/lisp/org/org-mhe hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-mhe
/Users/nick/.emacs.d/lisp/org/org-macs hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-macs
/Users/nick/.emacs.d/lisp/org/org-macro hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-macro
/Users/nick/.emacs.d/lisp/org/org-loaddefs hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-loaddefs
/Users/nick/.emacs.d/lisp/org/org-list hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-list
/Users/nick/.emacs.d/lisp/org/org-irc hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-irc
/Users/nick/.emacs.d/lisp/org/org-install hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-install
/Users/nick/.emacs.d/lisp/org/org-inlinetask hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-inlinetask
/Users/nick/.emacs.d/lisp/org/org-info hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-info
/Users/nick/.emacs.d/lisp/org/org-indent hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-indent
/Users/nick/.emacs.d/lisp/org/org-id hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-id
/Users/nick/.emacs.d/lisp/org/org-habit hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-habit
/Users/nick/.emacs.d/lisp/org/org-gnus hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-gnus
/Users/nick/.emacs.d/lisp/org/org-footnote hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-footnote
/Users/nick/.emacs.d/lisp/org/org-feed hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-feed
/Users/nick/.emacs.d/lisp/org/org-faces hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-faces
/Users/nick/.emacs.d/lisp/org/org-eshell hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-eshell
/Users/nick/.emacs.d/lisp/org/org-entities hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-entities
/Users/nick/.emacs.d/lisp/org/org-element hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-element
/Users/nick/.emacs.d/lisp/org/org-docview hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-docview
/Users/nick/.emacs.d/lisp/org/org-datetree hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-datetree
/Users/nick/.emacs.d/lisp/org/org-ctags hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-ctags
/Users/nick/.emacs.d/lisp/org/org-crypt hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-crypt
/Users/nick/.emacs.d/lisp/org/org-compat hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-compat
/Users/nick/.emacs.d/lisp/org/org-colview hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-colview
/Users/nick/.emacs.d/lisp/org/org-clock hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-clock
/Users/nick/.emacs.d/lisp/org/org-capture hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-capture
/Users/nick/.emacs.d/lisp/org/org-bibtex hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-bibtex
/Users/nick/.emacs.d/lisp/org/org-bbdb hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-bbdb
/Users/nick/.emacs.d/lisp/org/org-attach hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-attach
/Users/nick/.emacs.d/lisp/org/org-archive hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-archive
/Users/nick/.emacs.d/lisp/org/org-agenda hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/org-agenda
/Users/nick/.emacs.d/lisp/org/ob hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob
/Users/nick/.emacs.d/lisp/org/ob-tangle hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-tangle
/Users/nick/.emacs.d/lisp/org/ob-table hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-table
/Users/nick/.emacs.d/lisp/org/ob-sqlite hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-sqlite
/Users/nick/.emacs.d/lisp/org/ob-sql hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-sql
/Users/nick/.emacs.d/lisp/org/ob-shen hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-shen
/Users/nick/.emacs.d/lisp/org/ob-screen hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-screen
/Users/nick/.emacs.d/lisp/org/ob-scheme hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-scheme
/Users/nick/.emacs.d/lisp/org/ob-scala hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-scala
/Users/nick/.emacs.d/lisp/org/ob-sass hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-sass
/Users/nick/.emacs.d/lisp/org/ob-ruby hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-ruby
/Users/nick/.emacs.d/lisp/org/ob-ref hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-ref
/Users/nick/.emacs.d/lisp/org/ob-R hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-R
/Users/nick/.emacs.d/lisp/org/ob-python hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-python
/Users/nick/.emacs.d/lisp/org/ob-plantuml hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-plantuml
/Users/nick/.emacs.d/lisp/org/ob-picolisp hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-picolisp
/Users/nick/.emacs.d/lisp/org/ob-perl hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-perl
/Users/nick/.emacs.d/lisp/org/ob-org hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-org
/Users/nick/.emacs.d/lisp/org/ob-octave hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-octave
/Users/nick/.emacs.d/lisp/org/ob-ocaml hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-ocaml
/Users/nick/.emacs.d/lisp/org/ob-mscgen hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-mscgen
/Users/nick/.emacs.d/lisp/org/ob-maxima hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-maxima
/Users/nick/.emacs.d/lisp/org/ob-matlab hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-matlab
/Users/nick/.emacs.d/lisp/org/ob-makefile hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-makefile
/Users/nick/.emacs.d/lisp/org/ob-lob hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-lob
/Users/nick/.emacs.d/lisp/org/ob-lisp hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-lisp
/Users/nick/.emacs.d/lisp/org/ob-lilypond hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-lilypond
/Users/nick/.emacs.d/lisp/org/ob-ledger hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-ledger
/Users/nick/.emacs.d/lisp/org/ob-latex hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-latex
/Users/nick/.emacs.d/lisp/org/ob-keys hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-keys
/Users/nick/.emacs.d/lisp/org/ob-js hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-js
/Users/nick/.emacs.d/lisp/org/ob-java hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-java
/Users/nick/.emacs.d/lisp/org/ob-io hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-io
/Users/nick/.emacs.d/lisp/org/ob-haskell hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-haskell
/Users/nick/.emacs.d/lisp/org/ob-gnuplot hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-gnuplot
/Users/nick/.emacs.d/lisp/org/ob-fortran hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-fortran
/Users/nick/.emacs.d/lisp/org/ob-exp hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-exp
/Users/nick/.emacs.d/lisp/org/ob-eval hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-eval
/Users/nick/.emacs.d/lisp/org/ob-emacs-lisp hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-emacs-lisp
/Users/nick/.emacs.d/lisp/org/ob-dot hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-dot
/Users/nick/.emacs.d/lisp/org/ob-ditaa hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-ditaa
/Users/nick/.emacs.d/lisp/org/ob-css hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-css
/Users/nick/.emacs.d/lisp/org/ob-core hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-core
/Users/nick/.emacs.d/lisp/org/ob-comint hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-comint
/Users/nick/.emacs.d/lisp/org/ob-clojure hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-clojure
/Users/nick/.emacs.d/lisp/org/ob-calc hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-calc
/Users/nick/.emacs.d/lisp/org/ob-C hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-C
/Users/nick/.emacs.d/lisp/org/ob-awk hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-awk
/Users/nick/.emacs.d/lisp/org/ob-asymptote hides /Users/nick/Desktop/EmacsRC2.app/Contents/Resources/lisp/org/ob-asymptote

Features:
(shadow emacsbug em-term term disp-table ehelp esh-opt esh-ext esh-util
mu4e mu4e-speedbar speedbar sb-image ezimage dframe mu4e-main
mu4e-context mu4e-view cal-menu calendar cal-loaddefs epa derived
browse-url comint ansi-color ring mu4e-headers mu4e-compose mu4e-draft
mu4e-actions rfc2368 smtpmail auth-source eieio eieio-core sendmail
mu4e-mark mu4e-message html2text mu4e-proc mu4e-utils doc-view subr-x
jka-compr image-mode mu4e-lists mu4e-vars message cl-macs rfc822 mml
mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies
mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mm-util help-fns
mail-prsvr mailabbrev mail-utils gmm-utils mailheader hl-line cl
mu4e-meta dired+ image-dired format-spec image-file dired-x dired-aux
dired savehist smex ido-ubiquitous cl-seq ido-completing-read+ cus-edit
cus-start cus-load wid-edit ido seq byte-opt gv bytecomp byte-compile
cl-extra help-mode cconv multiple-cursors mc-hide-unmatched-lines-mode
mc-separate-operations rectangular-region-mode mc-mark-pop mc-mark-more
mc-cycle-cursors mc-edit-lines multiple-cursors-core advice rect
nh-posmark nh-mac-dict markdown-mode thingatpt noutline outline
easy-mmode easymenu iso-transl nh-financial-tools nh-editing-tools
edmacro kmacro cl-loaddefs pcase cl-lib flyspell ispell linum
kemp_light-theme time-date mule-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel ns-win ucs-normalize
term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
kqueue cocoa ns multi-tty make-network-process emacs)

Memory information:
((conses 16 306968 10596)
 (symbols 48 29608 0)
 (miscs 40 55 103)
 (strings 32 48100 8785)
 (string-bytes 1 1359170)
 (vectors 16 43362)
 (vector-slots 8 749118 6566)
 (floats 8 256 36)
 (intervals 56 248 0)
 (buffers 976 17))