unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#17744: 24.3.91; Cursor drawn at EOL while it's at BOL
@ 2014-06-10  5:18 Stefan
  2014-06-10 16:37 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan @ 2014-06-10  5:18 UTC (permalink / raw)
  To: 17744


   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@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))





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#17744: 24.3.91; Cursor drawn at EOL while it's at BOL
  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
  2014-06-11 16:14   ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2014-06-10 16:37 UTC (permalink / raw)
  To: Stefan; +Cc: 17744

> 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.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#17744: 24.3.91; Cursor drawn at EOL while it's at BOL
  2014-06-10 16:37 ` Eli Zaretskii
@ 2014-06-11 16:14   ` Eli Zaretskii
  0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2014-06-11 16:14 UTC (permalink / raw)
  To: monnier; +Cc: 17744-done

> Date: Tue, 10 Jun 2014 19:37:46 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 17744@debbugs.gnu.org
> 
> > 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.

Committed as r117233 on the emacs-24 branch.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-06-11 16:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2014-06-11 16:14   ` Eli Zaretskii

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).