From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Learning something more about Emacs tests Date: Fri, 18 Dec 2015 21:30:31 +0200 Message-ID: <83egejwo4o.fsf@gnu.org> References: <87poy3slsa.fsf@metapensiero.it> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1450467036 3967 80.91.229.3 (18 Dec 2015 19:30:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Dec 2015 19:30:36 +0000 (UTC) Cc: emacs-devel@gnu.org To: Lele Gaifax Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 18 20:30:30 2015 Return-path: Envelope-to: ged-emacs-devel@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 1aA0jV-0007qg-0d for ged-emacs-devel@m.gmane.org; Fri, 18 Dec 2015 20:30:29 +0100 Original-Received: from localhost ([::1]:34770 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aA0jT-000208-QE for ged-emacs-devel@m.gmane.org; Fri, 18 Dec 2015 14:30:27 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aA0jE-0001yI-Mw for emacs-devel@gnu.org; Fri, 18 Dec 2015 14:30:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aA0j9-0006ll-N7 for emacs-devel@gnu.org; Fri, 18 Dec 2015 14:30:12 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47490) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aA0j9-0006lX-KF; Fri, 18 Dec 2015 14:30:07 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2072 helo=HOME-C4E4A596F7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aA0j8-0002ew-Ro; Fri, 18 Dec 2015 14:30:07 -0500 In-reply-to: <87poy3slsa.fsf@metapensiero.it> (message from Lele Gaifax on Fri, 18 Dec 2015 18:34:45 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:196487 Archived-At: > From: Lele Gaifax > Date: Fri, 18 Dec 2015 18:34:45 +0100 > > (ert-deftest tabulated-list-visual-move () > ;; See Bug#22194 > (tabulated-list--test-with-buffer > (goto-char (point-min)) > (skip-chars-forward "[:blank:]") > (skip-chars-forward "[:word:]-") > (backward-char) > ;; now the cursor is on the ending “e” of “zzzz-game” > (funcall-interactively 'next-line 3) > (funcall-interactively 'next-line) > (should (equal (line-number-at-pos (point)) 5)))) > > To my surprise, this test passes, either before or after Eli's fix. I tried > several variants in the way I call the next-line function, but either moving > one line at at time or in two steps like I did above, I was not able to > reproduce the initial bug case. > > Even executing it interactively, there is some "subtle" difference in hitting > the “n” key (bound to next-line) and doing that with “M-: (funcall-interactively 'next-line)”. > > *Before* Eli's fix, in the latter case after the second evaluation the cursor > ends at column 1 (ie just before the package name) and stays there in the > succeeding evaluations. *After* the fix, it goes at column 7 (that is, one > space after the name “mode”) and stays there. > > On the other hand, using the “n” key to invoke it, before the fix it exhibit > the behaviour described in the bug report, while now it honors the goal-column > (or something similar): if the package name on the current line is longer than > the first one, the cursor stays at the initial column. > > What am I doing wrong? How can I programmatically exercise the next-line > function retaining the interactive behaviour? Your problem is not interactive call, your problem is interactive _session_. When the variable noninteractive is non-nil, both line-move (called by next-line) and vertical-motion behave differently: they move by physical lines, not screen lines. So the bug, which was in the code that moves by visual lines, doesn't happen.