GNU bug report logs - #17744
24.3.91; Cursor drawn at EOL while it's at BOL

Previous Next

Package: emacs;

Reported by: Stefan <monnier <at> iro.umontreal.ca>

Date: Tue, 10 Jun 2014 05:48:02 UTC

Severity: normal

Found in version 24.3.91

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 17744 in the body.
You can then email your comments to 17744 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#17744; Package emacs. (Tue, 10 Jun 2014 05:48:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan <monnier <at> iro.umontreal.ca>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 10 Jun 2014 05:48:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefan <monnier <at> iro.umontreal.ca>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.91; Cursor drawn at EOL while it's at BOL
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.

   C-f C-f

this confirms that point really is where we want it to be, it's only the
cursor drawing code which is playing tricks.

This bug is visible in rectangle-mark-mode when the cursor is at BOL
right in front of a TAB and the other side of the rectangle ends in the
middle of that TAB.




In GNU Emacs 24.3.91.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.23)
 of 2014-06-06 on pastel
Repository revision: monnier <at> iro.umontreal.ca-20140606142539-5h50ienhp3mpz68z
Windowing system distributor `The X.Org Foundation', version 11.0.11500901
System Description:	Debian GNU/Linux 7.5 (wheezy)

Configured using:
 `configure -C --enable-checking --enable-check-lisp-object-type
 'CFLAGS=-Wall -g3 -Og -Wno-pointer-sign''

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

Major mode: Emacs-Lisp

Minor modes in effect:
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-s p l a c e - c u r s o C-s C-s C-a <right> <right> 
<right> <down> <right> <left> C-x SPC <up> <up> <up> 
<right> <right> <right> <right> C-x C-x C-g M-: ( l 
e t SPC <M-backspace> s e t q SPC s m - t <backspace> 
o l SPC ( m a k e - o v e r l a y SPC ( p o i n t ) 
SPC ( p o i n t ) ) ) <return> M-: ( o v e r l a y 
- p u t <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> s e t q SPC s m t e <backspace> 
<backspace> - t e s t SPC " T O T O " ) <return> M-: 
( p u t - t e x t - p r o <M-tab> SPC 0 SPC 1 SPC ' 
c u r s o r SPC 1 SPC s m - t e s t ) <return> M-: 
s m - t e s t <return> M-: ( o v e r l a y - p u t 
SPC s m - o l SPC ' a f t e r - s t r i n g SPC s m 
- t e s t ) <return> <left> <right> <right> <right> 
<right> <right> <left> <left> <left> <left> <left> 
<right> <right> <right> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> M-x r e p o - e m - b <tab> 
<return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Mark saved where search started
Mark set
Mark set (rectangle mode)
Quit [2 times]
#<overlay from 22331 to 22331 in rect.el>
"TOTO"
nil
#("TOTO" 0 1 (cursor 1)) [2 times]

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util help-fns mail-prsvr mail-utils rect misearch multi-isearch
vc-bzr time-date tooltip electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer 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 make-network-process dbusbind
gfilenotify dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty emacs)

Memory information:
((conses 8 73264 6135)
 (symbols 24 17632 0)
 (miscs 20 63 350)
 (strings 16 9931 4370)
 (string-bytes 1 271526)
 (vectors 8 9748)
 (vector-slots 4 383535 5334)
 (floats 8 67 327)
 (intervals 28 432 21)
 (buffers 512 12)
 (heap 1024 20818 707))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17744; Package emacs. (Tue, 10 Jun 2014 16:38:03 GMT) Full text and rfc822 format available.

Message #8 received at 17744 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan <monnier <at> iro.umontreal.ca>
Cc: 17744 <at> debbugs.gnu.org
Subject: Re: bug#17744: 24.3.91; Cursor drawn at EOL while it's at BOL
Date: Tue, 10 Jun 2014 19:37:46 +0300
> From: Stefan <monnier <at> 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 sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Wed, 11 Jun 2014 16:15:03 GMT) Full text and rfc822 format available.

Notification sent to Stefan <monnier <at> iro.umontreal.ca>:
bug acknowledged by developer. (Wed, 11 Jun 2014 16:15:04 GMT) Full text and rfc822 format available.

Message #13 received at 17744-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: monnier <at> iro.umontreal.ca
Cc: 17744-done <at> debbugs.gnu.org
Subject: Re: bug#17744: 24.3.91; Cursor drawn at EOL while it's at BOL
Date: Wed, 11 Jun 2014 19:14:16 +0300
> Date: Tue, 10 Jun 2014 19:37:46 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 17744 <at> debbugs.gnu.org
> 
> > From: Stefan <monnier <at> 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.

Committed as r117233 on the emacs-24 branch.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 10 Jul 2014 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 300 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.