all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan <monnier@iro.umontreal.ca>
Cc: 17744@debbugs.gnu.org
Subject: bug#17744: 24.3.91; Cursor drawn at EOL while it's at BOL
Date: Tue, 10 Jun 2014 19:37:46 +0300	[thread overview]
Message-ID: <83bnu02011.fsf@gnu.org> (raw)
In-Reply-To: <jwvvbs9xrz7.fsf@pastel.i-did-not-set--mail-host-address--so-tickle-me>

> From: Stefan <monnier@iro.umontreal.ca>
> Date: Tue, 10 Jun 2014 01:18:20 -0400
> 
> 
>    emacs -Q
> 
>    (progn (goto-char (point-min)) (forward-line 1)
>      (let ((ol (make-overlay (point) (point)))
>            (str "TOTO"))
>        (put-text-property 0 1 'cursor 1 str)
>        (overlay-put ol 'after-string str)))
> 
> Then do:
> 
>    M-<
>    C-n
> 
> Notice that the cursor is drawn at EOL whereas it should be drawn at BOL.

The patch below fixes this.  However, since this problem exists in
Emacs 24.3 as well, and so is not really a regression, I need your
permission to install on the release branch.

--- src/xdisp.c~0	2014-05-26 06:51:21 +0300
+++ src/xdisp.c	2014-06-10 18:37:35 +0300
@@ -14421,7 +14421,7 @@ set_cursor_from_row (struct window *w, s
 					      pos_after, 0);
 
 		if (prop_pos >= pos_before)
-		  bpos_max = prop_pos - 1;
+		  bpos_max = prop_pos;
 	      }
 	    if (INTEGERP (chprop))
 	      {
@@ -14495,7 +14495,7 @@ set_cursor_from_row (struct window *w, s
 					      pos_after, 0);
 
 		if (prop_pos >= pos_before)
-		  bpos_max = prop_pos - 1;
+		  bpos_max = prop_pos;
 	      }
 	    if (INTEGERP (chprop))
 	      {
@@ -14525,7 +14525,7 @@ set_cursor_from_row (struct window *w, s
      GLYPH_BEFORE and GLYPH_AFTER.  */
   if (!((row->reversed_p ? glyph > glyphs_end : glyph < glyphs_end)
 	&& BUFFERP (glyph->object) && glyph->charpos == pt_old)
-      && !(bpos_max < pt_old && pt_old <= bpos_covered))
+      && !(bpos_max <= pt_old && pt_old <= bpos_covered))
     {
       /* An empty line has a single glyph whose OBJECT is zero and
 	 whose CHARPOS is the position of a newline on that line.





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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-10  5:18 bug#17744: 24.3.91; Cursor drawn at EOL while it's at BOL Stefan
2014-06-10 16:37 ` Eli Zaretskii [this message]
2014-06-11 16:14   ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to=83bnu02011.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=17744@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.