From unknown Sat Sep 06 00:10:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79241: 31.0.50; `vertical-motion' not respecting goal column when there is an overlay that spans multiple virtual lines Resent-From: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Aug 2025 08:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 79241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 79241@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.175524675327078 (code B ref -1); Fri, 15 Aug 2025 08:33:02 +0000 Received: (at submit) by debbugs.gnu.org; 15 Aug 2025 08:32:33 +0000 Received: from localhost ([127.0.0.1]:37224 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1umprU-00072f-6b for submit@debbugs.gnu.org; Fri, 15 Aug 2025 04:32:32 -0400 Received: from lists.gnu.org ([2001:470:142::17]:56364) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1umprR-00072P-73 for submit@debbugs.gnu.org; Fri, 15 Aug 2025 04:32:30 -0400 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 1umprL-0006ed-NQ for bug-gnu-emacs@gnu.org; Fri, 15 Aug 2025 04:32:23 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1umprI-0002x1-JO for bug-gnu-emacs@gnu.org; Fri, 15 Aug 2025 04:32:22 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-45a1b0b6ac4so8693585e9.2 for ; Fri, 15 Aug 2025 01:32:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755246738; x=1755851538; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=/0BSePzqbnpMCJZkbZOADqBmkm0eXaXSFvm28MwblrI=; b=kXEA1AinS7XFuEsx/oeoM7JvCqs882QydfO6EJk9/CqxeU8WsThgVu92UXhur63xrJ eNU0YcFNLeSqCz5i1eiYLa36DwsFdbfiiPicmKhc/U3JPdVFSuROJUu1v2t3eE8iAcLs ghQS9JZHGIDoxjnVJqDXE9TnuuR628j9NE6pg7p2XlCQEB6gL41BaZUrGQhZk2sIpyDr 5ypqFrIituN/thBWAjpQEGS71VMWZ5TBQjOqJ2rBDal9SJ3dIqjRJKEc/1bezFT19ln/ 5nH52U2BupHZ0+aKrPCD3fZKyTeZrnI+/Qyjz2E/61tavQDWNsRNbkob/wdwlBAn7XOc x6Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755246738; x=1755851538; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=/0BSePzqbnpMCJZkbZOADqBmkm0eXaXSFvm28MwblrI=; b=NlOFVG/UpJHoY+ioqBmUKAGh7S23oUCnThjmhQwFLsfVjOKh7sRgyUxJc0Kcmn4HjE vkPinqWnaUD/fq47hKA1s8eN/l64K5l8gIcsfheiBh1Sa6Mxf+9rlJjAmFvrFrAszMPk FT2n3f6sntMGDS833md/3BguhA8tK7LldbdJ7JHT8oL3ezJZjXOe/NkTr9DDNtlcqqZ5 be6JSHk+ns8UMZ+p/xQZMaWN3NBtOzFV7CydAYDw/E5aAGN3//FzYNsNg8zR0MLPxXHW fZl2KpDsbN1ymc9OkjsIH8oDE/Zx1BpDbSt3IffFmld2YSOFroo+ciUAtxfUBW8EBWIY OmxQ== X-Gm-Message-State: AOJu0YzEXGmhIgkG1ehPcp3XYNe9MaSuDidD2XucX1BYpDvka7kpEOyS c4B5IvQ1qcYoxW5fIJ9aMm0rN8Cz3o+813CAG55RAyq1oHTz/ITfBu6vcOQMoQ== X-Gm-Gg: ASbGncvMOn7JBbw5jWvrBgPKJnQuiI+tSnWwa8Pogkjd9pNs3Y8hvlZWs47ZgDLfC2X 1AvUkIbHJ60mKV97wARdY2EPPtkePDw/kfd5yHdVwrxIjtB7Zo7DOrFTQTOIPD9W3JoC2SfketW klVPGBix9joUPDtetPvKBFcXr/p4lSOipXcAVYGwJ2nFPtND/W+i3SZD+W8we420Z0qcP75qPdH lTEYxVUxSJqInsHlXvB7uYH0ihSRfWe4GkW33hSJ7rTbXBomIc64zt2gKWHrbyzGiywac4Ncmbr iTIdBSzsPN8OT9uYdQjoGB16N0uFmVji74ds4xyGK2iwKRd8/R9yv52LOY7JQQP5WjX0tWczEQ4 H8cnlTc4F9Wg7GZ86bJMHXrckOY4TS1UVxZ6RNp51DVDRwSc= X-Google-Smtp-Source: AGHT+IFvRtHuu5COakMVsEZu0G1lkRw7AcCiWjTA26bhRY/Co0dz/xD94xe9La104vMXw0/bQgva+A== X-Received: by 2002:a05:600c:4746:b0:456:2212:46b8 with SMTP id 5b1f17b1804b1-45a21868a75mr8136415e9.28.1755246737196; Fri, 15 Aug 2025 01:32:17 -0700 (PDT) Received: from localhost ([2a0c:5a85:d20b:2b00:2040:f871:fbca:fa67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45a233257b7sm4573415e9.3.2025.08.15.01.32.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Aug 2025 01:32:16 -0700 (PDT) From: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= Date: Fri, 15 Aug 2025 10:31:29 +0200 Message-ID: <87ectdt28u.fsf@sheepbook.mail-host-address-is-not-set> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=sergio.pastorperez@gmail.com; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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 (/) The issue is that `vertical-motion' does not seem to respect goal column when moving upwards through an overlay that spans multiple visual lines. I will give a recipe using the latest version of Flymake, since it's an easy way to generate an overlay that spawns multiple visual lines, but I suspect that this issue can be reproduced with any overlay of those characteristics, and is not a particual issue of Flymake. I've tried to debug the line movement code but at some point I reached `vertical-motion', which is a C function, so I didn't debug it further. Invoking: `(vertical-motion '(0.0 . -1))' is enough to see the behavior described. 1) Install Flymake v1.4.1. (I used Elpaca) 2) `(setq flymake-show-diagnostics-at-end-of-line 'fancy)` 3) Go to a buffer where diagnostic will show, I used Eglot for this. 4) Put the cursor a the beginning of the line prior to the overlay generated by Flymake. Notice that when using the `'fancy' setting, the message will span across multiple visual lines. 5) Try to move upwards, towards the diagnostic. We expect the cursor to remain at the beggining of the line but instead, it goes to the end of the line. This behavior does not happen when moving downwards through the diagnostic message. The issue is that `vertical-motion' does not seem to respect goal column when moving upwards through an overlay that spans multiple visual lines. I will give a recipe using the latest version of Flymake, since it's an easy way to generate an overlay that spawns multiple visual lines, but I suspect that this issue can be reproduced with any overlay of those characteristics and is not a particular issue of Flymake. I've tried to debug the line movement code but at some point I reached `vertical-motion' which is a C function so I cannot debug it further. Invoking: `(vertical-motion '(0.0 . -1))' is enough to see the behavior described. 1) Install Flymake v1.4.1. (I used Elpaca) 2) `(setq flymake-show-diagnostics-at-end-of-line 'fancy)` 3) Go to a buffer where diagnostic will show, I used Eglot for this. 4) Put the cursor a the beginning of the line prior to the overlay generated by Flymake. Notice that when using the `'fancy' setting, the message will span across multiple visual lines. 5) Try to move upwords, towards the diagnostic. We expect the cursor to remain at the beginning of the line but instead, it goes to the end of the line. This behavior does not happen when moving downwards through the diagnostic message. In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.43, cairo version 1.18.4) System Description: Guix System Configured using: 'configure CONFIG_SHELL=/gnu/store/nnx8iifrj6jfih4sivivq17cf65aa968-bash-minimal-5.2.37/bin/bash SHELL=/gnu/store/nnx8iifrj6jfih4sivivq17cf65aa968-bash-minimal-5.2.37/bin/bash --prefix=/gnu/store/g1rsgv58jnqpy6q2rnhy7xzqvpjks2f4-emacs-next-pgtk-31.0.50-1.9663c95 --enable-fast-install --with-pgtk --with-cairo --with-modules --with-native-compilation=aot 'CFLAGS=-g -O2 -Wno-error=incompatible-pointer-types' --disable-build-details' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM GTK3 ZLIB Important settings: value of $EMACSLOADPATH: /home/pastor/.guix-home/profile/share/emacs/site-lisp:/home/pastor/.guix-home/profile/share/emacs/site-lisp:/run/current-system/profile/share/emacs/site-lisp:/gnu/store/g1rsgv58jnqpy6q2rnhy7xzqvpjks2f4-emacs-next-pgtk-31.0.50-1.9663c95/share/emacs/31.0.50/lisp value of $EMACSNATIVELOADPATH: /home/pastor/.guix-home/profile/lib/emacs/native-site-lisp:/home/pastor/.guix-home/profile/lib/emacs/native-site-lisp value of $LANG: en_US.utf8 locale-coding-system: utf-8-unix Major mode: C++//l Minor modes in effect: eglot--managed-mode: t flymake-mode: t elpaca-use-package-mode: t override-global-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t minibuffer-regexp-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t abbrev-mode: t Load-path shadows: /home/pastor/.guix-home/profile/share/emacs/site-lisp/guix-emacs hides /run/current-system/profile/share/emacs/site-lisp/guix-emacs /home/pastor/.guix-home/profile/share/emacs/site-lisp/site-start hides /run/current-system/profile/share/emacs/site-lisp/site-start /home/pastor/.emacs.d/elpaca/builds/flymake/flymake hides /gnu/store/g1rsgv58jnqpy6q2rnhy7xzqvpjks2f4-emacs-next-pgtk-31.0.50-1.9663c95/share/emacs/31.0.50/lisp/progmodes/flymake /gnu/store/1i3864529l6ckl45kc80b2y72wfigf6m-emacs-compat-30.0.2.0/share/emacs/site-lisp/compat-30.0.2.0/compat hides /gnu/store/g1rsgv58jnqpy6q2rnhy7xzqvpjks2f4-emacs-next-pgtk-31.0.50-1.9663c95/share/emacs/31.0.50/lisp/emacs-lisp/compat Features: (shadow sort mail-extr info emacsbug lisp-mnt message yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils rect cl-extra eglot tree-widget wid-edit external-completion jsonrpc xref flymake thingatpt project diff ert pp ewoc debug backtrace find-func filenotify compile text-property-search pcase imenu cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs misearch multi-isearch flymake-autoloads tramp-archive tramp-gvfs dbus xml tramp trampver tramp-integration tramp-message help-mode tramp-compat xdg shell pcomplete comint ansi-osc ring parse-time iso8601 time-date format-spec ansi-color tramp-loaddefs elpaca-menu-elpa no-littering compat no-littering-autoloads elpaca-menu-melpa elpaca-menu-org elpaca-use-package use-package use-package-ensure use-package-delight use-package-diminish use-package-bind-key bind-key use-package-core elpaca-use-package-autoloads hl-line display-line-numbers elpaca-log elpaca-ui url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util url-parse auth-source eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv bytecomp byte-compile url-vars mailcap cl-seq elpaca warnings icons elpaca-process elpaca-autoloads vc-git diff-mode track-changes easy-mmode files-x vc-dispatcher cl-loaddefs cl-lib magit-popup-autoloads geiser-guile-autoloads edit-indirect-autoloads bui-autoloads guix-autoloads rx stgit-autoloads page-break-lines-autoloads dashboard-autoloads memoize-autoloads dash-autoloads s-autoloads f-autoloads all-the-icons-autoloads log4e-autoloads gntp-autoloads alert-autoloads telega-contrib-autoloads rainbow-identifiers-autoloads visual-fill-column-autoloads telega-autoloads consult-autoloads consult-notmuch-autoloads notmuch-indicator-autoloads notmuch-autoloads compat-autoloads jinx-autoloads tablist-autoloads pdf-tools-autoloads company-autoloads geiser-autoloads vterm-git.f76de08-autoloads guix-emacs rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win term/common-win touch-screen pgtk-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo gtk pgtk lcms2 multi-tty move-toolbar make-network-process tty-child-frames native-compile emacs) Memory information: ((conses 16 505081 51672) (symbols 48 23934 48) (strings 32 216943 3808) (string-bytes 1 4504841) (vectors 16 35040) (vector-slots 8 447974 25893) (floats 8 76 879) (intervals 56 2253 176) (buffers 992 26)) From unknown Sat Sep 06 00:10:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79241: 31.0.50; `vertical-motion' not respecting goal column when there is an overlay that spans multiple virtual lines Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Aug 2025 06:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 79241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= Cc: 79241@debbugs.gnu.org Received: via spool by 79241-submit@debbugs.gnu.org id=B79241.17553270873232 (code B ref 79241); Sat, 16 Aug 2025 06:52:01 +0000 Received: (at 79241) by debbugs.gnu.org; 16 Aug 2025 06:51:27 +0000 Received: from localhost ([127.0.0.1]:40584 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1unAlD-0000q3-6i for submit@debbugs.gnu.org; Sat, 16 Aug 2025 02:51:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42678) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1unAlA-0000ph-ES; Sat, 16 Aug 2025 02:51:25 -0400 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 1unAl5-0005Rj-15; Sat, 16 Aug 2025 02:51:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=l9cbrEwLfjDLv1Vn/EZUcZhlyR3nNTACR12qvaPWc74=; b=PHAH1skPwcIoWcdguopu 4ZxSclb/nFnqinUNSw4G9lRzrMNToo5v1msxQ5b3ysvz1WZRfcZ/egUmVDSzyy9ITY+Yj0upSmIHt jOCCquJnyJ8ZJflVIdMYIKGznOsW1F/AlclpFVqomVPK8BMVHhX3zhcsJ/G4q/5G+xt6QWD+4cVVB DECs7NsDvHzhROYYNnyzJwhHnYyKgpXE4IXwNYXw8ab+qBuEM+WhWf6aMKo3ROZ82y0cFgQVV3lwp hvtBaITmY9C/Ah/1RlDNfIzKcEFbysNc57a0VDZ5uGT3mKhfHp5drv7QyyaMnzxX2DfmBLkstsDxG aamk4FlVV7a6Tg==; Date: Sat, 16 Aug 2025 09:50:57 +0300 Message-Id: <86ikinlpym.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87ectdt28u.fsf@sheepbook.mail-host-address-is-not-set> (message from Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= on Fri, 15 Aug 2025 10:31:29 +0200) References: <87ectdt28u.fsf@sheepbook.mail-host-address-is-not-set> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -3.3 (---) severity 79241 minor thanks > From: Sergio Pastor Pιrez > Date: Fri, 15 Aug 2025 10:31:29 +0200 > > The issue is that `vertical-motion' does not seem to respect goal column > when moving upwards through an overlay that spans multiple visual lines. > > I will give a recipe using the latest version of Flymake, since it's an > easy way to generate an overlay that spawns multiple visual lines, but I > suspect that this issue can be reproduced with any overlay of those > characteristics, and is not a particual issue of Flymake. I've tried to > debug the line movement code but at some point I reached > `vertical-motion', which is a C function, so I didn't debug it further. > Invoking: `(vertical-motion '(0.0 . -1))' is enough to see the behavior > described. > > 1) Install Flymake v1.4.1. (I used Elpaca) > 2) `(setq flymake-show-diagnostics-at-end-of-line 'fancy)` > 3) Go to a buffer where diagnostic will show, I used Eglot for this. > 4) Put the cursor a the beginning of the line prior to the overlay > generated by Flymake. Notice that when using the `'fancy' setting, the > message will span across multiple visual lines. > 5) Try to move upwards, towards the diagnostic. We expect the cursor to > remain at the beggining of the line but instead, it goes to the end of > the line. This behavior does not happen when moving downwards through > the diagnostic message. Thanks. The "beginning of the line" where the Flymake diagnostic is displayed doesn't really exist in the buffer. If you place point at the end of the code line for which Flymake shows a diagnostic and then press C-f, the cursor will jump over all the diagnostic string and land at the beginning of the _following_ line. This is expected, because Emacs cannot place the cursor inside an overlay, not really. Flymake attempts to "fix" that by having the 'cursor' property on the overlay's string, but that only works up to a point. Overlay strings like this with embedded newlines cause a lot of complexity and grief in vertical-motion's implementation, so I'm not surprised that it behaves a bit strangely in this case. The basic requirement from vertical-motion in these cases is not to get stuck around such lines, so that C-n and C-p work reasonably well and allow movement through the buffer, and that does work in this case. So from where I stand, this is a very minor annoyance, nothing more. If someone wants to work on improving the behavior of vertical-motion in these cases, and they do a clean job, such changes will be very welcome, but failing that, I think the current behavior is far from a catastrophe that needs immediate attention. From unknown Sat Sep 06 00:10:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79241: [PATCH] WIP: Fix incorrect handling of overlays in `vertical-motion' References: <87ectdt28u.fsf@sheepbook.mail-host-address-is-not-set> In-Reply-To: <87ectdt28u.fsf@sheepbook.mail-host-address-is-not-set> Resent-From: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Aug 2025 19:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 79241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 79241@debbugs.gnu.org Cc: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= Received: via spool by 79241-submit@debbugs.gnu.org id=B79241.17556313833734 (code B ref 79241); Tue, 19 Aug 2025 19:24:02 +0000 Received: (at 79241) by debbugs.gnu.org; 19 Aug 2025 19:23:03 +0000 Received: from localhost ([127.0.0.1]:54927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uoRvC-0000xv-Mu for submit@debbugs.gnu.org; Tue, 19 Aug 2025 15:23:03 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:50515) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uoRv9-0000xM-Ii for 79241@debbugs.gnu.org; Tue, 19 Aug 2025 15:23:01 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3b9dc5c2f0eso3628862f8f.1 for <79241@debbugs.gnu.org>; Tue, 19 Aug 2025 12:22:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755631372; x=1756236172; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Ng52ypwEKPtxvzFeL6Iu/y4dPoz0xwnELldXbfNIoCM=; b=cUKxgvWQM2J4uvADkCvQHe5GY/S/bs31mGKNNoWHhNJWQ0SC9Ozq5dNL9s9O1gfAwG L4BvRgOKdxV7GJKyMf3yWo9kYbKznFHikiLsVxVZbqQRmm9+9+cXeQHaOihG/Bb4LddS kxrm12cDLrWusCI5jnOhNs3FXYwJ23L1msOg3nLpTbn/Cp4xfnSnZmMkjYGmqV61GOgP K5e0aOhb0iBDegiK7+nh7BANDQfqdxbxQDPk3QoO0wSccvS2Al7RxNyo0LSQHUZY+8LM JIDO5uMsyV/yvGDRlwqopmoKHcZj4SYEfXpWpn0luj4jGnfwT/p5Gah9iEPz/nyCcyD9 Ce7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755631372; x=1756236172; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ng52ypwEKPtxvzFeL6Iu/y4dPoz0xwnELldXbfNIoCM=; b=TIDXWdBw0o/Z9p4qSnrk4knhZ9CUr8P+q49CU6hCUNCh01skDSpH6Y8wXEP0XAlCB+ WEsbQioa95aT46EpZLpkRBD/FAJZw4fwybViVMN3PCGSAGA0jOemdjGQs1fm7pdGnF3+ Qi+gO4ZPY9rnc91KF8u6rHPHHt7B2TbgEwG46yu3In8T/BV96uJyNbTiOwkpqtxMByy8 v7TV/AntpUn7b9TOUuJX978lWOJvzUlFutLlvcuQsleaxdwI5GvkDk3H2wa2t4NVz9lW 11su1YHYqJEV/0DQCHFZWkMjMcLtl5QG7W6nK3pptQfpRZYNmRwA4rpI2/AO9KiJESF7 3MHA== X-Gm-Message-State: AOJu0YwriuTEI4+x7D8diD5Uzjk3wbSibIs30dTbmIV/s5LZI0k1ybM1 3NO03zQzMU8voVWf2J6WdvmCoShuXh2dCVqSOQxsHzGiRTP8/sgMrUb+RC21zw== X-Gm-Gg: ASbGnct3nH3MW2D91C6XW19sJc86a/4g2XcvKdI15c5ceA59gtRNckU5WfOUVRccR4+ XdvfEUj1nfewYvmnrKra0eWw9Aq++32b8KUB4mNpWRXbT8qKqNlWC8YU45o1QM1w62nBZzgDdR+ svKfT9aDX/OiRbyL8rLg+HrtE5rZoL7o0HPrc99kpT9XFQHnZ9wKu+5B94GJ/qfsIB3m2WHMyKb +s2VYjKARwIeIg21IT3rXoiUYFQ4D0TIFNjARatN5ktHrhB6jxn65BNERqA6+U4m2M3Ik3cB7dy K3IZc8nTZJ1XksdSsc4JuX6YnEYdV+JwqCP9R2UuBWVZV/h74ug2EXot1DffbHuont6o56jVc4H S9hLW0RE0CEbqdoGjQ6scWMBHGjh2 X-Google-Smtp-Source: AGHT+IH1O4QosyEbjvhmfaCDVS5OG130YwkmRwTQORT3KFt8/+SY/g9ucAt3vpBRQQMeaAw6+xNkWw== X-Received: by 2002:a05:6000:188f:b0:3b6:d95:a3a4 with SMTP id ffacd0b85a97d-3c32bf5ceaamr86792f8f.4.1755631372333; Tue, 19 Aug 2025 12:22:52 -0700 (PDT) Received: from localhost ([79.117.85.92]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b42a6d7b7sm53933835e9.1.2025.08.19.12.22.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Aug 2025 12:22:51 -0700 (PDT) From: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= Date: Tue, 19 Aug 2025 21:21:58 +0200 Message-ID: <20250819192225.13972-1-sergio.pastorperez@gmail.com> X-Mailer: git-send-email 2.50.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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 (-) FIXME: if multiple lines with multi-line overlays are present, going upwards jumps to the first one of them, instead of the previous line at the right column. * src/indent.c (vertical-motion): Ensure multi-line overlay handling logic captures upward motions. --- src/indent.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/indent.c b/src/indent.c index b4f3c349dc5..c1c32824dad 100644 --- a/src/indent.c +++ b/src/indent.c @@ -2513,15 +2513,16 @@ line (if such column exists on that line, that is). If the line is and then reposition point at the requested X coordinate; if we don't, the cursor will be placed just after the string, which might not be the requested column. */ - if (nlines >= 0 && it.area == TEXT_AREA) + if (nlines != 0 && it.area == TEXT_AREA) { while (it.method == GET_FROM_STRING - && !it.string_from_display_prop_p && memchr (SSDATA (it.string) + IT_STRING_BYTEPOS (it), '\n', SBYTES (it.string) - IT_STRING_BYTEPOS (it))) { - move_it_by_lines (&it, 1); + int direction = (nlines > 0) ? 1 : -1; + + move_it_by_lines (&it, direction); move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X); } } -- 2.50.1 From unknown Sat Sep 06 00:10:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79241: [PATCH] WIP: Fix incorrect handling of overlays in `vertical-motion' Resent-From: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Aug 2025 19:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 79241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 79241@debbugs.gnu.org Cc: Eli Zaretskii Received: via spool by 79241-submit@debbugs.gnu.org id=B79241.17556327107841 (code B ref 79241); Tue, 19 Aug 2025 19:46:02 +0000 Received: (at 79241) by debbugs.gnu.org; 19 Aug 2025 19:45:10 +0000 Received: from localhost ([127.0.0.1]:54971 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uoSGb-00022A-C1 for submit@debbugs.gnu.org; Tue, 19 Aug 2025 15:45:09 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:58867) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uoSGZ-0001wi-1X for 79241@debbugs.gnu.org; Tue, 19 Aug 2025 15:45:08 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-45a1b05fe23so35393935e9.1 for <79241@debbugs.gnu.org>; Tue, 19 Aug 2025 12:45:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755632700; x=1756237500; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=z+5alLghp8Xx7ljtqhL7a646I77+CXER36zk3s05dmo=; b=XqaCbh1x+igmVrhUYxXe4nH+ruCCpjbC54eXNVyZC9OOsttu87A7TppR9zejMRpial 6G0U1jLD9LAfkC3gRcpHJmbfRpxz2mCuN7FSJJs59yjj3VTuJbJLN9G5CJW3xl+NwuJp A36YzeQkT7e4Vprt4Mbn22OPFqg+AznQqeqHVpC/02lrTyaNld/x/hF/PiZzIfTsTj6v yeKO6YV4Y7Li5xnqp8ZUIii0D12dxLpOnPg5M0kjwqXXLznoYwJqpwBZB4JlO01+e8Ks SPlV63Lx4EBvnWgnFGDH3mkc1CSeWTnL3jZCGDcU3UOgtNwDUzy6yPnxqxOme6ZjG9o/ Uu5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755632700; x=1756237500; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=z+5alLghp8Xx7ljtqhL7a646I77+CXER36zk3s05dmo=; b=gL28gnbK2s9OehpRrX1UXkoCCRO3KZ0R2mapmMvIdqN4QzJlNuxhIF2Rp4jyL6DIFW Xl61chSb9qapzPEH9SJkwCun6OnIw2gjjD2EV1mgS+8TSwiSqcGUpErt2fd+227YC0sn O6OvW4d0TqRFQkdfEWn/j4O1q8QqSM0HxfNyC/JifVOjE546olAPWwl41/KcL8vbGsQP 4gw8Pug9i9TQCIjRuBg0ds80I9a/DHc2z8XMsPvgumlx+mBWjCw28M9TZgclq2HBXjr8 k3NZSsLWzGfxCqdISCXQc31Y/mewe0jLFtCtn5PdLxuuEjmSxgr/O+1ba5eOmxyGFHIC Uqwg== X-Gm-Message-State: AOJu0Yyyxi8X5hz5+5fENYuM0fKQq6yhiYg5zsp++EnivV8lwuBdNdJb b6u6da9u2KTxwBUKo5uakiQLNyzieyWlh5ldg2VR1qf/ZXguSHwwZCKg+/wg1Q== X-Gm-Gg: ASbGnctht6r13AyX9NxEmwJb7FdnbVRBPfUKgaT0uaY8ljv0Bn3KdMbMpUzH//iSO12 W2PfJq9jdNgl05K9kLgRmyGCmDx2KIy3xqW5LuKB+qq0y/ELQJFR6m+/mGSa2bFPqpBDHmg3IGI aDP4eflfz7Fcfh5KhFfOYevLnFS/yjxuCf75KsmKl7dikD/JoR4G1PGRkTGgtOc4160SeSg9C0w LMpfQ4zLuHT3GtGTK8k5wbZDyQIrPNdJ7aXkjMuEZ7U3UUvPvbbYivJr2dh5Ijrfpfj3lvkV74C WLYc+CMBKtCozCVQMz3pQtoFKHrxQy+t6dATAm3gbmkcajG7aX3QzsVM2aZkPROaHyiH2p5vARj 9Q9zylKKJr6b4LgALeD3viPLfoOkw X-Google-Smtp-Source: AGHT+IHhjvuDBXRednxGyQjgRZxLuM1BMXyhrSxLXjI63AGrq0Ki3r23qrdvEj35hjZthG+Or3Ib6g== X-Received: by 2002:a05:6000:22c6:b0:3b9:1636:c443 with SMTP id ffacd0b85a97d-3c32ebd9526mr159191f8f.52.1755632699949; Tue, 19 Aug 2025 12:44:59 -0700 (PDT) Received: from localhost ([79.117.89.92]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3c07778939bsm4593471f8f.46.2025.08.19.12.44.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Aug 2025 12:44:59 -0700 (PDT) From: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= In-Reply-To: <20250819192225.13972-1-sergio.pastorperez@gmail.com> References: <87ectdt28u.fsf@sheepbook.mail-host-address-is-not-set> <20250819192225.13972-1-sergio.pastorperez@gmail.com> Date: Tue, 19 Aug 2025 21:44:55 +0200 Message-ID: <87jz2zayfc.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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 (-) Hello! I've debugged the `vertical-motion' procedure and found the troublesome code. This patch solves the issue with the goal column, but it has 1 corner case to that I don't know how to solve. Sergio Pastor P=C3=A9rez writes: > FIXME: if multiple lines with multi-line overlays are present, going > upwards jumps to the first one of them, instead of the previous line at > the right column. > > * src/indent.c (vertical-motion): Ensure multi-line overlay handling > logic captures upward motions. > --- > src/indent.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/src/indent.c b/src/indent.c > index b4f3c349dc5..c1c32824dad 100644 > --- a/src/indent.c > +++ b/src/indent.c > @@ -2513,15 +2513,16 @@ line (if such column exists on that line, that is= ). If the line is > and then reposition point at the requested X coordinate; > if we don't, the cursor will be placed just after the > string, which might not be the requested column. */ > - if (nlines >=3D 0 && it.area =3D=3D TEXT_AREA) > + if (nlines !=3D 0 && it.area =3D=3D TEXT_AREA) > { > while (it.method =3D=3D GET_FROM_STRING > - && !it.string_from_display_prop_p > && memchr (SSDATA (it.string) + IT_STRING_BYTEPOS (it), > '\n', > SBYTES (it.string) - IT_STRING_BYTEPOS (it))) > { > - move_it_by_lines (&it, 1); > + int direction =3D (nlines > 0) ? 1 : -1; > + > + move_it_by_lines (&it, direction); > move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X); > } I don't know what primitives are available to break this loop once the target line has been reached, so what seems to happen is that if there are consecutive lines with multi-line overlays, one after the other, this while loop keeps going until it reaches the first one of them. This is only a problem for the upward motion. Since I did not find a solution, I'm writing this mail in case there is someone more familiar with the code, that knows how we could detect that the while loop should finish in this particular case of consecutive lines with multi-line overlays. In all other cases I've encountered, the patch seems to work well. > } Best regards, Sergio From unknown Sat Sep 06 00:10:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79241: [PATCH] WIP: Fix incorrect handling of overlays in `vertical-motion' Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Aug 2025 10:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 79241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= Cc: 79241@debbugs.gnu.org Received: via spool by 79241-submit@debbugs.gnu.org id=B79241.175568676113741 (code B ref 79241); Wed, 20 Aug 2025 10:46:01 +0000 Received: (at 79241) by debbugs.gnu.org; 20 Aug 2025 10:46:01 +0000 Received: from localhost ([127.0.0.1]:56205 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uogKO-0003ZV-Up for submit@debbugs.gnu.org; Wed, 20 Aug 2025 06:46:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39190) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uogKK-0003Z6-G8 for 79241@debbugs.gnu.org; Wed, 20 Aug 2025 06:45:58 -0400 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 1uogKF-0004F4-2C; Wed, 20 Aug 2025 06:45:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=VcK2GXBt0iVr6ON5zo+h+AOab58sVjoaCKavYPCkO6c=; b=ohK3UfV7pwNEuCdpI5KX T20pCv2v+Jbc0AD7o1DmHpk96gxiIq0ULeAwTw7EN3RLG2Fz/Air6dIH+u3eYNTR0vipgas3LIune 1zUn9QzFtWaMjUZYAwYgb5uP5rmX1W3BTOMn0j11GceyQXNeoB9dhz1tiF2/93XrKk67ynQJTKnw2 xHnKLq2V2JbiaUK4JcVjU16OaJ9OMYD2Y3cHRP/p6Hva4yFGTSPStJjseLPwVxo+NEQJwQYMXbWXc 1uRao/OrOLclPfz2WjWOvLTQtlTIO4LfO8L4pht811TAilKUGb/Q+o6aJt7bRXsQ/CkSugD05DEE8 ACWd8l9ClnGkiw==; Date: Wed, 20 Aug 2025 13:45:49 +0300 Message-Id: <86v7mifezm.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87jz2zayfc.fsf@gmail.com> (message from Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= on Tue, 19 Aug 2025 21:44:55 +0200) References: <87ectdt28u.fsf@sheepbook.mail-host-address-is-not-set> <20250819192225.13972-1-sergio.pastorperez@gmail.com> <87jz2zayfc.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -3.3 (---) > From: Sergio Pastor PΓ©rez > Cc: Eli Zaretskii > Date: Tue, 19 Aug 2025 21:44:55 +0200 > > I've debugged the `vertical-motion' procedure and found the troublesome > code. This patch solves the issue with the goal column, but it has 1 > corner case to that I don't know how to solve. Thanks for working on this. > > --- a/src/indent.c > > +++ b/src/indent.c > > @@ -2513,15 +2513,16 @@ line (if such column exists on that line, that is). If the line is > > and then reposition point at the requested X coordinate; > > if we don't, the cursor will be placed just after the > > string, which might not be the requested column. */ > > - if (nlines >= 0 && it.area == TEXT_AREA) > > + if (nlines != 0 && it.area == TEXT_AREA) > > { > > while (it.method == GET_FROM_STRING > > - && !it.string_from_display_prop_p > > && memchr (SSDATA (it.string) + IT_STRING_BYTEPOS (it), > > '\n', > > SBYTES (it.string) - IT_STRING_BYTEPOS (it))) > > { > > - move_it_by_lines (&it, 1); > > + int direction = (nlines > 0) ? 1 : -1; > > + > > + move_it_by_lines (&it, direction); > > move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X); > > } > > I don't know what primitives are available to break this loop once the > target line has been reached, so what seems to happen is that if there > are consecutive lines with multi-line overlays, one after the other, > this while loop keeps going until it reaches the first one of them. This > is only a problem for the upward motion. Since I did not find a > solution, I'm writing this mail in case there is someone more familiar > with the code, that knows how we could detect that the while loop should > finish in this particular case of consecutive lines with multi-line > overlays. In all other cases I've encountered, the patch seems to work > well. What is the "target line" in this case? how is it defined? and why going all the way till the first line of a multi-line overlay is not TRT in this case? From unknown Sat Sep 06 00:10:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79241: [PATCH] WIP: Fix incorrect handling of overlays in `vertical-motion' Resent-From: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Aug 2025 18:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 79241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 79241@debbugs.gnu.org Received: via spool by 79241-submit@debbugs.gnu.org id=B79241.175571623432619 (code B ref 79241); Wed, 20 Aug 2025 18:58:01 +0000 Received: (at 79241) by debbugs.gnu.org; 20 Aug 2025 18:57:14 +0000 Received: from localhost ([127.0.0.1]:57697 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uonzm-0008U3-8v for submit@debbugs.gnu.org; Wed, 20 Aug 2025 14:57:14 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:59637) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uonzj-0008Tp-GC for 79241@debbugs.gnu.org; Wed, 20 Aug 2025 14:57:13 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3b9e41101d4so155179f8f.2 for <79241@debbugs.gnu.org>; Wed, 20 Aug 2025 11:57:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755716225; x=1756321025; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=sBk05CzvvDeh1xPGkUMnb9QduHWL6K6lGRxaM89Dl3M=; b=Q+V6uF7WuL0oNv55ks0HqKAIVMtLMTCcHL/fB5KNgjzgvUAUjE0WsH4N81SfIDbOig 4DHCfxOalR06JoUvj1CC5MLpIgolhuE1+YrAxxonLkLKWGZribK4zKLsQMucaeUV/keF Qc6RPzPK6Xq6ReMqlQC7c3giWARwlbuTNaecYgley+I178bITKmUaneo+nXSCab3gswm 1W+miJEefC0o6Mg1gcRgE2WFsR/GuZZyV+VHJv5N2sPU9a4VzFsqO3pt11yokOP+tl98 4y6cW/QKwL1b50RFF84vSb+WDLcm4AWzsNe4JlUs2SIoHxXwgOTDojkvNwr8qSd+r3xx i8/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755716225; x=1756321025; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sBk05CzvvDeh1xPGkUMnb9QduHWL6K6lGRxaM89Dl3M=; b=m1uenYdBmaDuMiztyHZeXP6yakqkvNYpN8p0+8PumDe+6RMwAevhLNR98fmrWiPeXd e4uPV1DEztM3xN0+/bZp3/PFx3RIKONDLv5g4NLxlbp3HyYG63VqduoddolUth2Q/lT3 vUBMf9AU7dcQTStXzi1D6tmF/5oIAottfF8hvUW2MJ9RMG15GD4zDdgQF3kWnvq0bAZT fOZ2/vNB/f+XAVabLV6/8YAkPkQfQTRnbAHQ71udH4oD37PP12Z+dhLyTK71dZO0d1UT rcqMlGmS4HfFK7/oUaBqAVoZvpWnQT3T+VjJYbNBahR6yJrdCQgY2FlSjgx0iIDA12/F ez1A== X-Gm-Message-State: AOJu0YzTzCCx7iKHS9iPv9ZNFAdIZY2zFebdz0klI0SWO9C3Hz0/86fM hnRmHDLEIcNUTEpwSmtUrgIi4ZS5WaDVtz8AIolnvi1P4xQ+T4MrL9ng X-Gm-Gg: ASbGncsoYMb8l0fhWz4HZtW4g0QADlQEl7POMc6D6CnzWmZftzWocMpw2MkzxHoO+dh uu2c9Jg5J18qCEAk3tCmrdSW4j5wJ8gVknx8SsizxgCIC0wwTOWiwvSKBe1Ga7UF0npdFCo0UcH yamOK+7p8cgPYKX/QILiHNAzC2z7gM2BvP+NQ2hgmoGqWPhfUrFRSr9PpawAEm06Td68A+mH0Yy qzGd7R5qZ36SQBrwF190vEdGTYt/5adACGUu+bEGZ/mZYyJ+6hTFOVI2Y56ygyImBrIMnOrt2tA gCrx14vHQIcbq2DvZKL5SWYKyxDlYsKeFvvGF9Sv4ZAPaXMn19+pBnUKC7Qq+eE7fjHGwWQQ9Bi 71z6DOuA6OVoLhMCneFnOtY2m6MDU X-Google-Smtp-Source: AGHT+IFeUBWuU1dJ+RaHksmKzumNA+sLFU3Iqdz2EQvkKJpOKvHTr+ZnnhU7mhGrTjUs5Vri+ddOaQ== X-Received: by 2002:a05:6000:2c07:b0:3c3:a80d:2bbd with SMTP id ffacd0b85a97d-3c3a80d30cemr2048225f8f.58.1755716225025; Wed, 20 Aug 2025 11:57:05 -0700 (PDT) Received: from localhost ([79.117.89.92]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3c077789c2asm9195479f8f.57.2025.08.20.11.57.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Aug 2025 11:57:04 -0700 (PDT) From: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= In-Reply-To: <86v7mifezm.fsf@gnu.org> References: <87ectdt28u.fsf@sheepbook.mail-host-address-is-not-set> <20250819192225.13972-1-sergio.pastorperez@gmail.com> <87jz2zayfc.fsf@gmail.com> <86v7mifezm.fsf@gnu.org> Date: Wed, 20 Aug 2025 20:57:02 +0200 Message-ID: <877byxyg75.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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 (-) Eli Zaretskii writes: >> > --- a/src/indent.c >> > +++ b/src/indent.c >> > @@ -2513,15 +2513,16 @@ line (if such column exists on that line, that= is). If the line is >> > and then reposition point at the requested X coordinate; >> > if we don't, the cursor will be placed just after the >> > string, which might not be the requested column. */ >> > - if (nlines >=3D 0 && it.area =3D=3D TEXT_AREA) >> > + if (nlines !=3D 0 && it.area =3D=3D TEXT_AREA) >> > { >> > while (it.method =3D=3D GET_FROM_STRING >> > - && !it.string_from_display_prop_p >> > && memchr (SSDATA (it.string) + IT_STRING_BYTEPOS (it), >> > '\n', >> > SBYTES (it.string) - IT_STRING_BYTEPOS (it))) >> > { >> > - move_it_by_lines (&it, 1); >> > + int direction =3D (nlines > 0) ? 1 : -1; >> > + >> > + move_it_by_lines (&it, direction); >> > move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X); >> > } >>=20 >> I don't know what primitives are available to break this loop once the >> target line has been reached, so what seems to happen is that if there >> are consecutive lines with multi-line overlays, one after the other, >> this while loop keeps going until it reaches the first one of them. This >> is only a problem for the upward motion. Since I did not find a >> solution, I'm writing this mail in case there is someone more familiar >> with the code, that knows how we could detect that the while loop should >> finish in this particular case of consecutive lines with multi-line >> overlays. In all other cases I've encountered, the patch seems to work >> well. > > What is the "target line" in this case? how is it defined? and why > going all the way till the first line of a multi-line overlay is not > TRT in this case? I may have not express myself correctly, I will give you an example to clarify what I meant. Let's understand as real lines the ones that are numbered, and as visual overlays the others: --8<---------------cut here---------------start------------->8--- 43 QStringList getPlasmaStyles(void); =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80 ccls [2]: unkn= own type name 'QStringList' 44 QStringList getColorSchemes(void); =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80 ccls [2]: unkn= own type name 'QStringList' 45 QStringList getIconThemes(void); =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80 ccls [2]: unkn= own type name 'QStringList' 46 QStringList getCursorThemes(void); =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80 ccls [2]: unkn= own type name 'QStringList' 47 QStringList getGtkThemes(void); =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80 ccls [2]: unkn= own type name 'QStringList' 48 QStringList getKvantumStyles(void); =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80 ccls [2]: unkn= own type name 'QStringList' <|> --8<---------------cut here---------------end--------------->8--- In the previous example, `<|>' represents the point. In this situation, with the patch I provided, issuing `(vertical-motion '(4 . -1))' will move the point to column 4 of line 43, when the point should land on column 4 of line 48. To clarify, in my previous message I did not meant that chained multi-line overlays should not be skipped, I meant that when there are multiple real lines, having multi-line overlays one after the other, the point should not go over them. For that, I think we need the while loop to stop iterating somehow. We need a way to know if point is outside of the overlay and break the loop. If that's not possible, maybe there is a way to know if we are already in the target line? From unknown Sat Sep 06 00:10:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79241: [PATCH] WIP: Fix incorrect handling of overlays in `vertical-motion' Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Aug 2025 12:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 79241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= Cc: 79241@debbugs.gnu.org Received: via spool by 79241-submit@debbugs.gnu.org id=B79241.175595192919175 (code B ref 79241); Sat, 23 Aug 2025 12:26:01 +0000 Received: (at 79241) by debbugs.gnu.org; 23 Aug 2025 12:25:29 +0000 Received: from localhost ([127.0.0.1]:39001 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1upnJI-0004zB-38 for submit@debbugs.gnu.org; Sat, 23 Aug 2025 08:25:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43350) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1upnJF-0004yu-83 for 79241@debbugs.gnu.org; Sat, 23 Aug 2025 08:25:26 -0400 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 1upnJ9-0008Rf-V8; Sat, 23 Aug 2025 08:25:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=O7pK24K+9e3O02rtEHmM8vYWUWum9KhqAxSZxgIWrlU=; b=FilR3lrstGKXEg2iTj/O o15h2cvF9sQXa18ExhvNuK8jQN3RbqF4v/Pu7+HO1jUeuD3/pQ6PlJrxFa9o8IQqdHqaTiVh7guMa 1EWKrd9VtPYSRNou123Ku/aS01yBIkwjmxVGBaVFkztTagByB9AiqeyETGIoXXi6Z1HQ+S+6hg7Sm VhXl6IBOTvmDQeOzftxUT031XnFAORu8jg1j0kxm2H+0cW9xPQlCINCh5EomPyLbP1xCHXt02PlUp edPqD4fPxQPAztLJZS6Ugmr4SCXDjuGHG1i+BNbNbnIfJKE87wlkvSU/2qdWJi9sr1RerujGr8O12 pWTOMdoycoo/Pg==; Date: Sat, 23 Aug 2025 15:25:08 +0300 Message-Id: <86349ib4yj.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <877byxyg75.fsf@gmail.com> (message from Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= on Wed, 20 Aug 2025 20:57:02 +0200) References: <87ectdt28u.fsf@sheepbook.mail-host-address-is-not-set> <20250819192225.13972-1-sergio.pastorperez@gmail.com> <87jz2zayfc.fsf@gmail.com> <86v7mifezm.fsf@gnu.org> <877byxyg75.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -3.3 (---) > From: Sergio Pastor PΓ©rez > Cc: 79241@debbugs.gnu.org > Date: Wed, 20 Aug 2025 20:57:02 +0200 > > Eli Zaretskii writes: > > >> > --- a/src/indent.c > >> > +++ b/src/indent.c > >> > @@ -2513,15 +2513,16 @@ line (if such column exists on that line, that is). If the line is > >> > and then reposition point at the requested X coordinate; > >> > if we don't, the cursor will be placed just after the > >> > string, which might not be the requested column. */ > >> > - if (nlines >= 0 && it.area == TEXT_AREA) > >> > + if (nlines != 0 && it.area == TEXT_AREA) > >> > { > >> > while (it.method == GET_FROM_STRING > >> > - && !it.string_from_display_prop_p > >> > && memchr (SSDATA (it.string) + IT_STRING_BYTEPOS (it), > >> > '\n', > >> > SBYTES (it.string) - IT_STRING_BYTEPOS (it))) > >> > { > >> > - move_it_by_lines (&it, 1); > >> > + int direction = (nlines > 0) ? 1 : -1; > >> > + > >> > + move_it_by_lines (&it, direction); > >> > move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X); > >> > } > >> > >> I don't know what primitives are available to break this loop once the > >> target line has been reached, so what seems to happen is that if there > >> are consecutive lines with multi-line overlays, one after the other, > >> this while loop keeps going until it reaches the first one of them. This > >> is only a problem for the upward motion. Since I did not find a > >> solution, I'm writing this mail in case there is someone more familiar > >> with the code, that knows how we could detect that the while loop should > >> finish in this particular case of consecutive lines with multi-line > >> overlays. In all other cases I've encountered, the patch seems to work > >> well. > > > > What is the "target line" in this case? how is it defined? and why > > going all the way till the first line of a multi-line overlay is not > > TRT in this case? > > I may have not express myself correctly, I will give you an example to > clarify what I meant. Let's understand as real lines the ones that are > numbered, and as visual overlays the others: > --8<---------------cut here---------------start------------->8--- > 43 QStringList getPlasmaStyles(void); > └────────────────────────────── ccls [2]: unknown type name 'QStringList' > 44 QStringList getColorSchemes(void); > └────────────────────────────── ccls [2]: unknown type name 'QStringList' > 45 QStringList getIconThemes(void); > └────────────────────────────── ccls [2]: unknown type name 'QStringList' > 46 QStringList getCursorThemes(void); > └────────────────────────────── ccls [2]: unknown type name 'QStringList' > 47 QStringList getGtkThemes(void); > └────────────────────────────── ccls [2]: unknown type name 'QStringList' > 48 QStringList getKvantumStyles(void); > └────────────────────────────── ccls [2]: unknown type name 'QStringList' > <|> > --8<---------------cut here---------------end--------------->8--- > > In the previous example, `<|>' represents the point. > > In this situation, with the patch I provided, issuing > `(vertical-motion '(4 . -1))' will move the point to column 4 of line > 43, when the point should land on column 4 of line 48. If you test the conditions of the while-loop between the call to move_it_by_lines and the following call to move_it_in_display_line,m wouldn't you be able to stop at line 48? AFAIU, the overlay string is placed on the end of the code line whose diagnostic it shows, so the character at BOL doesn't have the overlay, and you should be able to break the loop when you want. Or am I missing something? > To clarify, in my previous message I did not meant that chained > multi-line overlays should not be skipped, I meant that when there are > multiple real lines, having multi-line overlays one after the other, the > point should not go over them. For that, I think we need the while loop > to stop iterating somehow. We need a way to know if point is outside of > the overlay and break the loop. If that's not possible, maybe there is a > way to know if we are already in the target line? You know when the iterator is outside of the overlay by examining it.method and the other stuff. A real line will should GET_FROM_BUFFER there, because what you have at BOL of a real line is buffer text, not an overlay. From unknown Sat Sep 06 00:10:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79241: [PATCH v2] Fix incorrect handling of overlays in `vertical-motion' References: <87ectdt28u.fsf@sheepbook.mail-host-address-is-not-set> In-Reply-To: <87ectdt28u.fsf@sheepbook.mail-host-address-is-not-set> Resent-From: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Aug 2025 11:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 79241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 79241@debbugs.gnu.org Cc: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= Received: via spool by 79241-submit@debbugs.gnu.org id=B79241.175603402114765 (code B ref 79241); Sun, 24 Aug 2025 11:14:02 +0000 Received: (at 79241) by debbugs.gnu.org; 24 Aug 2025 11:13:41 +0000 Received: from localhost ([127.0.0.1]:43930 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uq8fN-0003q5-Eh for submit@debbugs.gnu.org; Sun, 24 Aug 2025 07:13:41 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:54365) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uq8fK-0003pn-CC for 79241@debbugs.gnu.org; Sun, 24 Aug 2025 07:13:38 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3c6743a10e3so1100606f8f.0 for <79241@debbugs.gnu.org>; Sun, 24 Aug 2025 04:13:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1756034011; x=1756638811; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=LKEhAY9MDDNRPEWTHWTCW61IG1KNWV7nOTS87ReYsBw=; b=AvwC1Uv/QLWQ0/vNsHiIGOKB346bmThMLSZwylCeCG5PwLsQL2oQByeaOx4lPr+cZ1 qb3+4CWLESRr2kEnQ6q/RDW190FTAP2ijYTCv4Axos6bGgZ+jo8+j4eD/K8e4OF0qodh cJwTPd8df1YyiOBsg/+RyOyPmnmPK+OeZZX89NgQo4QwFnWWNuIJcQtGvZD1sdPoW2cx kGL9ycnm5FA7GumnIZiwq4OGrmOBdz9TALpGEd3xwhzfLgs9IRP8zg7yJTCofKtdDRCu LSzwi8yiUb5ZIHA5RfGsgshZLy6KCGhaPfDWsBPQwqdkPgKMB6ZoPNNkipX+XqBwkDTR PXEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756034011; x=1756638811; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LKEhAY9MDDNRPEWTHWTCW61IG1KNWV7nOTS87ReYsBw=; b=l/VBouhl+ZMLD5DlUXywwYSXMZ8Xz4jKvOMTDFgE4MbGKqRbVqtX+3JNjbe2DxRAYK bzUIFGd/Z0o27j3OrR+ek6qrWNSGOcWluK7MXhMJHVyOl0XbxmgkCl6XB8eNbC+PkHqJ my5nXMz6PyMmSszTcD8p4EyQYVQDAVbUuVFCRLsCP5y891xN/Q3F4LFJ8THonmqU+/OR Q5FdmPXhWeapX30KNFLaQZVGtYd96T5bPSA56bYqG7emX/wVRga4LHAEynL9Qphdgwp9 bAPYAGIs+57/bYblT7h34P2gdQglM49hFUUtPRqA3rfj68+DrQJpvbJ92VlRWF7ZYVY8 zQeQ== X-Gm-Message-State: AOJu0YwezxtRLrQrjoFJU9syhszL2VY2FYkVpLe4nxzicQ19tyhNzSso 5+NN6WhyQerTUZfSVf8LltjkEGztBT0q/zuLASCjIRucgplJVUqmJrEVlmazmg== X-Gm-Gg: ASbGncszhGFEhRCOW0Ala8wEISh0lXIuNoyxoGkZ6oti2cUF4tD3IL1TBW8PN0WT+ed Jx6izVF/7LGoh+LKi9ixsGyvKzPaXfI00xbvS2X24gtCqUEIl97OvEULiXoUHOd3x1y0rOkiAWm BGtU+hTUaGhi8osHCaw4xNUUfaDWa4sFM63kI2C1N28KlvJXC0+a7Jga0vqklPveC5YThqrlbuJ oC08RaX17v6cjdUcSVrLXzQRFHJQfaD4bl/KT4PlZ3QaIqh4dOx3cRD4ht8nW1XqNSu1Ygt24qN sqnQU0CtxwzMd7wG/oRkiTdmEAujgX3t7lF9pqB6/9wOqY5GP3w1BzSiB6fU0j1JYIqFcscGX2p Ob0NcO2SW8X7s5yFzxlXFet/YZuIXfJFDvuw0 X-Google-Smtp-Source: AGHT+IGYjV/yhVcBADsgMGHp8pfFt3lrD6xnXSofGrkukTB+h6UtuvtMgKuv1Muh4/jk6VREg1UVmw== X-Received: by 2002:a05:6000:250e:b0:3b7:8268:8335 with SMTP id ffacd0b85a97d-3c5dcc0dd86mr6868930f8f.42.1756034010939; Sun, 24 Aug 2025 04:13:30 -0700 (PDT) Received: from localhost ([2a0c:5a85:d20b:2b00:2040:f871:fbca:fa67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3c70e4b9e2asm7586159f8f.6.2025.08.24.04.13.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Aug 2025 04:13:30 -0700 (PDT) From: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= Date: Sun, 24 Aug 2025 13:13:01 +0200 Message-ID: <20250824111320.10695-1-sergio.pastorperez@gmail.com> X-Mailer: git-send-email 2.51.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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 (-) * src/indent.c (vertical-motion): If point is inside an overlay, reset it to the beginning of line before trying to reach goal column. This prevents point from being stuck at the beginning of overlay strings during upward motions. --- src/indent.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/indent.c b/src/indent.c index b4f3c349dc5..01865c1494f 100644 --- a/src/indent.c +++ b/src/indent.c @@ -2506,6 +2506,9 @@ line (if such column exists on that line, that is). If the line is an addition to the hscroll amount. */ if (!NILP (lcols)) { + if (it.method == GET_FROM_STRING) + reseat_at_previous_visible_line_start(&it); + move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X); /* If we find ourselves in the middle of an overlay string which includes a newline after current string position, -- 2.51.0 From unknown Sat Sep 06 00:10:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79241: [PATCH] WIP: Fix incorrect handling of overlays in `vertical-motion' Resent-From: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Aug 2025 11:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 79241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 79241@debbugs.gnu.org Received: via spool by 79241-submit@debbugs.gnu.org id=B79241.175603429515719 (code B ref 79241); Sun, 24 Aug 2025 11:19:01 +0000 Received: (at 79241) by debbugs.gnu.org; 24 Aug 2025 11:18:15 +0000 Received: from localhost ([127.0.0.1]:43953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uq8jn-00045T-Er for submit@debbugs.gnu.org; Sun, 24 Aug 2025 07:18:15 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:43336) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uq8jl-00045C-4m for 79241@debbugs.gnu.org; Sun, 24 Aug 2025 07:18:13 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-45a15fd04d9so29941855e9.1 for <79241@debbugs.gnu.org>; Sun, 24 Aug 2025 04:18:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1756034287; x=1756639087; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=3ydFGyePiZD397+yK0O7NrZPgIRL3rphmTY4mbieMJw=; b=EO7u2iLTqwPhGmTL50ndC/3yjQuNK+90acjzu7AIu1r2sbVbICBbipfkhpnWguLUhq xEWSRzS69erN79rGJ7o4xZMK0mZUFo7q+v6IZwOGRoyc4k9rVV3dRYewSWAXfhkPFyHl ltlxPA9Eo9QTPIvxyPBsGrJp/LNitkcJQm6/BVvg7EPxpQ1XIfMkYpVmC546ydxs1dqI h7O6ExS8QVJPcqsmp/Jo53cnS56D+30w8n8EDlIhdX3Gb9LJVLIoR6ybQ/TLx4XCw3Sa xufZMU9FUEHOx3Yp79a9pdEKJcQSAzLMMu2nfp+09+u5hRwJjdDK8rHH6JPq5+h64QcN RaDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756034287; x=1756639087; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=3ydFGyePiZD397+yK0O7NrZPgIRL3rphmTY4mbieMJw=; b=iMqoFqUpOsCYWFAjx9m1qwitCAMquwqCI8kRBDVh1TjCreb6Ferd+6JeT4BfYKbyYz UaUhAPYTY7vLFfw06r3p9AE74bV0wbnK7zZ5nUzDu+BuOlOUJIgMTBKNSO+osGtF3FwO HJkhwL4pP/lvBa9oIgHbzoP9Y/oz5uGpVZoIJ4fOZBxructwcIEaZXBln/LpplIqgSxw j1L4y/tP86KuG0JypNDKCbcoyqo42V4rl9FrgSImN2fpvIC9UQaSD0EW4NiLtNaFt0n2 tNvkIy9LkENgc4/Fmdd9BRJ/ugvMAkoQSsRpJHbIgbtlE3HC3PvzEZK1RD8yqde49WVu hl5Q== X-Gm-Message-State: AOJu0Yw7z0N7mSkvdlCvW0nna5CYvcyA+F8PywxCDaOhMoPiarqnNmXH Bi7WquP7/RkyYgjy1VfB7rAPhDBZi9u0YuJAEP2SboPjSbF78wC9CMt0RqbFjQ== X-Gm-Gg: ASbGncstflRg9U+JNEKyZ1fhOIMsAq/mUnjJAr5V+8VdVbRyCLqgIhQ7+4lrSeKM2Zp drJAZQeYP5a3iPPDFgo7DXPeKxKC7y1Wl/iyhocyaq/7qLV3Z9kxRfK4A+6sk+5anNCqM1nPKr+ ALAHvWDF0OnRmMbxHwOnfh4V5uBYtG2spKed9PAqytCKN2DP2GJZVEKx4525lXYXCia7wA9etsc j7RpTZ68+M0jtGwHIXroOb+ZJX1XQikbp5196MzTJrB17Jhtt/r7EhWuFE65gkyIzf2yzTFYZA+ Y2iKJbjPXneH4YUH4u7gloirAZM/4bRgfo5MOkq+nDU+ejDDecy2HrQUkGSG0sVZpnYFj2WgwON yqzXvspXKc0fHYE645ZLh67/bN7+rmeV5dcXDgaDDMq0SLQ== X-Google-Smtp-Source: AGHT+IHj7gGhtl0/6ocTQjL2m3dslo86zNA8HueNW1I5PFQ4pbKKmEaE+I1Z6jfGqsF8cOj6JSrssg== X-Received: by 2002:a05:600c:4683:b0:459:443e:b18a with SMTP id 5b1f17b1804b1-45b51798ef1mr71708505e9.14.1756034286618; Sun, 24 Aug 2025 04:18:06 -0700 (PDT) Received: from localhost ([2a0c:5a85:d20b:2b00:2040:f871:fbca:fa67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b5753adf7sm66607135e9.7.2025.08.24.04.18.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Aug 2025 04:18:05 -0700 (PDT) From: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= In-Reply-To: <86349ib4yj.fsf@gnu.org> References: <87ectdt28u.fsf@sheepbook.mail-host-address-is-not-set> <20250819192225.13972-1-sergio.pastorperez@gmail.com> <87jz2zayfc.fsf@gmail.com> <86v7mifezm.fsf@gnu.org> <877byxyg75.fsf@gmail.com> <86349ib4yj.fsf@gnu.org> Date: Sun, 24 Aug 2025 13:18:05 +0200 Message-ID: <874itx7ytu.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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 (-) Hello, Eli. I've debugged a bit more this issue, I've found an easy solution (2 lines of code) that solves both issues, reaching the goal column and not skipping lines. I just sent the v2 of the patch. Please take a look! Best regards, Sergio From unknown Sat Sep 06 00:10:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79241: [PATCH v2] Fix incorrect handling of overlays in `vertical-motion' Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Aug 2025 11:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 79241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= Cc: 79241@debbugs.gnu.org Received: via spool by 79241-submit@debbugs.gnu.org id=B79241.175603486717615 (code B ref 79241); Sun, 24 Aug 2025 11:28:02 +0000 Received: (at 79241) by debbugs.gnu.org; 24 Aug 2025 11:27:47 +0000 Received: from localhost ([127.0.0.1]:43979 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uq8t0-0004a2-JO for submit@debbugs.gnu.org; Sun, 24 Aug 2025 07:27:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33658) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uq8sy-0004Zm-RV for 79241@debbugs.gnu.org; Sun, 24 Aug 2025 07:27:45 -0400 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 1uq8st-0000Jo-Gj; Sun, 24 Aug 2025 07:27:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=EO4ssntRvvpLrZnpZY7pZjR3fVIGOQXw63UvX5WZzRc=; b=KbvepHX7XN34zUgy1OWA qK8lHq2uPkB4pwd36VQmdMX3sKdKXPQbQJTDtHyDrDZpQb+VeeGjPHDJe+Wd5caVILdE0S+ViascG e27vGj4SqYmob4wenh/RZ7VUsaU/y8SsTo4hEP/gHI2vRafi9KDmq3/VOsBBELxitgThzEzxR+agn EdZaBWk1/OS3y6/UNb7ClYDbr18KVo0/+N0rriom7XoqvuADwjTD1ykQSedBiLzSxylvmwNmmQ9vE UZJ4y1XBL2It67BAiHnRc7RWVG5fe9iw5evmtYoKZHJtIB+HSp1YYMT7Uwi0x24gPtZUG4hTLS2ky KXNDGs8bpapa5w==; Date: Sun, 24 Aug 2025 14:27:32 +0300 Message-Id: <86ldn96jtn.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <20250824111320.10695-1-sergio.pastorperez@gmail.com> (message from Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= on Sun, 24 Aug 2025 13:13:01 +0200) References: <87ectdt28u.fsf@sheepbook.mail-host-address-is-not-set> <20250824111320.10695-1-sergio.pastorperez@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -3.3 (---) > Cc: Sergio Pastor Pιrez > From: Sergio Pastor Pιrez > Date: Sun, 24 Aug 2025 13:13:01 +0200 > > * src/indent.c (vertical-motion): If point is inside an overlay, reset > it to the beginning of line before trying to reach goal column. This > prevents point from being stuck at the beginning of overlay strings > during upward motions. > --- > src/indent.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/src/indent.c b/src/indent.c > index b4f3c349dc5..01865c1494f 100644 > --- a/src/indent.c > +++ b/src/indent.c > @@ -2506,6 +2506,9 @@ line (if such column exists on that line, that is). If the line is > an addition to the hscroll amount. */ > if (!NILP (lcols)) > { > + if (it.method == GET_FROM_STRING) > + reseat_at_previous_visible_line_start(&it); > + > move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X); > /* If we find ourselves in the middle of an overlay string > which includes a newline after current string position, Is this needed only for overlays? What about 'display' text properties? (There are also other cases when it.method could be GET_FROM_STRING.) If this is only for overlay strings, we need to use if (it.method == GET_FROM_STRING && !NILP (it.from_overlay)) instead. Please test this at least with 'display' property strings instead of overlay strings, and see if the same problem happens in that case. Then we will be able to decide how to write the condition in this case. Thanks. From unknown Sat Sep 06 00:10:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79241: [PATCH v2] Fix incorrect handling of overlays in `vertical-motion' Resent-From: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Aug 2025 18:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 79241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 79241@debbugs.gnu.org Received: via spool by 79241-submit@debbugs.gnu.org id=B79241.17560583505324 (code B ref 79241); Sun, 24 Aug 2025 18:00:03 +0000 Received: (at 79241) by debbugs.gnu.org; 24 Aug 2025 17:59:10 +0000 Received: from localhost ([127.0.0.1]:46450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uqEzl-0001Nm-4R for submit@debbugs.gnu.org; Sun, 24 Aug 2025 13:59:09 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:54574) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uqEzZ-0001Mw-I3 for 79241@debbugs.gnu.org; Sun, 24 Aug 2025 13:59:05 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-45a1b05ac1eso20065235e9.1 for <79241@debbugs.gnu.org>; Sun, 24 Aug 2025 10:58:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1756058330; x=1756663130; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=V55aENxqf+pnOagnBYPKXcYTxUMWweIrKoQPFhtciGI=; b=ZZGR5yy6oM2Mfe77VTnYbMZceytjILA307BWTsTf3OYwykufKQWl4ZDExireDlHhEX o1igdM0PZWpVvhUMQPRb0MB6Cxgo9QcSV7uL3TqcSsQ+iFK4B0l/Tert6PR8EiAeoC9i BybfBXP79ptiMWt+0P9f6EsElVOcyEFc0QrqDpQnGNPIut523CtkyV06BvVZoCC1d5Vk XF22PdEPnZ/rEqYVnfYF2jCIqmjH+gHmW/ExJIA4Hmaqa4tat2kKDwwoAe1FyGTZbtzp bO92LZ6AIeucC/XSfXyoz1UzHdocmNcsajPTgraNzaCSBbplmNM2DskcnEMwIxalya4D pffw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756058330; x=1756663130; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=V55aENxqf+pnOagnBYPKXcYTxUMWweIrKoQPFhtciGI=; b=ZHgV9h1lGf/wZIKMOEkkVL9TjIPOrR+dKYSe5F2p5G9FJvruq4oyAKKPzmTdrNp3bv 4YkI7g/S8Nam+DMjoWXBIHxo5n8r5EO//evaCeELWtaKZpRpfsXwiMbtUbdDvGW4FQMK uLRF38ADKf3JkGQzmIgOaT9lZ4xpYZgTiyf6pVpoyn4onuBIzSNgiq7o9p7/Jry2uhYS GiVg00hMLAV9HcgohMoc5C7XNs0Nc7+Cv8KNLkjRogV7baF8bj9M92slWnnMtotqUhyh TFnbtQS9K4dMZvtB3E5815NL4YiLAAMghDjzoC3MlIp0ekYK1x38LDEIvAG+4Y3CNzWx 2cxA== X-Gm-Message-State: AOJu0YxDGRtyaTqJWkIsIf4shitNWTuAkDFoOJnf243BIIe1eb9UThs1 542NV7b71XnqOTD5Wx++ZXo6STuFpuvugCC5cx8U5tSuOUvzbZUbxAT4ZxFwTg== X-Gm-Gg: ASbGnctN60qOZFLcgcvArZwLdjNstnlBXx2P/HzzC/d+e1uiywy8vm70hlC/nTFkiKB eOcaKGzp5KlhEH91gnQyRs0TUM/zSPqSQgTOeuJx+Zn45O+cMQXB38zoTL2X28mEYzqyv1V9zyW A+WqueANNsoOhulWYS4ekNeuqgqUmVvXh4dRNLMpNUjhHMTnLYmSqRuzVpD0a1bSKyjLrPaeQAO LdfvuXjQubqcgLBJBQJdOus6yNmF+EZmH5nNlriruVR1OqF7BKhWEqXGzwG85iQbcGV3596pmnz qhqekvMXef2Zq6ErIrTkGbw85CO0YNblYlhWWN/+U62WH3fGs7zE5PQlR4rYi78RdPOyZ2tQTu4 9CF2yHyFHGUnZy43guHYcegV4UIXsOLmyyO00 X-Google-Smtp-Source: AGHT+IGomaRjCsn3I7KYgodAPpjr6q+f8V/J9I+vGnEGhuurI1nYzklQ/7eWrf2OC/cucfeqhf8blw== X-Received: by 2002:a05:600c:630c:b0:456:2b4d:d752 with SMTP id 5b1f17b1804b1-45b517cfe7dmr72828705e9.20.1756058329380; Sun, 24 Aug 2025 10:58:49 -0700 (PDT) Received: from localhost ([2a0c:5a85:d20b:2b00:2040:f871:fbca:fa67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b5744a610sm78470135e9.10.2025.08.24.10.58.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Aug 2025 10:58:48 -0700 (PDT) From: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= In-Reply-To: <86ldn96jtn.fsf@gnu.org> References: <87ectdt28u.fsf@sheepbook.mail-host-address-is-not-set> <20250824111320.10695-1-sergio.pastorperez@gmail.com> <86ldn96jtn.fsf@gnu.org> Date: Sun, 24 Aug 2025 19:58:47 +0200 Message-ID: <87ldn8eh48.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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 (-) Eli Zaretskii writes: >> Cc: Sergio Pastor P=C3=A9rez >> From: Sergio Pastor P=C3=A9rez >> Date: Sun, 24 Aug 2025 13:13:01 +0200 >>=20 >> * src/indent.c (vertical-motion): If point is inside an overlay, reset >> it to the beginning of line before trying to reach goal column. This >> prevents point from being stuck at the beginning of overlay strings >> during upward motions. >> --- >> src/indent.c | 3 +++ >> 1 file changed, 3 insertions(+) >>=20 >> diff --git a/src/indent.c b/src/indent.c >> index b4f3c349dc5..01865c1494f 100644 >> --- a/src/indent.c >> +++ b/src/indent.c >> @@ -2506,6 +2506,9 @@ line (if such column exists on that line, that is)= . If the line is >> an addition to the hscroll amount. */ >> if (!NILP (lcols)) >> { >> + if (it.method =3D=3D GET_FROM_STRING) >> + reseat_at_previous_visible_line_start(&it); >> + >> move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X); >> /* If we find ourselves in the middle of an overlay string >> which includes a newline after current string position, > > Is this needed only for overlays? What about 'display' text > properties? (There are also other cases when it.method could be > GET_FROM_STRING.) If this is only for overlay strings, we need to use > > if (it.method =3D=3D GET_FROM_STRING && !NILP (it.from_overlay)) > > instead. Please test this at least with 'display' property strings > instead of overlay strings, and see if the same problem happens in > that case. Then we will be able to decide how to write the condition > in this case. So I've tested this behavior with this display property: --8<---------------cut here---------------start------------->8--- (let* ((start (point)) (end (1+ (point))) (ov (make-overlay start end))) (overlay-put ov 'display "--->HELLO\nAnother message\nDONE<---")) --8<---------------cut here---------------end--------------->8--- I've noticed that *without* applying the patch, there is some unexpected behavior in the vertical line movement. With the v2 patch applied this is partially corrected so it seems some fix is needed for 'display' text properties as well. Example test: --8<---------------cut here---------------start------------->8--- 8 Permission is granted to copy, --->HELLO Another message DONE<---istribute and/or modify this 9 document<|> under the terms of the GNU Free Documentation License, 10 Version 1.3 or any later version published by the Free Software --8<---------------cut here---------------end--------------->8--- Without the patch going up 1 line goes to: --8<---------------cut here---------------start------------->8--- 8 Permission is granted to copy, --->HELLO Another message DONE<---istri<|>bute and/or modify this 9 document under the terms of the GNU Free Documentation License, 10 Version 1.3 or any later version published by the Free Software --8<---------------cut here---------------end--------------->8--- And the next up goes somewhere to line 7 which is very unexpected since going downwards from line 7 passes through the 'Permissions' and 'distribute' words. *With* the patch, the behavior is partially corrected, this is what happens: --8<---------------cut here---------------start------------->8--- 8 Permission is granted to copy, --->HELLO Another message DONE<---istribute and/or modify this 9 document<|> under the terms of the GNU Free Documentation License, 10 Version 1.3 or any later version published by the Free Software --8<---------------cut here---------------end--------------->8--- Going upwards 1 line leads point to: --8<---------------cut here---------------start------------->8--- 8 Permissi<|>on is granted to copy, --->HELLO Another message DONE<---istribute and/or modify this 9 document under the terms of the GNU Free Documentation License, 10 Version 1.3 or any later version published by the Free Software --8<---------------cut here---------------end--------------->8--- If point where to be here: --8<---------------cut here---------------start------------->8--- 8 Permission is granted to copy, --->HELLO Another message DONE<---istri<|>bute and/or modify this 9 document under the terms of the GNU Free Documentation License, 10 Version 1.3 or any later version published by the Free Software --8<---------------cut here---------------end--------------->8--- Going upwards 1 line leads point here: --8<---------------cut here---------------start------------->8--- 8 Permissi<|>on is granted to copy, --->HELLO Another message DONE<---istribute and/or modify this 9 document under the terms of the GNU Free Documentation License, 10 Version 1.3 or any later version published by the Free Software --8<---------------cut here---------------end--------------->8--- This is very cumbersome to explain by text, so I encourage you to try it out if you have time. I think the ideal behavior would be to not skip passing through 'distribute' when going upwards, as it does in a downwards motion. I don't know how to make it not skip that line, but I can tell you that what's happening is that, when going upwards from line 9 towards 8, point reaches the 'distribute' word in the virtual line, and then the `reseat_at_previous_visible_line_start(&it)' moves point to 'bol' of line 8, before going to goal column in line 8. I think what we really want is to detect that there is a multi-line display text property before point in the virtual line, and not trigger the `reseat_at_previous_visible_line_start(&it)' when going from line 9 to the 'distribute' word. But, if we are already in the line of the 'distribute' word, keep the behavior of the patch. Let me know if you have any idea for how to archive this result. I apologize for the convoluted example, I could not think of a clearer way to describe the behavior by text! From unknown Sat Sep 06 00:10:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79241: [PATCH v2] Fix incorrect handling of overlays in `vertical-motion' Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Aug 2025 18:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 79241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= Cc: 79241@debbugs.gnu.org Received: via spool by 79241-submit@debbugs.gnu.org id=B79241.17560591568134 (code B ref 79241); Sun, 24 Aug 2025 18:13:02 +0000 Received: (at 79241) by debbugs.gnu.org; 24 Aug 2025 18:12:36 +0000 Received: from localhost ([127.0.0.1]:46513 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uqFCm-000278-6X for submit@debbugs.gnu.org; Sun, 24 Aug 2025 14:12:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52360) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uqFCj-00026s-CO for 79241@debbugs.gnu.org; Sun, 24 Aug 2025 14:12:33 -0400 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 1uqFCd-0006me-TE; Sun, 24 Aug 2025 14:12:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=dmJZJrK/SoiR1mOMzFIWa660xawPX/0cgtDSPUxax3w=; b=D7GzXQEUd9K85ZNrjHJC lJM5HgZVtUsd/lF1bR1Q2QE83aS7FaeHkWPQc6wg+Chgi5O74lVgrQvgU7nfsjagqTU8MRhM83nJE TCsseu9m5rkETsIUKmfodWa9w2AI0Vu/b5UAF6Qs+OqpbkqjxsPVp4vXPpD1ORqC3mLKADNHEKm5G OgYycQB6oKTwko9vJ4YBRTyPxUuSllJ17Y9hOsQGXCH8zLfbfApgaT24dSEnCcfMFjqu02Fe7Nlc1 VItd/xFpIdf+1pF2iQYfqlG4pRgRAOm7K+RMfrFdRSgbcrqb/4+hkfLhr4/YZ08iJPh/agZOUx2Wm tJHQgJk5R6tN/g==; Date: Sun, 24 Aug 2025 21:12:25 +0300 Message-Id: <86349g7fna.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87ldn8eh48.fsf@gmail.com> (message from Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= on Sun, 24 Aug 2025 19:58:47 +0200) References: <87ectdt28u.fsf@sheepbook.mail-host-address-is-not-set> <20250824111320.10695-1-sergio.pastorperez@gmail.com> <86ldn96jtn.fsf@gnu.org> <87ldn8eh48.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -3.3 (---) > From: Sergio Pastor PΓ©rez > Cc: 79241@debbugs.gnu.org > Date: Sun, 24 Aug 2025 19:58:47 +0200 > > Eli Zaretskii writes: > > >> + if (it.method == GET_FROM_STRING) > >> + reseat_at_previous_visible_line_start(&it); > >> + > >> move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X); > >> /* If we find ourselves in the middle of an overlay string > >> which includes a newline after current string position, > > > > Is this needed only for overlays? What about 'display' text > > properties? (There are also other cases when it.method could be > > GET_FROM_STRING.) If this is only for overlay strings, we need to use > > > > if (it.method == GET_FROM_STRING && !NILP (it.from_overlay)) > > > > instead. Please test this at least with 'display' property strings > > instead of overlay strings, and see if the same problem happens in > > that case. Then we will be able to decide how to write the condition > > in this case. > > So I've tested this behavior with this display property: > --8<---------------cut here---------------start------------->8--- > (let* ((start (point)) > (end (1+ (point))) > (ov (make-overlay start end))) > (overlay-put ov 'display "--->HELLO\nAnother message\nDONE<---")) > --8<---------------cut here---------------end--------------->8--- No, this is not what I meant. I meant to test 'display' text property, not overlay property. > I've noticed that *without* applying the patch, there is some unexpected > behavior in the vertical line movement. With the v2 patch applied this > is partially corrected so it seems some fix is needed for 'display' text > properties as well. This is a slightly different situation, so let's leave it alone for now and focus on the previous use case. Your patch fixed the case of an overlay string, let's see whether it is needed with display strings from 'display' text properties. Thanks. From unknown Sat Sep 06 00:10:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79241: [PATCH v3] Fix incorrect handling of overlays in `vertical-motion' References: <87ectdt28u.fsf@sheepbook.mail-host-address-is-not-set> In-Reply-To: <87ectdt28u.fsf@sheepbook.mail-host-address-is-not-set> Resent-From: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Aug 2025 18:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 79241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 79241@debbugs.gnu.org Cc: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= Received: via spool by 79241-submit@debbugs.gnu.org id=B79241.175606005610940 (code B ref 79241); Sun, 24 Aug 2025 18:28:02 +0000 Received: (at 79241) by debbugs.gnu.org; 24 Aug 2025 18:27:36 +0000 Received: from localhost ([127.0.0.1]:46560 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uqFRH-0002qM-AQ for submit@debbugs.gnu.org; Sun, 24 Aug 2025 14:27:35 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:56445) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uqFR8-0002pl-2A for 79241@debbugs.gnu.org; Sun, 24 Aug 2025 14:27:31 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3c7edd71bbfso1028776f8f.0 for <79241@debbugs.gnu.org>; Sun, 24 Aug 2025 11:27:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1756060038; x=1756664838; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=7CqAAfFHM9joZ2hfTe0b2es5Q9zeIhrc1O6L4eks7vc=; b=WzaTbPflMNupkz47N+4U+atVmA4wIl3hi1OrN1nbxkHlg2rm+9JMoNjs2bE7pK1AAh FDUPA7lJ6Sgela43HxeAJMilBMXsTgnqP5qKJbDv3NgX4996uW14sPLj+qy9K4t0cqn6 /AFEfNKifzIIg16SQBxlpxCEbFrIUe48QNZKbxX9SaHbv60BBR6Set/qkBIna74qTww9 A7pqMPYNCQmEOdNFARAte91OoFIwiuXqH9BxKmVfZPyN15XsfI5i4BR5OdFBDpIWYqN+ viFvjZkJ1Fkp6/nvcabiFQXr+7FW3NAWHBHWwbDr3Oo/nmAv5Oh4nL1Htv1WVRCbHhr8 Lqbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756060038; x=1756664838; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7CqAAfFHM9joZ2hfTe0b2es5Q9zeIhrc1O6L4eks7vc=; b=r/Zb6/17dPRSsVlo7MZEjDWBHpqllHYndtT+Q4+cGVFeHkINhvNTKUeNVe6MfYVBg0 wk7F857OEW951nsRhHXlZMSBK+VmbwXpeoTt8pXY/XxtTXLpfN4si8YNKak/vixP3jqJ oUxquPxxEDVK8+0FNGEPQS24GIKYriEgAAWW4Ne959rfof5WhgoO42cgzyWjlLQIMC1Q XWJRfZWS5QMLnV0G/Ss+PZ89M98aoAIN8g3j59GsEwhu/1z9C6NH/f3jzseQLEUZzA3N wCtoKNeoFxRDFGYB2+x1O/0LRYN/Wh9lrdWYN1wfkqcTSGtktiKjDhoc9yi/Ahu2BkN0 Rzxw== X-Gm-Message-State: AOJu0YwJNgKIt/ZVSdWEVfvZ9OjbgwFH8gnM3yMP//AshCfByxlFaED0 HUW/cqiSKsFPkI9xiFvSNccb9gUK/ppQYMynPIUKDKC379oF6Cne/M0yBv9G7A== X-Gm-Gg: ASbGncuSnfsVkb/ewEYMJZYGlj20RhFQ6tS95k8TwFp3Xyf7f1Gk/3iY0b0LceqaShS fdGEzM5Zef2qIodj6ayvJpmeiIT71BwZcndC+9LKrwq2A0PiAYi1eTEXJ/fXZApjU0AXuAhwwPT w+H4XURU1wxW0kp9npXmDR/FzyCeArRfQ4nXxqUlrl5ZNG1l38TY1ekDadTiAYvYEV58Aw3jEng ydfvqZjBRIxTGn7E8FVUBHDXWMCAfoa7RR5S2+0X1ezGMaEmbh4fdomHW1KljJCuutpG1I+85R+ eoXmiS5rY7EL1WYgRkBqAaBc2M0jjZYs3VT2XJq+ONU8koolZAXHZoxlQ8A0dyqG/miJpxnY76R UAiLTQpk5zvaN7I7eC0h7yY4CV1h7YaGmAodkWJgZKu1M6A== X-Google-Smtp-Source: AGHT+IEzD/b2mPLokYW35S8zuGL76cT1aHOrJYWton9oiwe+ALa9OyxhAAQBBLTl+vml0zWRUWs5aQ== X-Received: by 2002:a05:6000:43d7:b0:3c9:ad8:fec9 with SMTP id ffacd0b85a97d-3c90ad9064dmr1615052f8f.58.1756060038336; Sun, 24 Aug 2025 11:27:18 -0700 (PDT) Received: from localhost ([2a0c:5a85:d20b:2b00:2040:f871:fbca:fa67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3c711212871sm8093506f8f.43.2025.08.24.11.27.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Aug 2025 11:27:17 -0700 (PDT) From: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= Date: Sun, 24 Aug 2025 20:27:06 +0200 Message-ID: <20250824182715.9681-1-sergio.pastorperez@gmail.com> X-Mailer: git-send-email 2.51.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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 (-) * src/indent.c (vertical-motion): If point is inside an overlay, reset it to the beginning of line before trying to reach goal column. This prevents point from being stuck at the beginning of overlay strings during upward motions. --- src/indent.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/indent.c b/src/indent.c index b4f3c349dc5..95228b26825 100644 --- a/src/indent.c +++ b/src/indent.c @@ -2506,6 +2506,9 @@ line (if such column exists on that line, that is). If the line is an addition to the hscroll amount. */ if (!NILP (lcols)) { + if (it.method == GET_FROM_STRING && !NILP (it.from_overlay)) + reseat_at_previous_visible_line_start(&it); + move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X); /* If we find ourselves in the middle of an overlay string which includes a newline after current string position, -- 2.51.0 From unknown Sat Sep 06 00:10:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79241: [PATCH v2] Fix incorrect handling of overlays in `vertical-motion' Resent-From: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Aug 2025 18:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 79241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 79241@debbugs.gnu.org Received: via spool by 79241-submit@debbugs.gnu.org id=B79241.175606060012698 (code B ref 79241); Sun, 24 Aug 2025 18:37:01 +0000 Received: (at 79241) by debbugs.gnu.org; 24 Aug 2025 18:36:40 +0000 Received: from localhost ([127.0.0.1]:46584 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uqFa3-0003Ih-Rz for submit@debbugs.gnu.org; Sun, 24 Aug 2025 14:36:40 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:46355) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uqFZu-0003IK-Ax for 79241@debbugs.gnu.org; Sun, 24 Aug 2025 14:36:35 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-3c98b309804so157573f8f.1 for <79241@debbugs.gnu.org>; Sun, 24 Aug 2025 11:36:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1756060584; x=1756665384; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=rzeovNvdobHgv6T8bT2EdNPYkgBAPmScsPxc5F2FCoA=; b=VXmNbydC/xfj+NoyFPsslKxE8XHCcJOdjpp761ILF6Bdae9+HI5g/YRn13WOlbshhr Cy0ffwCHXPcVOeg1XI/NjADLJino1iUAI23usJS08IOW+HYYaHBAMTMQ3rR6F6JAEL7z CzrNVL0e79ZtXLKr1PHGy3ORLdBVt1PFP8PeuuenKXhcwmDk7zRlJLczNsKSh8vEW5W7 u6oyv8ppdjOGLXr/OS82HFRKHo/FGr5XTsR140fl2YKnGgX+UQnNsqHmGQS4mEXu4MF1 Dc0ijv6Vbr4Npkc+J1rdjgRI/mYSFoYfzOYbM8Vve36I45Xf7w1kK5xZwZHnxw72BLr3 qAKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756060584; x=1756665384; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rzeovNvdobHgv6T8bT2EdNPYkgBAPmScsPxc5F2FCoA=; b=IB8iGavFLDKWQt+nczE/qbHyzUAjoLTvi/mCtMB53RaVzn6dJYrXGyYN28DoxEuwi3 a7ZaIRzx1XT033SLDOvfQ3s1m3uGE9SwbTWMpWbOJQ9CslXIl5mtPehyDZW6XCS0/1cp gagHFLB12v0Hmt2criScIj4Bh/jKiA7z5/EJObAfbhHVo/1WcMaXrGFPcNdEnXi5io86 KABzQcXlAGH1C8XXpQQauIDDPqQFvE4W6VtxlyTzOG6k91WMlErmdJzu6DOzxOHu25Rk yhBKac5z/fCHjH9teQQ+Tq0Xh6FM8BAFNbd2Jp7bDaeYRVxBXZ7cesnsmm3Zs00vkByd 9loA== X-Gm-Message-State: AOJu0YyZ4p17T1oGwDa7ach6tiTOvXf1Lz/ZCKcAgVu2it2ewuMacfI1 f6MrEB/AXX0H6JTYe105AyRsPuVj/SaAXOv4jIPR1ztb0iFgAnD4MG2bN43fLQ== X-Gm-Gg: ASbGncvLaIhHA9MbO126q6/47/cXZTOqw0VCYs5MhsRUW3uRxgkbW6g4l1hYWylbbNm dkYSpSFzmV0sMC/hAxK2j+KNzT/WLmiMBalxcATiEYVr4r2Ayw1FL8BMSCYsytJOWWJsW0vQEL4 U298EyB//QM4T7KpvwO5Ch3qIOhOSdGCy68aLy9IzrW96qZpcVX1lcsi5q1awPB0LVBmXMs5Qex jdX6QHz279SM73X4S9Hm0ZHIgiYS6yH3sh1RRP5xHxknjXTpHPslaL6MlPr+kvwAA3V2zLBX8Wq Eg9dAwxY7Dai8v5tOZpSLAncs0j2PDuE3egIqNxWLsaHgc/J9uOp53nEXohRpVva7+ICf/bCjxr vukgbrPj9YrO/hu9nd+a2eYRuBSrnIB45EK0= X-Google-Smtp-Source: AGHT+IGo8WR8FI7G85G3P5VSasglwQVaeg27vEJkDt+aHLhC0Vj2AXf2hxQCA/+wfqBjiQdw8I5jHA== X-Received: by 2002:a5d:5f8b:0:b0:3c6:fd90:e366 with SMTP id ffacd0b85a97d-3c6fd90e5cdmr4254737f8f.34.1756060583679; Sun, 24 Aug 2025 11:36:23 -0700 (PDT) Received: from localhost ([2a0c:5a85:d20b:2b00:2040:f871:fbca:fa67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b506bdd9csm75079905e9.3.2025.08.24.11.36.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Aug 2025 11:36:23 -0700 (PDT) From: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= In-Reply-To: <86349g7fna.fsf@gnu.org> References: <87ectdt28u.fsf@sheepbook.mail-host-address-is-not-set> <20250824111320.10695-1-sergio.pastorperez@gmail.com> <86ldn96jtn.fsf@gnu.org> <87ldn8eh48.fsf@gmail.com> <86349g7fna.fsf@gnu.org> Date: Sun, 24 Aug 2025 20:36:22 +0200 Message-ID: <87ikicefdl.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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 (-) Eli Zaretskii writes: >> From: Sergio Pastor P=C3=A9rez >> Cc: 79241@debbugs.gnu.org >> Date: Sun, 24 Aug 2025 19:58:47 +0200 >>=20 >> Eli Zaretskii writes: >>=20 >> >> + if (it.method =3D=3D GET_FROM_STRING) >> >> + reseat_at_previous_visible_line_start(&it); >> >> + >> >> move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X); >> >> /* If we find ourselves in the middle of an overlay string >> >> which includes a newline after current string position, >> > >> > Is this needed only for overlays? What about 'display' text >> > properties? (There are also other cases when it.method could be >> > GET_FROM_STRING.) If this is only for overlay strings, we need to use >> > >> > if (it.method =3D=3D GET_FROM_STRING && !NILP (it.from_overlay)) >> > >> > instead. Please test this at least with 'display' property strings >> > instead of overlay strings, and see if the same problem happens in >> > that case. Then we will be able to decide how to write the condition >> > in this case. >>=20 >> So I've tested this behavior with this display property: >> --8<---------------cut here---------------start------------->8--- >> (let* ((start (point)) >> (end (1+ (point))) >> (ov (make-overlay start end))) >> (overlay-put ov 'display "--->HELLO\nAnother message\nDONE<---")) >> --8<---------------cut here---------------end--------------->8--- > > No, this is not what I meant. I meant to test 'display' text > property, not overlay property. Oh, understood. I've sent version 3 so it only affects overlays, for display text properties we have the same convoluted behavior I described in the previous mail. With v2 of the patch, at least the target column is corrected but has the line skip issue, what I said in the previous mail still holds. From unknown Sat Sep 06 00:10:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79241: [PATCH v3] Fix incorrect handling of overlays in `vertical-motion' Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Aug 2025 09:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 79241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= Cc: 79241@debbugs.gnu.org Received: via spool by 79241-submit@debbugs.gnu.org id=B79241.175654705313473 (code B ref 79241); Sat, 30 Aug 2025 09:45:02 +0000 Received: (at 79241) by debbugs.gnu.org; 30 Aug 2025 09:44:13 +0000 Received: from localhost ([127.0.0.1]:45058 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1usI84-0003VE-Se for submit@debbugs.gnu.org; Sat, 30 Aug 2025 05:44:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48122) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1usI80-0003Tm-Mw for 79241@debbugs.gnu.org; Sat, 30 Aug 2025 05:44:10 -0400 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 1usI7v-0002wr-CS; Sat, 30 Aug 2025 05:44:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=YI2dz0/VwZ9Qd4uxyR4BrnowBZpGvvza8hZEGpSfdb4=; b=sH5XVcOkVmngGMSReCmr rzf0atLX8apP/NrRCj1+Sv+Xo+aP895P6gZhCyFo2Gp3slzT3/Dkm8an3zGfnYN1ZndEfouhDFxSy ngDy6/v/ueu5NJRQrTsxaHayosFDvF3EVZ8xnBkaqWmyzGozr1f11kP/F4zYvgsu53TpNhPvSwiGE szNLbIHY+abQ6EOnhQsipq15R3KfkTO7Fk5W9kvQCx6NhS2DrUq737N79r0NiAJksDlBvYQQCgnuy bnfgo/gu3KlbR4Hdbzsiy3mfH3NsHeOdI+nZ/tNbemdkXgkcDff0M2UgZU55kDIPLre4+PKlJFQ+j EH8Yz4fEGawNLQ==; Date: Sat, 30 Aug 2025 12:44:00 +0300 Message-Id: <86zfbhp2jj.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <20250824182715.9681-1-sergio.pastorperez@gmail.com> (message from Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= on Sun, 24 Aug 2025 20:27:06 +0200) References: <87ectdt28u.fsf@sheepbook.mail-host-address-is-not-set> <20250824182715.9681-1-sergio.pastorperez@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -3.3 (---) > Cc: Sergio Pastor Pιrez > From: Sergio Pastor Pιrez > Date: Sun, 24 Aug 2025 20:27:06 +0200 > > * src/indent.c (vertical-motion): If point is inside an overlay, reset > it to the beginning of line before trying to reach goal column. This > prevents point from being stuck at the beginning of overlay strings > during upward motions. Thanks, installed on the master branch. This was a very small change, so we could accept it without your assigning the copyright to the FSF. However, if you intend to contribute more changes, I would suggest to start your copyright-assignment paperwork at this time, so that we could in the future accept your contributions without any size limitations. If you agree, I will send you the form to fill and the instructions to go with it. From unknown Sat Sep 06 00:10:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79241: [PATCH v3] Fix incorrect handling of overlays in `vertical-motion' Resent-From: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Sep 2025 16:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 79241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 79241@debbugs.gnu.org Received: via spool by 79241-submit@debbugs.gnu.org id=B79241.1756743677390 (code B ref 79241); Mon, 01 Sep 2025 16:22:01 +0000 Received: (at 79241) by debbugs.gnu.org; 1 Sep 2025 16:21:17 +0000 Received: from localhost ([127.0.0.1]:58320 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ut7HR-00006D-3D for submit@debbugs.gnu.org; Mon, 01 Sep 2025 12:21:17 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:50413) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ut7HO-00005y-Tb for 79241@debbugs.gnu.org; Mon, 01 Sep 2025 12:21:15 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-45b7d485173so28331215e9.0 for <79241@debbugs.gnu.org>; Mon, 01 Sep 2025 09:21:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1756743668; x=1757348468; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=7MYpHr4WvHUgzcMCztE2nR1hGuFsMv5j5aIA/bakO/Q=; b=d0QOLcBbjuE8HyiRbf7Kd7aEefW2RnMAcBnDWrvWyHhWUiRPsXeV56eaQwxtnaHEdn T+EcMX1HmxIbwXBhcDlpEWd/Oqvg4qgMJ/RT6JEzTy5RvigGKfxWlGN7BHDJinIq32A8 vBglhj+Ymr0pkD2CH9QuGreGunIe6R4A80PSkYfZcrdzTJ4OvMpaSBhuf8qsohkHm6d6 czzMkIb53KANdMFU7+rK1GYpQF6Y5eT0UfqsRKrHJDGQF+zqTekHZHS+AScsgNOw7Dw7 AVsb84Dwvy2d8p0sQi3/jqk7BSrZWGZv4PPqPFANudf6oTCDNLvulhI/z+NkrSwUYfjG /Uvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756743668; x=1757348468; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7MYpHr4WvHUgzcMCztE2nR1hGuFsMv5j5aIA/bakO/Q=; b=AGbQa33zGYeVcwZQTbgwRJERNsK7qYeF8pvN9oEVOEDZRJulPg5nLmZ9dzNKi3pfiA s9lPPJjsP9ijwoin6H2J9WmKiReoc1QZTujySxWqwnNqp8nzPyWXpqBqNyRegnIpUoEX Ty2N+wF697zoHO049+DYpZH4gAFebvoiT4kc/lPhdfjeWR4OrcBvrOX8b956nfg9n3WA 5YEhZ0raqshfL3cOH9lzmDs2Uva1nNU8cspcNnlNJdfnMbtewykBZ84LREhh6mjDycr0 8kbSA6YXfQo0/BYb0oiYee3JFae4o17sXfzDDVUrvFRqsPdjDhHbWug6xz5wBQ/lAtKb ToSQ== X-Gm-Message-State: AOJu0YzhxVjfrB31iWoY88oC5zSedLeQZZ5eVhW3HqtC9STdu+2Fpe7B 2lRbf99z97xEl+2+MolFxWfCFNyJUX8kyLOXGoDVaIpzPrwaDyfSLGY2IiZQ+hXE X-Gm-Gg: ASbGncuA5qP8oExvjnEQR44bwBwJ36tNfdsD+vd2rj8AXyLhK8vE3xlQBxbbOWXRGDQ ZOugVUBPDXlvOCQO4Tg5Gnpf13JIlRfUKE0RdmFCGN+sXWVeXfz1MWeLVdDOqp2W43gI2x0z/nv Np63zwtgIvUO6lID0svxT7/w6YyMHPWpX8GOOEeue52Q/DGCvFEbGpSlirrwWp4JTZB8o6N3uyp 8EP7ceD2wXg8gUCMxloPL1rO94gL5E5GxbtGkwSZe2YScYQNpw9oORprAApBWBustNMDmHuJYZB MD49qqMYG0uCrtAxbRwkxP9fxTVHa0DZt5cM4geUv98QGfUaaqrta6coHdPck3k7rvu3Aus3M1H xi35jpkJWHlmB4obYNSLOkOLsTjI9Wx6/ZU+L6CEw1oyflqI= X-Google-Smtp-Source: AGHT+IEMM1C3+IZOiNlotwBAmXoFbfszhfKpUVhjrYBgsN5p/0jgQJL18SRGg3PRqm5Z65uEm9Ixgg== X-Received: by 2002:a05:6000:310f:b0:3cd:4277:d253 with SMTP id ffacd0b85a97d-3d1df34d733mr5524018f8f.57.1756743668330; Mon, 01 Sep 2025 09:21:08 -0700 (PDT) Received: from localhost ([2a0c:5a85:d20b:2b00:2040:f871:fbca:fa67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3d520eada16sm7191165f8f.41.2025.09.01.09.21.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Sep 2025 09:21:07 -0700 (PDT) From: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= In-Reply-To: <86zfbhp2jj.fsf@gnu.org> References: <87ectdt28u.fsf@sheepbook.mail-host-address-is-not-set> <20250824182715.9681-1-sergio.pastorperez@gmail.com> <86zfbhp2jj.fsf@gnu.org> Date: Mon, 01 Sep 2025 18:21:06 +0200 Message-ID: <87ldmyywi5.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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 (-) Eli Zaretskii writes: >> Cc: Sergio Pastor P=C3=A9rez >> From: Sergio Pastor P=C3=A9rez >> Date: Sun, 24 Aug 2025 20:27:06 +0200 >>=20 >> * src/indent.c (vertical-motion): If point is inside an overlay, reset >> it to the beginning of line before trying to reach goal column. This >> prevents point from being stuck at the beginning of overlay strings >> during upward motions. > > Thanks, installed on the master branch. > > This was a very small change, so we could accept it without your > assigning the copyright to the FSF. However, if you intend to > contribute more changes, I would suggest to start your > copyright-assignment paperwork at this time, so that we could in the > future accept your contributions without any size limitations. > > If you agree, I will send you the form to fill and the instructions to > go with it. Sure forward me the form. I will give a hand if I find anything I can contribute to. Thanks, Sergio From unknown Sat Sep 06 00:10:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79241: [PATCH v3] Fix incorrect handling of overlays in `vertical-motion' Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Sep 2025 19:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 79241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= Cc: 79241@debbugs.gnu.org Received: via spool by 79241-submit@debbugs.gnu.org id=B79241.175675486010249 (code B ref 79241); Mon, 01 Sep 2025 19:28:02 +0000 Received: (at 79241) by debbugs.gnu.org; 1 Sep 2025 19:27:40 +0000 Received: from localhost ([127.0.0.1]:58542 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1utABo-0002fE-8G for submit@debbugs.gnu.org; Mon, 01 Sep 2025 15:27:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60758) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1utABm-0002f0-19 for 79241@debbugs.gnu.org; Mon, 01 Sep 2025 15:27:38 -0400 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 1utABg-0001Rf-Jj; Mon, 01 Sep 2025 15:27:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=CCaIim9j9R+bkEtQnY3phREp8xJsbM6ySnZPiExgTMc=; b=M84/F35EW3JksJ1TUaI1 jy6Jlw2rXGAh4Ztdseo0dHTfEBS6ydmMeVFTO59fGhCQsVySvoQYT7fKs0qm1XzDPiHWLsOQAfr6s yf56l0ZzehzoaUKoGKrO9y7ssioIjkNkg4ZhnmZ+JLIJz7CD41mKtznFTRJoO0WGFq1ry/2fqPby9 82QsSkIj5YnvuayWsIumiMCzrQtF9EMZmGpCaiuRpASykCQSJul04xiC18NKP70KJKkzCv5jwXsbZ kq3Sful5annLHmK6MqdPb7DpD2HF2fJ0XLav6IfH5qZOZY0goisTR7pYKpeAw7FpLCMr17gTB5itH C/nwfS8hXo5Akg==; Date: Mon, 01 Sep 2025 22:27:29 +0300 Message-Id: <86iki2m0ri.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87ldmyywi5.fsf@gmail.com> (message from Sergio Pastor =?UTF-8?Q?P=C3=A9rez?= on Mon, 01 Sep 2025 18:21:06 +0200) References: <87ectdt28u.fsf@sheepbook.mail-host-address-is-not-set> <20250824182715.9681-1-sergio.pastorperez@gmail.com> <86zfbhp2jj.fsf@gnu.org> <87ldmyywi5.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -3.3 (---) > From: Sergio Pastor PΓ©rez > Cc: 79241@debbugs.gnu.org > Date: Mon, 01 Sep 2025 18:21:06 +0200 > > Eli Zaretskii writes: > > > > This was a very small change, so we could accept it without your > > assigning the copyright to the FSF. However, if you intend to > > contribute more changes, I would suggest to start your > > copyright-assignment paperwork at this time, so that we could in the > > future accept your contributions without any size limitations. > > > > If you agree, I will send you the form to fill and the instructions to > > go with it. > > Sure forward me the form. I will give a hand if I find anything I can > contribute to. Form sent off-list.