From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: An interesting line-motion bug. Date: Thu, 17 Nov 2022 14:24:56 +0200 Message-ID: <831qq1epk7.fsf@gnu.org> References: <87cz9mywbr.fsf@red-bean.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30639"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Karl Fogel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 17 13:25:26 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ovdxN-0007kd-75 for ged-emacs-devel@m.gmane-mx.org; Thu, 17 Nov 2022 13:25:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovdwv-0006R0-WC; Thu, 17 Nov 2022 07:24:58 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ovdwu-0006QS-Gc for emacs-devel@gnu.org; Thu, 17 Nov 2022 07:24:56 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ovdwu-0002SV-6n; Thu, 17 Nov 2022 07:24:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=gmhFXAqHjdRV1r52CqAI9yaPjlh/55c1bRuro17soTw=; b=ljYA9V8q9faz yxM0OVQ5tNunnjGCcLEKlaTTmVJTTKoOLEMTY+8MssARncjDoiDLeEc5bTpcH71E4i8jySXFdCgWh 5SPBtEYW+wFtfG/b/fpl31VL+RuxeRv74utcInldIEOs8UmLrb4JZVIFHd74ROs9futH0Nihh86rQ /dArSdYxf6FZpNexzoTpnRqTx4n0UKMfmec6LoMd3qg0NaSjt+gNxQWmCnKleAqAwaspDFGhYCUwt HaiHsRfzYT//fidH+Er0mv7OKxMAGPSOovT2Onjaxl14ZtDTn9sPHuQz4x6KaYIASnzcJQ8N8X8Cw 8GNgd1dLfyrxvv3otKzKjg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ovdwt-0005nI-LW; Thu, 17 Nov 2022 07:24:55 -0500 In-Reply-To: <87cz9mywbr.fsf@red-bean.com> (message from Karl Fogel on Wed, 16 Nov 2022 23:38:32 -0600) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:300043 Archived-At: > From: Karl Fogel > Date: Wed, 16 Nov 2022 23:38:32 -0600 > > ;; When you hit that breakpoint, point will already be on the newline > ;; at the end of the line ";; in a buffer in which" above. By then, > ;; that newline has a display property that makes it look wide to > ;; Emacs -- specifically, one unit wider than a newline normally is. > ;; But Emacs never asked whether the display property is on a > ;; *newline*. In other words, Emacs identifies this as a wide > ;; character and thus mistakenly computes a "width" that actually > ;; extends over a vertical (because newline) span. Why is it important that the display property "covers" a newline? A display property whose value is a string completely replaces the text that it "covers", and that includes the newline in the buffer text. What _is_ important is that the display property itself includes a newline, which effectively resets the column to zero. Unfortunately, I don't know how to fix this basic issue. The code which does that is AFAIU unable to grasp the situation where moving across text _decreases_ the column. If someone has ideas how to support such situations, please speak up. And keep in mind that this code is used much more than for C-n and C-p.