From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#28936: move_it_in_display_line_to returns MOVE_POS_MATCH_OR_ZV before ZV Date: Sun, 22 Oct 2017 17:10:17 +0300 Message-ID: <83fuabb7ee.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1508681476 9481 195.159.176.226 (22 Oct 2017 14:11:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 22 Oct 2017 14:11:16 +0000 (UTC) Cc: 28936@debbugs.gnu.org To: Keith David Bershatsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 22 16:11:11 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e6Gy3-0001EP-Iq for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Oct 2017 16:11:07 +0200 Original-Received: from localhost ([::1]:33026 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6GyA-000102-Uh for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Oct 2017 10:11:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6Gy2-0000yy-W1 for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2017 10:11:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e6Gxy-0006DM-16 for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2017 10:11:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47313) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e6Gxx-0006DI-T5 for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2017 10:11:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e6Gxx-0006Ar-Kz for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2017 10:11:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Oct 2017 14:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28936 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28936-submit@debbugs.gnu.org id=B28936.150868143323695 (code B ref 28936); Sun, 22 Oct 2017 14:11:01 +0000 Original-Received: (at 28936) by debbugs.gnu.org; 22 Oct 2017 14:10:33 +0000 Original-Received: from localhost ([127.0.0.1]:55994 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e6GxU-0006A6-TV for submit@debbugs.gnu.org; Sun, 22 Oct 2017 10:10:33 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52210) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e6GxT-00069u-M7 for 28936@debbugs.gnu.org; Sun, 22 Oct 2017 10:10:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e6GxJ-00063O-74 for 28936@debbugs.gnu.org; Sun, 22 Oct 2017 10:10:26 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39742) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6GxI-00063E-VN; Sun, 22 Oct 2017 10:10:21 -0400 Original-Received: from [176.228.60.248] (port=1258 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e6GxI-00052s-CR; Sun, 22 Oct 2017 10:10:20 -0400 In-reply-to: (message from Keith David Bershatsky on Sat, 21 Oct 2017 20:02:58 -0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:138850 Archived-At: > Date: Sat, 21 Oct 2017 20:02:58 -0700 > From: Keith David Bershatsky > > 1. `move_it_in_display_line' could use an additional comment at the outset to let readers know that it is not compatible with moving to X in a horizontal scrolling and/or truncate lines situation. The existing commentary that it was intended for external use was insufficient to deter me, and it required a learning curve on my part to better understand its limited potential use. More commentary can never do any harm, but the incompatibility you describe is news to me. Can you show a recipe in "emacs -Q" that would demonstrate this issue? Or show a complete code snippet, starting with start_display or init_iterator, where this issue happens? > 2. When IT is on the last line in the buffer containing a few or more characters, `move_it_in_display_line_to' stops short of the target X and erroneously returns MOVE_POS_MATCH_OR_ZV when used as follows. I have display-line-numbers set to a non-nil value in the event that makes a difference. There is nothing special in terms of text-properties or overlays present in the buffer. > > int target_x = [Some arbitrary X that is a few characters before ZV.]; > > move_it_in_display_line_to (it, ZV, target_x, MOVE_TO_POS | MOVE_TO_X); You don't show how the value of 'it' was set up before this call, so it's hard to look into this issue. I can only tell that I've reviewed all the code paths that lead to MOVE_POS_MATCH_OR_ZV being returned, and they all seem to be conditioned either on reaching the position or hitting ZV. Maybe I missed something, but without a complete code snippet that's the best I could do. > The workaround is to compare the result of MOVE_POS_MATCH_OR_ZV with IT_CHARPOS to ensure that we are really at a ZV situation. MOVE_POS_MATCH_OR_ZV doesn't necessarily mean you are at ZV, you could also be at POS or after it.