From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Richard Newsgroups: gmane.emacs.bugs Subject: bug#17823: 24.3.91; end-of-visual-line: incorrect behaviour with truncate-lines and a line-prefix Date: Fri, 20 Jun 2014 22:27:06 +0200 Message-ID: <87ionvuy1x.fsf@yahoo.fr> References: <87r42jv5rr.fsf@yahoo.fr> <83ionvqujt.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1403296108 26561 80.91.229.3 (20 Jun 2014 20:28:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Jun 2014 20:28:28 +0000 (UTC) Cc: Nicolas Richard , 17823@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 20 22:28:20 2014 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 1Wy5Q0-0006lL-Bw for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Jun 2014 22:28:16 +0200 Original-Received: from localhost ([::1]:42779 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wy5Pz-0003FC-LK for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Jun 2014 16:28:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46483) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wy5Pr-0003EG-N2 for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2014 16:28:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wy5Pm-0004Sv-KQ for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2014 16:28:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35815) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wy5Pm-0004Sp-GT for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2014 16:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Wy5Pm-0007ny-24 for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2014 16:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Nicolas Richard Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Jun 2014 20:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17823 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17823-submit@debbugs.gnu.org id=B17823.140329603529932 (code B ref 17823); Fri, 20 Jun 2014 20:28:02 +0000 Original-Received: (at 17823) by debbugs.gnu.org; 20 Jun 2014 20:27:15 +0000 Original-Received: from localhost ([127.0.0.1]:55198 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wy5P0-0007mh-Mn for submit@debbugs.gnu.org; Fri, 20 Jun 2014 16:27:15 -0400 Original-Received: from mailrelay012.isp.belgacom.be ([195.238.6.179]:38361) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wy5Oy-0007mR-Ot for 17823@debbugs.gnu.org; Fri, 20 Jun 2014 16:27:13 -0400 X-Belgacom-Dynamic: yes Original-Received: from 76.210-178-91.adsl-dyn.isp.belgacom.be (HELO LDLC-portable) ([91.178.210.76]) by relay.skynet.be with ESMTP; 20 Jun 2014 22:27:06 +0200 In-Reply-To: <83ionvqujt.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 20 Jun 2014 21:56:22 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.91 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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:90617 Archived-At: Eli Zaretskii writes: >> From: Nicolas Richard >> Date: Fri, 20 Jun 2014 19:40:24 +0200 >> >> (progn >> (insert (make-string 500 ?x)) >> (column-number-mode) ;; just to see it. plays no role. >> (beginning-of-line) >> (setq line-prefix (make-string 10 ? )) >> (visual-line-mode) >> (toggle-truncate-lines 1)) >> >> then hit C-e (end-of-visual-line) a few times. After some hits, the >> cursor doesn't move anymore, although it's not at the end of the line. >> On my machine, it goes to column 70, then 100, then stops there even >> when hitting C-e again. >> >> I expect emacs to scroll horizontally instead > > Why do you expect that? Because when the cursor is near the right border of the window (~ 5 characters), emacs scrolls horizontally automatically (depending on auto-hscroll-mode). Since the end of the visual line is at the right border of the window, emacs should put cursor there and scroll accordingly. It does it correctly when line-prefix is nil. In the recipe I gave, C-e fails to place point at the right border of the window. > Is there some real-life use case behind this? If so, please show it. My use case is an org mode file like * title ** title2 *** title3 | some | very | wide | org | mode | table | some | very | wide | org | mode | table | some | very | wide | org | mode | table | some | very | wide | org | mode | table | some | very | wide | org | mode | table | some | very | wide | org | mode | table | when org-indent-mode is activated (which adds line-prefix) and visual-line-mode activated. If the table is very wide, it'll be wrapped and look bad. So I toggle-truncate-lines temporarily to avoid the wrapping, and can navigate through the table by (horizontal) screenfuls... except for the bug. The workaround in my use case is to temporarily turn off visual-line-mode instead of temporarily activating truncate-lines ; but nevertheless I think there's a bug in vertical-motion : (vertical-motion (cons (window-width) 0)) fails to set the point at the correct position when asked to. -- Nico.