From unknown Thu Aug 14 12:25:14 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#17823 <17823@debbugs.gnu.org> To: bug#17823 <17823@debbugs.gnu.org> Subject: Status: 24.3.91; end-of-visual-line: incorrect behaviour with truncate-lines and a line-prefix Reply-To: bug#17823 <17823@debbugs.gnu.org> Date: Thu, 14 Aug 2025 19:25:14 +0000 retitle 17823 24.3.91; end-of-visual-line: incorrect behaviour with truncat= e-lines and a line-prefix reassign 17823 emacs submitter 17823 Nicolas Richard severity 17823 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 20 13:40:59 2014 Received: (at submit) by debbugs.gnu.org; 20 Jun 2014 17:40:59 +0000 Received: from localhost ([127.0.0.1]:55051 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wy2o6-0001Du-Nf for submit@debbugs.gnu.org; Fri, 20 Jun 2014 13:40:58 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37640) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wy2o5-0001De-Cb for submit@debbugs.gnu.org; Fri, 20 Jun 2014 13:40:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wy2nq-00038k-DE for submit@debbugs.gnu.org; Fri, 20 Jun 2014 13:40:52 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:60034) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wy2nq-00038d-2X for submit@debbugs.gnu.org; Fri, 20 Jun 2014 13:40:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39337) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wy2ni-0005AK-Ia for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2014 13:40:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wy2nb-00036P-2m for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2014 13:40:34 -0400 Received: from mailrelay003.isp.belgacom.be ([195.238.6.53]:16213) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wy2na-00035o-TV for bug-gnu-emacs@gnu.org; Fri, 20 Jun 2014 13:40:27 -0400 X-Belgacom-Dynamic: yes 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 19:40:26 +0200 From: Nicolas Richard To: bug-gnu-emacs@gnu.org Subject: 24.3.91; end-of-visual-line: incorrect behaviour with truncate-lines and a line-prefix Date: Fri, 20 Jun 2014 19:40:24 +0200 Message-ID: <87r42jv5rr.fsf@yahoo.fr> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Hi, from emacs -Q, run the following with M-: (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 (like it does when line-prefix is nil). -- Nicolas. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 20 14:56:50 2014 Received: (at 17823) by debbugs.gnu.org; 20 Jun 2014 18:56:50 +0000 Received: from localhost ([127.0.0.1]:55107 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wy3zS-0004J4-Co for submit@debbugs.gnu.org; Fri, 20 Jun 2014 14:56:50 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:50035) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wy3zN-0004Il-0X for 17823@debbugs.gnu.org; Fri, 20 Jun 2014 14:56:45 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0N7H00600DG9A700@a-mtaout22.012.net.il> for 17823@debbugs.gnu.org; Fri, 20 Jun 2014 21:56:34 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N7H006ACDYA5960@a-mtaout22.012.net.il>; Fri, 20 Jun 2014 21:56:34 +0300 (IDT) Date: Fri, 20 Jun 2014 21:56:22 +0300 From: Eli Zaretskii Subject: Re: bug#17823: 24.3.91; end-of-visual-line: incorrect behaviour with truncate-lines and a line-prefix In-reply-to: <87r42jv5rr.fsf@yahoo.fr> X-012-Sender: halo1@inter.net.il To: Nicolas Richard Message-id: <83ionvqujt.fsf@gnu.org> References: <87r42jv5rr.fsf@yahoo.fr> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 17823 Cc: 17823@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > 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? "Visual line" means the line that is on display. What isn't on display does not exist for this purpose. Is there some real-life use case behind this? If so, please show it. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 20 15:21:05 2014 Received: (at 17823) by debbugs.gnu.org; 20 Jun 2014 19:21:05 +0000 Received: from localhost ([127.0.0.1]:55121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wy4Mu-00065y-In for submit@debbugs.gnu.org; Fri, 20 Jun 2014 15:21:05 -0400 Received: from relais.videotron.ca ([24.201.245.36]:14828) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wy4Mn-00065k-Tt for 17823@debbugs.gnu.org; Fri, 20 Jun 2014 15:20:58 -0400 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from ceviche.home ([24.203.184.39]) by VL-VM-MR005.ip.videotron.ca (Oracle Communications Messaging Exchange Server 7u4-22.01 64bit (built Apr 21 2011)) with ESMTP id <0N7H00KS4F2T8640@VL-VM-MR005.ip.videotron.ca> for 17823@debbugs.gnu.org; Fri, 20 Jun 2014 15:20:53 -0400 (EDT) Received: by ceviche.home (Postfix, from userid 20848) id E6263660FA; Fri, 20 Jun 2014 15:20:54 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#17823: 24.3.91; end-of-visual-line: incorrect behaviour with truncate-lines and a line-prefix Message-id: References: <87r42jv5rr.fsf@yahoo.fr> <83ionvqujt.fsf@gnu.org> Date: Fri, 20 Jun 2014 15:20:54 -0400 In-reply-to: <83ionvqujt.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 17823 Cc: Nicolas Richard , 17823@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Why do you expect that? "Visual line" means the line that is on > display. What isn't on display does not exist for this purpose. Hmm... good point. My intuitive understanding of the "visual line" feature is to distinguish the "newlines" from the "line wraps", so when we `truncate-lines' I'd expect the visual-line movements to be the same as the physical line movements (tho I'd allow a distinction in the case of line-wraps introduced via `display' of before/after-strings). Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 20 16:27:15 2014 Received: (at 17823) by debbugs.gnu.org; 20 Jun 2014 20:27:15 +0000 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 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 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 From: Nicolas Richard To: Eli Zaretskii Subject: Re: bug#17823: 24.3.91; end-of-visual-line: incorrect behaviour with truncate-lines and a line-prefix References: <87r42jv5rr.fsf@yahoo.fr> <83ionvqujt.fsf@gnu.org> Date: Fri, 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") Message-ID: <87ionvuy1x.fsf@yahoo.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 17823 Cc: Nicolas Richard , 17823@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) 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. From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 21 08:37:13 2014 Received: (at 17823-done) by debbugs.gnu.org; 21 Jun 2014 12:37:13 +0000 Received: from localhost ([127.0.0.1]:55474 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WyKXg-000820-Tx for submit@debbugs.gnu.org; Sat, 21 Jun 2014 08:37:13 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:42530) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WyKXd-00080n-Q8 for 17823-done@debbugs.gnu.org; Sat, 21 Jun 2014 08:37:11 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0N7I00F00QBEDI00@a-mtaout22.012.net.il> for 17823-done@debbugs.gnu.org; Sat, 21 Jun 2014 15:37:03 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N7I00FCJR1QHL10@a-mtaout22.012.net.il>; Sat, 21 Jun 2014 15:37:03 +0300 (IDT) Date: Sat, 21 Jun 2014 15:36:52 +0300 From: Eli Zaretskii Subject: Re: bug#17823: 24.3.91; end-of-visual-line: incorrect behaviour with truncate-lines and a line-prefix In-reply-to: <83ionvqujt.fsf@gnu.org> X-012-Sender: halo1@inter.net.il To: theonewiththeevillook@yahoo.fr Message-id: <83ionutp5n.fsf@gnu.org> References: <87r42jv5rr.fsf@yahoo.fr> <83ionvqujt.fsf@gnu.org> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 17823-done Cc: 17823-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Fri, 20 Jun 2014 21:56:22 +0300 > From: Eli Zaretskii > Cc: 17823@debbugs.gnu.org > > > 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? "Visual line" means the line that is on > display. What isn't on display does not exist for this purpose. > > Is there some real-life use case behind this? If so, please show it. Actually, no, don't bother. I found out that this was due to the original code in vertical-motion being incorrect due to some subtle aspect of the display engine which the code ignored. Fixed in revision 117277 on the emacs-24 branch. From unknown Thu Aug 14 12:25:14 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 20 Jul 2014 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator