unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Ivan Andrus <darthandrus@gmail.com>
Cc: 17244-done@debbugs.gnu.org
Subject: bug#17244: 24.3.90; `line-move-visual' errors when moving across wrapped lines with an	overlay property of 'display
Date: Sat, 12 Apr 2014 14:31:20 +0300	[thread overview]
Message-ID: <834n1yu6lz.fsf@gnu.org> (raw)
In-Reply-To: <CA+R1Coy0+y0+uPGDaVZmnc628K1+gEkvr2iD9=vRKt_5z3kmDQ@mail.gmail.com>

> Date: Fri, 11 Apr 2014 15:28:55 -0600
> From: Ivan Andrus <darthandrus@gmail.com>
> 
> Starting from Emacs -Q, create a buffer with the following contents.
> Notice that the first two (2) lines are blank, and the next is one long
> line (in case it gets broken by email)
> 
> #### buffer start:
> 
> 
> ;; I think this needs to be really long here.  Why?  I don't really know,
> but a guess.  I think this needs to be really long here.  Why?  I don't
> really know, but a guess.  I think this needs to be really long here.  Why?
>  I don't really know, but a guess.  I think this needs to be really long
> here.  Why?  I don't really know, but a guess.  I think this needs to be
> really long here.  Why?  I don't really know, but a guess.  I think this
> needs to be really long here.  Why?  I don't really know, but a guess.
> (let ((ov (make-overlay 3 515)))
>  (overlay-put ov 'display "hi\n"))
> (line-move-visual -5)
> 
> 1. Make sure the window is skinny enough that the comment line wraps.
> 2. Evaluate the first form, creating an overlay.
> 3. Evaluate the second form.  It is important that point be at the end
>    of the "line-move-visual" line.
> 4. You get a warning about beginning-of-buffer, when it clearly did not
>    reach the beginning-of-buffer.
> 
> As near as I can tell, the incorrect error message is because it doesn't
> move as far at it thinks it should (the real bug), and it assumes the
> reason it didn't is because it made it to the beginning (or end) of the
> buffer.

Thanks for the report.  I fixed this in revision 116947 on the
emacs-24 branch.

<rant>
To tell the truth, Lisp code which covers large portions of buffer
text with much shorter display strings that include newlines deserves
to be broken.  The current Emacs display engine was never designed to
handle situations where the displayed text is so starkly different
from buffer text, so the result of trying to fix "bugs" such as this
one is a never-ending series of band-aids, one upon the other, which
make the code utterly incomprehensible and unmaintainable.

So I'm this close to refusing to fix such "bugs", and instead asking
the authors of such Lisp to either find more benign ways of expressing
what they need, or work around the limitations of the display engine
in their own Lisp.
</rant>





  reply	other threads:[~2014-04-12 11:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-11 21:28 bug#17244: 24.3.90; `line-move-visual' errors when moving across wrapped lines with an overlay property of 'display Ivan Andrus
2014-04-12 11:31 ` Eli Zaretskii [this message]
2014-04-14  1:43   ` Ivan Andrus
2014-04-14  8:11     ` Eli Zaretskii
2014-04-14 16:12       ` Ivan Andrus

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=834n1yu6lz.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=17244-done@debbugs.gnu.org \
    --cc=darthandrus@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).