From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#11720: 24.1; outline-mode : cursor and point mismatch ? Date: Sat, 16 Jun 2012 14:55:18 +0300 Message-ID: <83y5nneajd.fsf@gnu.org> References: <4FDB4733.1050005@yahoo.fr> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: dough.gmane.org 1339847765 19752 80.91.229.3 (16 Jun 2012 11:56:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 16 Jun 2012 11:56:05 +0000 (UTC) Cc: 11720@debbugs.gnu.org To: Nicolas Richard Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 16 13:56:04 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Sfrbo-0003KE-0Q for geb-bug-gnu-emacs@m.gmane.org; Sat, 16 Jun 2012 13:56:04 +0200 Original-Received: from localhost ([::1]:48725 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sfrbn-0001Lv-Va for geb-bug-gnu-emacs@m.gmane.org; Sat, 16 Jun 2012 07:56:03 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39645) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sfrbk-0001Le-8M for bug-gnu-emacs@gnu.org; Sat, 16 Jun 2012 07:56:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sfrbi-0005qN-F5 for bug-gnu-emacs@gnu.org; Sat, 16 Jun 2012 07:55:59 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35140) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sfrbi-0005qJ-BP for bug-gnu-emacs@gnu.org; Sat, 16 Jun 2012 07:55:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Sfref-0002gM-Jt for bug-gnu-emacs@gnu.org; Sat, 16 Jun 2012 07:59:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Jun 2012 11:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11720 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11720-submit@debbugs.gnu.org id=B11720.133984790610265 (code B ref 11720); Sat, 16 Jun 2012 11:59:01 +0000 Original-Received: (at 11720) by debbugs.gnu.org; 16 Jun 2012 11:58:26 +0000 Original-Received: from localhost ([127.0.0.1]:44686 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sfre4-0002fV-V9 for submit@debbugs.gnu.org; Sat, 16 Jun 2012 07:58:25 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:38093) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sfre1-0002fM-Fz for 11720@debbugs.gnu.org; Sat, 16 Jun 2012 07:58:22 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0M5P00D00L18ND00@a-mtaout22.012.net.il> for 11720@debbugs.gnu.org; Sat, 16 Jun 2012 14:55:15 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M5P00DBHL422TC0@a-mtaout22.012.net.il>; Sat, 16 Jun 2012 14:55:15 +0300 (IDT) In-reply-to: <4FDB4733.1050005@yahoo.fr> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:61039 Archived-At: > Date: Fri, 15 Jun 2012 16:31:15 +0200 > From: Nicolas Richard > > 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;