GNU bug report logs - #11720
24.1; outline-mode : cursor and point mismatch ?

Previous Next

Package: emacs;

Reported by: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>

Date: Fri, 15 Jun 2012 20:33:03 UTC

Severity: normal

Found in version 24.1

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

Bug is archived. No further changes may be made.

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
Cc: 11720 <at> debbugs.gnu.org
Subject: Re: bug#11720: 24.1; outline-mode : cursor and point mismatch ?
Date: Sat, 16 Jun 2012 14:55:18 +0300
> Date: Fri, 15 Jun 2012 16:31:15 +0200
> From: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
> 
> Say I have a buffer with the two lines:
> * A
> Some text
> 
> and I hit C-c C-d (hide-subtree) and M-<. Now I have:
> * A...
> ^
> where '...' indicates hidden text and '^' indicates the
> position of the cursor (on the title line).
> 
> Then hitting C-f a few times will advance the cursor successively :
> * A...
>   ^
> * A...
>    ^
> * A...
>       ^ <- I did not expect this.
> * A...
>        ^

Actually, the behavior in Emacs 24.1 is this:

* A...
  ^
* A...
      ^ <- I did not expect this.
* A...
       ^

> The behaviour that I expected was :
> * A...
>   ^
> * A...
>    ^
> * A...
>     ^   <- different
> * A...
>        ^

No, you expected this:

* A...
  ^
* A...
   ^   <- different
* A...
       ^

Anyway, I think I fixed this now, in revision 108626 on the trunk.  If
you can build your own Emacs, the patch is below; please try it and
tell if the problem is solved for you, or there are any leftovers.

Thanks.


--- src/xdisp.c	2012-06-16 10:18:21 +0000
+++ src/xdisp.c	2012-06-16 11:47:44 +0000
@@ -13937,16 +13937,13 @@ set_cursor_from_row (struct window *w, s
 		    break;
 		  }
 		/* See if we've found a better approximation to
-		   POS_BEFORE or to POS_AFTER.  Note that we want the
-		   first (leftmost) glyph of all those that are the
-		   closest from below, and the last (rightmost) of all
-		   those from above.  */
+		   POS_BEFORE or to POS_AFTER.  */
 		if (0 > dpos && dpos > pos_before - pt_old)
 		  {
 		    pos_before = glyph->charpos;
 		    glyph_before = glyph;
 		  }
-		else if (0 < dpos && dpos <= pos_after - pt_old)
+		else if (0 < dpos && dpos < pos_after - pt_old)
 		  {
 		    pos_after = glyph->charpos;
 		    glyph_after = glyph;
@@ -14030,7 +14027,7 @@ set_cursor_from_row (struct window *w, s
 		    pos_before = glyph->charpos;
 		    glyph_before = glyph;
 		  }
-		else if (0 < dpos && dpos <= pos_after - pt_old)
+		else if (0 < dpos && dpos < pos_after - pt_old)
 		  {
 		    pos_after = glyph->charpos;
 		    glyph_after = glyph;






This bug report was last modified 12 years and 339 days ago.

Previous Next


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