From unknown Tue Jun 24 13:54:17 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#52302 <52302@debbugs.gnu.org> To: bug#52302 <52302@debbugs.gnu.org> Subject: Status: 28.0.50; [PATCH] Overlay strings should not increment vpos Reply-To: bug#52302 <52302@debbugs.gnu.org> Date: Tue, 24 Jun 2025 20:54:17 +0000 retitle 52302 28.0.50; [PATCH] Overlay strings should not increment vpos reassign 52302 emacs submitter 52302 dick.r.chiang@gmail.com severity 52302 normal tag 52302 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 05 13:08:05 2021 Received: (at submit) by debbugs.gnu.org; 5 Dec 2021 18:08:05 +0000 Received: from localhost ([127.0.0.1]:59250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtvvg-0000S0-AI for submit@debbugs.gnu.org; Sun, 05 Dec 2021 13:08:05 -0500 Received: from lists.gnu.org ([209.51.188.17]:36016) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtvSH-00087y-1l for submit@debbugs.gnu.org; Sun, 05 Dec 2021 12:37:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35218) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtvSG-0006Fw-Mq for bug-gnu-emacs@gnu.org; Sun, 05 Dec 2021 12:37:40 -0500 Received: from [2607:f8b0:4864:20::834] (port=35481 helo=mail-qt1-x834.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtvSE-00088y-Hv for bug-gnu-emacs@gnu.org; Sun, 05 Dec 2021 12:37:40 -0500 Received: by mail-qt1-x834.google.com with SMTP id j17so8767841qtx.2 for ; Sun, 05 Dec 2021 09:37:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:user-agent:mime-version; bh=xND7hQg953IqHZd2ejGokjJ/PsIaHrxgJ3lZHjih40I=; b=MCuQQWkNRaa0JhQb8G4i6vGlIJAKS23POTY0mvbH45Mo9AkQlu/nBIp6W7BWTg/UWd iM5OLX61ciIbbihrtn9NKKe6VGdM3Jfv1qLVqk4jpki6k81poxCuLTldnK248zo0YkLi SylUqNNHgBtsa8shYxURUjVXg0aGC247Ggi1nKzH1Codkd0HuJ/63qCQI6CtfhE78gGS vSm84PsLK8lHleft/LVFzgXhkkFUsLk2jm6Iycs8hpiH3q6nOXOj1+fH1WWQ40CSskct cZ4PNso+iTVKVZ76sFABF2yADD+BDQxPYo/KOf7NZyZ7Ng2nYep9xV+at0V+o2bQWBNx J7Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version; bh=xND7hQg953IqHZd2ejGokjJ/PsIaHrxgJ3lZHjih40I=; b=6f4bBuCMwopQ8LWBKdjLFuojG5TsEx2wRiR0u6x75BbVIaObZCUOra1wFZH1jbzrju SEizqrzkY/th3nLRGmvRaLTHv6zqZuYVmUJv8qTL2/jqOR1kr708fEhvP9WjU445Pt1H nerg3eAUuc74yMW5b/Y2NP0G+8yuQ/IyvzOvTIhDlkJjckEg0TxdbjsVmN2NEpbutzeI PX0TKsOpF2haLUA/kABriJkRKmoMvIASjUfJ2aKTRNGTJJyCiPsoSpSkRv2T6hVTNXcK vYfne2u3O7oRYeL1giTID9puMi3MvofZzYYZiuv5ytMhFxJ9jEnUXiRIwh+F5QE6TZQR VG0g== X-Gm-Message-State: AOAM530p4XBNZifMU21V08P5xMflz4GkzgnXY9+hQi5fp6EDyIyKPuR7 aejZzVYh2ItaL+V32/gtqFZwzFySAJs= X-Google-Smtp-Source: ABdhPJztxQg716+vIldOSsr6ZrpyFAZeFpBYFEakMGTGDh8y0YKgFuFL91Hg3rpOjZ/8bS0Qqt3/KA== X-Received: by 2002:a05:622a:1447:: with SMTP id v7mr34320473qtx.92.1638725856950; Sun, 05 Dec 2021 09:37:36 -0800 (PST) Received: from localhost ([68.237.93.126]) by smtp.gmail.com with ESMTPSA id 143sm5344811qkg.87.2021.12.05.09.37.36 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 05 Dec 2021 09:37:36 -0800 (PST) From: dick.r.chiang@gmail.com To: bug-gnu-emacs Subject: 28.0.50; [PATCH] Overlay strings should not increment vpos Date: Sun, 05 Dec 2021 12:37:35 -0500 Message-ID: <87v903hs0w.fsf@dick> User-Agent: Gnus/5.14 (Gnus v5.14) Commercial/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::834 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::834; envelope-from=dick.r.chiang@gmail.com; helo=mail-qt1-x834.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit 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: -2.3 (--) --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Overlay-strings-at-to_charpos-should-not-increment-v.patch >From 010b26de2993754db6bb42243b5c6c89fc5e8a50 Mon Sep 17 00:00:00 2001 From: dickmao Date: Sun, 5 Dec 2021 12:25:32 -0500 Subject: [PATCH] Overlay strings at `to_charpos` should not increment vpos Previously, two calls to `move_it_vertically_backward (it, 0)` were required to get IT back to line start. It should only ever take one call. * src/xdisp.c (move_it_to): Recognize the invisible overlay string should not increment vpos. (move_it_vertically_backward): Rectify assertions. (resize_mini_window): Should not need to call move_it_vertically_backward (it, 0) twice. * test/src/xdisp-tests.el (xdisp-tests--minibuffer-resizing): Test. --- src/xdisp.c | 28 ++++++++++++---------------- test/src/xdisp-tests.el | 30 +++++++++++++----------------- 2 files changed, 25 insertions(+), 33 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index 0ff6286af74..e5498bbbb1b 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -10081,6 +10081,7 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos for (;;) { + bool reached_continued = false; orig_charpos = IT_CHARPOS (*it); orig_method = it->method; if (op & MOVE_TO_VPOS) @@ -10125,6 +10126,11 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos break; } } + else if (skip == MOVE_LINE_CONTINUED + && it->method == GET_FROM_STRING + && IT_CHARPOS (*it) == to_charpos) + /* TO_CHARPOS reached, now consuming overlay string. */ + reached_continued = true; } } else if (op & MOVE_TO_Y) @@ -10381,7 +10387,8 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos it->hpos = 0; it->line_number_produced_p = false; it->current_y += it->max_ascent + it->max_descent; - ++it->vpos; + if (! reached_continued) + ++it->vpos; last_height = it->max_ascent + it->max_descent; it->max_ascent = it->max_descent = 0; } @@ -10490,11 +10497,11 @@ move_it_vertically_backward (struct it *it, int dy) || (it2.method == GET_FROM_STRING && IT_CHARPOS (it2) == start_pos && SREF (it2.string, IT_STRING_BYTEPOS (it2) - 1) == '\n'))); - eassert (IT_CHARPOS (*it) >= BEGV); + eassert (IT_CHARPOS (it2) >= BEGV); SAVE_IT (it3, it2, it3data); move_it_to (&it2, start_pos, -1, -1, -1, MOVE_TO_POS); - eassert (IT_CHARPOS (*it) >= BEGV); + eassert (IT_CHARPOS (it2) >= BEGV); /* H is the actual vertical distance from the position in *IT and the starting position. */ h = it2.current_y - it->current_y; @@ -12218,7 +12225,6 @@ resize_mini_window (struct window *w, bool exact_p) struct it it; int unit = FRAME_LINE_HEIGHT (f); int height, max_height; - struct text_pos start; struct buffer *old_current_buffer = NULL; int windows_height = FRAME_INNER_HEIGHT (f); @@ -12272,25 +12278,15 @@ resize_mini_window (struct window *w, bool exact_p) { init_iterator (&it, w, ZV, ZV_BYTE, NULL, DEFAULT_FACE_ID); move_it_vertically_backward (&it, height - unit); - /* The following move is usually a no-op when the stuff - displayed in the mini-window comes entirely from buffer - text, but it is needed when some of it comes from overlay - strings, especially when there's an after-string at ZV. - This happens with some completion packages, like - icomplete, ido-vertical, etc. With those packages, if we - don't force w->start to be at the beginning of a screen - line, important parts of the stuff in the mini-window, - such as user prompt, will be hidden from view. */ - move_it_by_lines (&it, 0); - start = it.current.pos; /* Prevent redisplay_window from recentering, and thus from overriding the window-start point we computed here. */ w->start_at_line_beg = false; - SET_MARKER_FROM_TEXT_POS (w->start, start); + SET_MARKER_FROM_TEXT_POS (w->start, it.current.pos); } } else { + struct text_pos start; SET_TEXT_POS (start, BEGV, BEGV_BYTE); SET_MARKER_FROM_TEXT_POS (w->start, start); } diff --git a/test/src/xdisp-tests.el b/test/src/xdisp-tests.el index ae4aacd9c7c..d1d7262665a 100644 --- a/test/src/xdisp-tests.el +++ b/test/src/xdisp-tests.el @@ -34,23 +34,19 @@ xdisp-tests--in-minibuffer (ert-deftest xdisp-tests--minibuffer-resizing () ;; bug#43519 (should - (equal - t - (xdisp-tests--in-minibuffer - (insert "hello") - (let ((ol (make-overlay (point) (point))) - (max-mini-window-height 1) - (text "askdjfhaklsjdfhlkasjdfhklasdhflkasdhflkajsdhflkashdfkljahsdlfkjahsdlfkjhasldkfhalskdjfhalskdfhlaksdhfklasdhflkasdhflkasdhflkajsdhklajsdgh")) - ;; (save-excursion (insert text)) - ;; (sit-for 2) - ;; (delete-region (point) (point-max)) - (put-text-property 0 1 'cursor t text) - (overlay-put ol 'after-string text) - (redisplay 'force) - ;; Make sure we do the see "hello" text. - (prog1 (equal (window-start) (point-min)) - ;; (list (window-start) (window-end) (window-width)) - (delete-overlay ol))))))) + (xdisp-tests--in-minibuffer + (insert "hello") + (let ((ol (make-overlay (point) (point))) + (max-mini-window-height 1) + (text (let ((s "")) + (dotimes (i 137) + (setq s (concat s (char-to-string (+ (% i 26) ?a))))) + s))) + (put-text-property 0 1 'cursor t text) + (overlay-put ol 'after-string text) + (redisplay) + (prog1 (equal (window-start) (point-min)) + (delete-overlay ol)))))) (ert-deftest xdisp-tests--minibuffer-scroll () ;; bug#44070 (let ((posns -- 2.26.2 --=-=-= Content-Type: text/plain In Commercial Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30, cairo version 1.15.10) of 2021-12-04 built on dick Repository revision: 9d9fe19c6ceb78c6f14d4bfb1fb85d6356b7e0f6 Repository branch: dev Windowing system distributor 'The X.Org Foundation', version 11.0.11906000 System Description: Ubuntu 18.04.4 LTS Configured using: 'configure --prefix=/home/dick/.local --enable-checking --with-tree-sitter --enable-dumping-overwrite CC=gcc-10 'CFLAGS=-g3 -Og -I/home/dick/.local/include/' LDFLAGS=-L/home/dick/.local/lib PKG_CONFIG_PATH=/home/dick/.local/lib/pkgconfig CXX=gcc-10' Configured features: CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON TREE-SITTER LCMS2 LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XPM GTK3 ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Magit Minor modes in effect: async-bytecomp-package-mode: t global-git-commit-mode: t shell-dirtrack-mode: t projectile-mode: t flx-ido-mode: t override-global-mode: t global-hl-line-mode: t winner-mode: t tooltip-mode: t show-paren-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t column-number-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: /home/dick/gomacro-mode/gomacro-mode hides /home/dick/.emacs.d/elpa/gomacro-mode-20200326.1103/gomacro-mode /home/dick/.emacs.d/elpa/hydra-20170924.2259/lv hides /home/dick/.emacs.d/elpa/lv-20191106.1238/lv /home/dick/.emacs.d/elpa/magit-3.3.0/magit-section-pkg hides /home/dick/.emacs.d/elpa/magit-section-3.3.0/magit-section-pkg /home/dick/org-gcal.el/org-gcal hides /home/dick/.emacs.d/elpa/org-gcal-0.3/org-gcal /home/dick/.emacs.d/elpa/tree-sitter-0.15.2/tree-sitter hides /home/dick/.local/share/emacs/28.0.50/lisp/tree-sitter /home/dick/.emacs.d/lisp/json hides /home/dick/.local/share/emacs/28.0.50/lisp/json /home/dick/.emacs.d/elpa/transient-0.3.6/transient hides /home/dick/.local/share/emacs/28.0.50/lisp/transient /home/dick/.emacs.d/elpa/hierarchy-20171221.1151/hierarchy hides /home/dick/.local/share/emacs/28.0.50/lisp/emacs-lisp/hierarchy Features: (shadow emacsbug nndoc debbugs-gnu debbugs soap-client rng-xsd rng-dt rng-util xsd-regexp shortdoc debug backtrace flow-fill ag vc-svn find-dired tree-sitter-extras pixel-scroll tree-sitter-query scheme tree-sitter-load tree-sitter-cli tsc tsc-dyn tsc-dyn-get dired-aux tsc-obsolete cl-print canlock gnus-html help-fns radix-tree sh-script executable cl shr-color pulse ivy delsel colir ivy-overlay ffap dumb-jump f magit-extras mule-util face-remap magit-patch-changelog magit-patch magit-submodule magit-obsolete magit-popup async-bytecomp async magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff git-commit log-edit pcvs-util add-log magit-core magit-margin magit-transient magit-process with-editor server magit-mode transient tramp-archive tramp-gvfs tramp-cache zeroconf rust-utils rust-mode rust-rustfmt rust-playpen rust-compile rust-cargo org-element avl-tree ol-eww eww xdg url-queue ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect gnus-search eieio-opt speedbar ezimage dframe ol-docview doc-view image-mode exif ol-bibtex ol-bbdb ol-w3m ol-doi org-link-doi org-tempo tempo org org-macro org-footnote org-pcomplete org-list org-faces org-entities org-version ob-R ob-emacs-lisp ob-ein ein-cell ein-shared-output ein-output-area ein-kernel ein-ipdb ein-query ein-events ein-websocket websocket bindat ein-node ewoc ein-log ein-classes ein-core ein ein-utils deferred ob ob-tangle org-src ob-ref ob-lob ob-table ob-exp ob-comint ob-core ob-eval org-table oc-basic bibtex ol org-keys oc org-compat org-macs org-loaddefs find-func cal-menu calendar cal-loaddefs vc-git vc vc-dispatcher bug-reference cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs misearch multi-isearch supercite regi bbdb-message sendmail footnote qp sort smiley smerge-mode diff diff-mode jka-compr gnus-async gnus-ml gravatar dns mail-extr gnus-notifications gnus-fun notifications gnus-kill gnus-dup disp-table utf-7 mm-archive url-cache nnrss nnfolder nndiscourse benchmark rbenv nnhackernews nntwitter nntwitter-api bbdb-gnus gnus-demon nntp nnmairix nnml nnreddit gnus-topic url-http url-auth url-gw network-stream gnutls nsm request virtualenvwrapper gud s json-rpc python tramp-sh tramp tramp-loaddefs trampver tramp-integration files-x tramp-compat shell pcomplete ls-lisp format-spec gnus-score score-mode gnus-bcklg gnus-srvr gnus-cite anaphora bbdb-mua bbdb-com bbdb bbdb-site timezone gnus-delay gnus-draft gnus-cache gnus-agent gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-sum shr pixel-fill kinsoku svg dom nndraft nnmh gnus-group mm-url gnus-undo use-package use-package-delight use-package-diminish gnus-start gnus-dbus dbus xml gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo parse-time iso8601 gnus-spec gnus-int gnus-range message yank-media rmc puny dired-x dired dired-loaddefs rfc822 mml mml-sec epa epg rfc6068 epg-config mm-decode mm-bodies mm-encode mailabbrev gmm-utils mailheader gnus-win paredit-ext paredit subed subed-vtt subed-srt subed-common subed-mpv subed-debug subed-config inf-ruby ruby-mode smie company pcase haskell-interactive-mode haskell-presentation-mode haskell-process haskell-session haskell-compile haskell-mode haskell-cabal haskell-utils haskell-font-lock haskell-indentation haskell-string haskell-sort-imports haskell-lexeme haskell-align-imports haskell-complete-module haskell-ghc-support noutline outline flymake-proc flymake warnings etags fileloop generator xref project dabbrev haskell-customize hydra lv use-package-ensure solarized-theme solarized-definitions projectile lisp-mnt mail-parse rfc2231 ibuf-ext ibuffer ibuffer-loaddefs thingatpt magit-autorevert autorevert filenotify magit-git magit-section magit-utils crm dash rx grep compile comint ansi-color gnus nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils text-property-search time-date flx-ido flx google-translate-default-ui google-translate-core-ui facemenu color ido google-translate-core google-translate-tk google-translate-backend use-package-bind-key bind-key auto-complete easy-mmode advice edmacro kmacro popup cus-edit pp cus-load wid-edit emms-player-mplayer emms-player-simple emms emms-compat cl-extra help-mode use-package-core derived hl-line winner ring finder-inf json-reformat-autoloads json-snatcher-autoloads sml-mode-autoloads tornado-template-mode-autoloads info package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map url-vars seq gv subr-x byte-opt bytecomp byte-compile cconv cl-loaddefs cl-lib iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tree-sitter 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 cl-generic 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 simple abbrev obarray cl-preloaded nadvice button 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 lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 2879491 657658) (symbols 48 58370 84) (strings 32 303691 70262) (string-bytes 1 11177834) (vectors 16 130394) (vector-slots 8 3291490 317821) (floats 8 3244 4938) (intervals 56 456021 5959) (buffers 992 71)) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 05 13:35:03 2021 Received: (at 52302) by debbugs.gnu.org; 5 Dec 2021 18:35:03 +0000 Received: from localhost ([127.0.0.1]:59424 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtwLn-0001Is-6T for submit@debbugs.gnu.org; Sun, 05 Dec 2021 13:35:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43748) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtwLl-0001IJ-EY for 52302@debbugs.gnu.org; Sun, 05 Dec 2021 13:35:01 -0500 Received: from [2001:470:142:3::e] (port=46264 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtwLg-000458-4P; Sun, 05 Dec 2021 13:34:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=F+a5kbErkA+2MGJ62uYbwJ0GXEcPWL1JnjAgsCCedF4=; b=H8Zg83HP6Tsb i98rAfE0Ti4Avq7iYq4+rNnmZdhAuneh0ZiDbNFyVTBPfbRPEYtgbm5/KnoBZshee/Zh4v5OFTH6S U4auRfivVgXdeUxI8/0uxOuc9z+90p5foJetwJrPGyBh0xA0Ssb1kw/lupW5378tu69viVERtC5O3 N2nEAnLpOLuaGZMBPfn47+CLcNisHj/g8TAK/gUaD03vWAc/ruvI33rXvgCfAex7NXBQ5zsbWGEZv zVn8XfDqaH2drw6Sa830U46ZpPwN6MN6fUqPSksSovsL6EEox/8jp0w2ntyq8YJmO2iw1HeWwkPNK grSTJ7vdbjMKkxAWWfzpVw==; Received: from [87.69.77.57] (port=1698 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtwLf-0001UB-Td; Sun, 05 Dec 2021 13:34:56 -0500 Date: Sun, 05 Dec 2021 20:34:50 +0200 Message-Id: <83lf0y3np1.fsf@gnu.org> From: Eli Zaretskii To: dick.r.chiang@gmail.com In-Reply-To: <87v903hs0w.fsf@dick> (dick.r.chiang@gmail.com) Subject: Re: bug#52302: 28.0.50; [PATCH] Overlay strings should not increment vpos References: <87v903hs0w.fsf@dick> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52302 Cc: 52302@debbugs.gnu.org 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: dick.r.chiang@gmail.com > Date: Sun, 05 Dec 2021 12:37:35 -0500 > > >From 010b26de2993754db6bb42243b5c6c89fc5e8a50 Mon Sep 17 00:00:00 2001 > From: dickmao > Date: Sun, 5 Dec 2021 12:25:32 -0500 > Subject: [PATCH] Overlay strings at `to_charpos` should not increment vpos > > Previously, two calls to `move_it_vertically_backward (it, 0)` were > required to get IT back to line start. It should only ever > take one call. Please tell more about the motivation. In which use cases this change behaves better, and why? This is a delicate code, used in many places, so we need a very good understanding of what gets fixed. > + else if (skip == MOVE_LINE_CONTINUED > + && it->method == GET_FROM_STRING > + && IT_CHARPOS (*it) == to_charpos) > + /* TO_CHARPOS reached, now consuming overlay string. */ it->method == GET_FROM_STRING doesn't necessarily mean we are it->consuming an overlay string. It could be a string from display it->property, for example. > - ++it->vpos; > + if (! reached_continued) > + ++it->vpos; I don't think I see the connection between the above condition and the need to increment (or not increment) VPOS. Can you elaborate on that? > @@ -10490,11 +10497,11 @@ move_it_vertically_backward (struct it *it, int dy) > || (it2.method == GET_FROM_STRING > && IT_CHARPOS (it2) == start_pos > && SREF (it2.string, IT_STRING_BYTEPOS (it2) - 1) == '\n'))); > - eassert (IT_CHARPOS (*it) >= BEGV); > + eassert (IT_CHARPOS (it2) >= BEGV); > SAVE_IT (it3, it2, it3data); > > move_it_to (&it2, start_pos, -1, -1, -1, MOVE_TO_POS); > - eassert (IT_CHARPOS (*it) >= BEGV); > + eassert (IT_CHARPOS (it2) >= BEGV); Why are you replacing the assertions here? > --- a/test/src/xdisp-tests.el > +++ b/test/src/xdisp-tests.el What exactly is changed in this test? It looks like purely stylistic changes to me (which for some reason also lots the comments). Did I miss something? From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 05 13:52:44 2021 Received: (at 52302) by debbugs.gnu.org; 5 Dec 2021 18:52:44 +0000 Received: from localhost ([127.0.0.1]:59458 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtwct-0001kl-S5 for submit@debbugs.gnu.org; Sun, 05 Dec 2021 13:52:44 -0500 Received: from mail-qk1-f175.google.com ([209.85.222.175]:33449) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtwcs-0001kU-8L for 52302@debbugs.gnu.org; Sun, 05 Dec 2021 13:52:42 -0500 Received: by mail-qk1-f175.google.com with SMTP id de30so9223271qkb.0 for <52302@debbugs.gnu.org>; Sun, 05 Dec 2021 10:52:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=sS96QjHd/J1k4Ea/pAEm4CGF7sKNFAUCifjxo7Mkt/4=; b=qRuFC9Eo0LoeqztC0bHRKL7wSPTJlxKy6rSznoZ1W6+3RIHVqPtFF3GjvKarsf3KY7 gDfSqHNxNUxbX8figJJsUXivG36pk5Hsn19UtGimhD/vtGztrYN/8rh0zyEVlegLF1eV n5EoP1m5Yfpp4HMvsj2gbnkVMDKApmA6FKewulX18opiuwJd8R7wTmf1j3nRVytufIBZ rcDakShlkl0dsqROn+SIggd+xWPTwyYVpiSBd0ho8IjGGxuzAV5q/H+su2gmkkR5E2os y1eXQL84A6oIhv7HNlERsk/0s1k1VgNNNhOwhKECH4SrMqEuaNrI31GxwMuPjlbGzHfL WQgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=sS96QjHd/J1k4Ea/pAEm4CGF7sKNFAUCifjxo7Mkt/4=; b=n8MepjrNYn4ORBwzZyk0MZmqhPGmRCQBik/ZtHo2Km2DPEx4+rTn4arQaQgXDV7lVn jbiDMUNjjm7q87qwKeQiBezrocfAHcms6z6wli3IZC8t1gSTijFNtwQegu80yBXPCL4X HGgsLDwIiVzymYPQ7wZd0hR0hoQJSzzQu0V3pdl0UczLLP5idrbtKNr2UCND06ba6gvL 1ZGtWvb8pLysFqEyvG7+oJT3FxcXLV4RpAKpMPTSjWyAgZrxrmxil/qN5sYyEh/8WWX4 kKJwDHLGhz2bHQL6kXH85LaN5jB5G6eyPovkRCyAeS6QA3dNSPNrC69+dGkVmqTPM7DS RFDw== X-Gm-Message-State: AOAM533A3l1kVeC/z6QezOr3VUKfGtnhwNZhpoOYUBOgGJX3UoDT5Fqa 8CX6mFBYy4IqGWrL3TKak+Q= X-Google-Smtp-Source: ABdhPJxNo2Opx7bFGbKyp6oy96MfW98oJblsng/91hLBmWIjJghrMPUGs75yyH78inuTYiZCTifxrg== X-Received: by 2002:a05:620a:706:: with SMTP id 6mr28714942qkc.374.1638730356662; Sun, 05 Dec 2021 10:52:36 -0800 (PST) Received: from localhost ([68.237.93.126]) by smtp.gmail.com with ESMTPSA id j124sm5404586qkd.98.2021.12.05.10.52.36 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 05 Dec 2021 10:52:36 -0800 (PST) From: dick To: Eli Zaretskii Subject: Re: bug#52302: 28.0.50; [PATCH] Overlay strings should not increment vpos References: <87v903hs0w.fsf@dick> <83lf0y3np1.fsf@gnu.org> Date: Sun, 05 Dec 2021 13:52:35 -0500 In-Reply-To: <83lf0y3np1.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 05 Dec 2021 20:34:50 +0200") Message-ID: <87r1aqj34c.fsf@dick> User-Agent: Gnus/5.14 (Gnus v5.14) Commercial/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 52302 Cc: 52302@debbugs.gnu.org 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 (-) --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Overlay-strings-at-to_charpos-should-not-increment-v.patch >From 390e5866888a740bca2daaa9b528d1905df3ffd7 Mon Sep 17 00:00:00 2001 From: dickmao Date: Sun, 5 Dec 2021 13:46:59 -0500 Subject: [PATCH] Overlay strings at `to_charpos` should not increment vpos * src/xdisp.c (move_it_to): Recognize the invisible overlay string should not increment vpos. (move_it_vertically_backward): Rectify assertions. (resize_mini_window): Should not need to call move_it_vertically_backward (it, 0) twice. * test/src/xdisp-tests.el (xdisp-tests--minibuffer-resizing): Test. --- src/xdisp.c | 41 ++++++++++++++++++++--------------------- test/src/xdisp-tests.el | 30 +++++++++++++----------------- 2 files changed, 33 insertions(+), 38 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index 0ff6286af74..c264d7a3be1 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -10081,6 +10081,7 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos for (;;) { + bool reached_continued = false; orig_charpos = IT_CHARPOS (*it); orig_method = it->method; if (op & MOVE_TO_VPOS) @@ -10125,6 +10126,12 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos break; } } + else if (skip == MOVE_LINE_CONTINUED + && op & MOVE_TO_POS + && it->method == GET_FROM_STRING + && IT_CHARPOS (*it) == to_charpos) + /* TO_CHARPOS reached, now consuming overlay string. */ + reached_continued = true; } } else if (op & MOVE_TO_Y) @@ -10377,13 +10384,16 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos /* Reset/increment for the next run. */ recenter_overlay_lists (current_buffer, IT_CHARPOS (*it)); it->current_x = line_start_x; - line_start_x = 0; - it->hpos = 0; - it->line_number_produced_p = false; - it->current_y += it->max_ascent + it->max_descent; - ++it->vpos; last_height = it->max_ascent + it->max_descent; - it->max_ascent = it->max_descent = 0; + if (! reached_continued) + { + line_start_x = 0; + it->hpos = 0; + it->line_number_produced_p = false; + it->current_y += it->max_ascent + it->max_descent; + ++it->vpos; + it->max_ascent = it->max_descent = 0; + } } out: @@ -10490,11 +10500,11 @@ move_it_vertically_backward (struct it *it, int dy) || (it2.method == GET_FROM_STRING && IT_CHARPOS (it2) == start_pos && SREF (it2.string, IT_STRING_BYTEPOS (it2) - 1) == '\n'))); - eassert (IT_CHARPOS (*it) >= BEGV); + eassert (IT_CHARPOS (it2) >= BEGV); SAVE_IT (it3, it2, it3data); move_it_to (&it2, start_pos, -1, -1, -1, MOVE_TO_POS); - eassert (IT_CHARPOS (*it) >= BEGV); + eassert (IT_CHARPOS (it2) >= BEGV); /* H is the actual vertical distance from the position in *IT and the starting position. */ h = it2.current_y - it->current_y; @@ -12218,7 +12228,6 @@ resize_mini_window (struct window *w, bool exact_p) struct it it; int unit = FRAME_LINE_HEIGHT (f); int height, max_height; - struct text_pos start; struct buffer *old_current_buffer = NULL; int windows_height = FRAME_INNER_HEIGHT (f); @@ -12272,25 +12281,15 @@ resize_mini_window (struct window *w, bool exact_p) { init_iterator (&it, w, ZV, ZV_BYTE, NULL, DEFAULT_FACE_ID); move_it_vertically_backward (&it, height - unit); - /* The following move is usually a no-op when the stuff - displayed in the mini-window comes entirely from buffer - text, but it is needed when some of it comes from overlay - strings, especially when there's an after-string at ZV. - This happens with some completion packages, like - icomplete, ido-vertical, etc. With those packages, if we - don't force w->start to be at the beginning of a screen - line, important parts of the stuff in the mini-window, - such as user prompt, will be hidden from view. */ - move_it_by_lines (&it, 0); - start = it.current.pos; /* Prevent redisplay_window from recentering, and thus from overriding the window-start point we computed here. */ w->start_at_line_beg = false; - SET_MARKER_FROM_TEXT_POS (w->start, start); + SET_MARKER_FROM_TEXT_POS (w->start, it.current.pos); } } else { + struct text_pos start; SET_TEXT_POS (start, BEGV, BEGV_BYTE); SET_MARKER_FROM_TEXT_POS (w->start, start); } diff --git a/test/src/xdisp-tests.el b/test/src/xdisp-tests.el index ae4aacd9c7c..d1d7262665a 100644 --- a/test/src/xdisp-tests.el +++ b/test/src/xdisp-tests.el @@ -34,23 +34,19 @@ xdisp-tests--in-minibuffer (ert-deftest xdisp-tests--minibuffer-resizing () ;; bug#43519 (should - (equal - t - (xdisp-tests--in-minibuffer - (insert "hello") - (let ((ol (make-overlay (point) (point))) - (max-mini-window-height 1) - (text "askdjfhaklsjdfhlkasjdfhklasdhflkasdhflkajsdhflkashdfkljahsdlfkjahsdlfkjhasldkfhalskdjfhalskdfhlaksdhfklasdhflkasdhflkasdhflkajsdhklajsdgh")) - ;; (save-excursion (insert text)) - ;; (sit-for 2) - ;; (delete-region (point) (point-max)) - (put-text-property 0 1 'cursor t text) - (overlay-put ol 'after-string text) - (redisplay 'force) - ;; Make sure we do the see "hello" text. - (prog1 (equal (window-start) (point-min)) - ;; (list (window-start) (window-end) (window-width)) - (delete-overlay ol))))))) + (xdisp-tests--in-minibuffer + (insert "hello") + (let ((ol (make-overlay (point) (point))) + (max-mini-window-height 1) + (text (let ((s "")) + (dotimes (i 137) + (setq s (concat s (char-to-string (+ (% i 26) ?a))))) + s))) + (put-text-property 0 1 'cursor t text) + (overlay-put ol 'after-string text) + (redisplay) + (prog1 (equal (window-start) (point-min)) + (delete-overlay ol)))))) (ert-deftest xdisp-tests--minibuffer-scroll () ;; bug#44070 (let ((posns -- 2.26.2 --=-=-= Content-Type: text/plain >>>>> "EZ" == Eli Zaretskii writes: >> From: dick.r.chiang@gmail.com >> Date: Sun, 05 Dec 2021 12:37:35 -0500 >> >> >From 010b26de2993754db6bb42243b5c6c89fc5e8a50 Mon Sep 17 00:00:00 2001 >> From: dickmao >> Date: Sun, 5 Dec 2021 12:25:32 -0500 >> Subject: [PATCH] Overlay strings at `to_charpos` should not increment vpos >> >> Previously, two calls to `move_it_vertically_backward (it, 0)` were >> required to get IT back to line start. It should only ever >> take one call. EZ> Please tell more about the motivation. In which use cases this EZ> change behaves better, and why? This is a delicate code, used in EZ> many places, so we need a very good understanding of what gets EZ> fixed. >> + else if (skip == MOVE_LINE_CONTINUED >> + && it->method == GET_FROM_STRING >> + && IT_CHARPOS (*it) == to_charpos) >> + /* TO_CHARPOS reached, now consuming overlay string. */ it-> method == GET_FROM_STRING doesn't necessarily mean we are it-> consuming an overlay string. It could be a string from display it-> property, for example. >> - ++it->vpos; >> + if (! reached_continued) >> + ++it->vpos; EZ> I don't think I see the connection between the above condition and EZ> the need to increment (or not increment) VPOS. Can you elaborate on EZ> that? >> @@ -10490,11 +10497,11 @@ move_it_vertically_backward (struct it *it, >> int dy) || (it2.method == GET_FROM_STRING && IT_CHARPOS (it2) == >> start_pos && SREF (it2.string, IT_STRING_BYTEPOS (it2) - 1) == >> '\n'))); - eassert (IT_CHARPOS (*it) >= BEGV); + eassert (IT_CHARPOS >> (it2) >= BEGV); SAVE_IT (it3, it2, it3data); move_it_to (&it2, >> start_pos, -1, -1, -1, MOVE_TO_POS); - eassert (IT_CHARPOS (*it) >= >> BEGV); + eassert (IT_CHARPOS (it2) >= BEGV); EZ> Why are you replacing the assertions here? >> --- a/test/src/xdisp-tests.el >> +++ b/test/src/xdisp-tests.el EZ> What exactly is changed in this test? It looks like purely EZ> stylistic changes to me (which for some reason also lots the EZ> comments). Did I miss something? --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 05 14:06:21 2021 Received: (at 52302) by debbugs.gnu.org; 5 Dec 2021 19:06:21 +0000 Received: from localhost ([127.0.0.1]:59463 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtwq5-00025B-H6 for submit@debbugs.gnu.org; Sun, 05 Dec 2021 14:06:21 -0500 Received: from mail-qt1-f182.google.com ([209.85.160.182]:38485) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtwq4-000250-Us for 52302@debbugs.gnu.org; Sun, 05 Dec 2021 14:06:21 -0500 Received: by mail-qt1-f182.google.com with SMTP id 8so8866892qtx.5 for <52302@debbugs.gnu.org>; Sun, 05 Dec 2021 11:06:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Mr718UBtHuoZhkD1Tso8bf2pHJQDTALt7VOhdP/e3Ic=; b=UJe0wkl8pTHibfKw7k5DCB2xl5sbDn14IWK8F5RZ6GOqaWgqwpqu7D6TqZwKkVhRN2 wz2MieeXvOXhmu1UGND0vmO+nBXpETmkVKvPtGZgiIB+3dZkTC78MX3Cbr16bnR4JCby THg/VBlukc8BbRMF47LpLWHH1oKVeAYfMjh/FxuIB74dwrx7NPT649rPxDWdJaVJuELg QHMAbTAf3Ah1PwgzDM4V8hJjgrFpKOkqoI+6QPrmytFWIW3DPIdfeCNNdQA2t8u+llst OvqUsdOVi4cN3Jxwf0nCAxibYPU3icqf3Dv2HSlcA/QFASx35E9Klr2zaMSKcZpAStZM W6DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=Mr718UBtHuoZhkD1Tso8bf2pHJQDTALt7VOhdP/e3Ic=; b=sjEm8StRMqihjfWnaDNqkmqrT3BgR3KqKgdHGf8/05uaWO5+4euX69EMxalfA67rEr AILMnKeB4c7fEv8Mp4u0EWT9PVLaYtBf7KHEji9n22y5BCPLcAqMA53xFGlWehXYdN3G xZK86calY4WwyCtVqADEtjenLfBnoFyq8qkI4X7JKEkzii6C6o1s+N0IuLHhgL4GObYS MRlMoZAjfWTiFKxU6FUvP2/2nAwHxys6gNc+eRer5+MXdKhi3haj59asK68TYCQRPEa/ 4CcqBtMrkUUNv+jUBS/ZGZvDlUQ/RBA7YOpVObeRO0KERhlhTk6Z/kBLZMd0BpADxg0t 2NVQ== X-Gm-Message-State: AOAM531AsxIApB+nRnlFAUhobq86ZnMnzB4lHjVMzolIoDCwbl8q4vFk 7Dj9uEzyaCM9daeJZsNLpKs= X-Google-Smtp-Source: ABdhPJzONMgR3bvYE5OrNL95z9wg9JzwSEWBBTFo/eh60u/7k37kKiF5b0ur4gons2FFiddwO8c0iQ== X-Received: by 2002:ac8:7d87:: with SMTP id c7mr34308198qtd.501.1638731175433; Sun, 05 Dec 2021 11:06:15 -0800 (PST) Received: from localhost ([68.237.93.126]) by smtp.gmail.com with ESMTPSA id m1sm6444592qtk.34.2021.12.05.11.06.14 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 05 Dec 2021 11:06:14 -0800 (PST) From: dick To: Eli Zaretskii Subject: Re: bug#52302: 28.0.50; [PATCH] Overlay strings should not increment vpos References: <87v903hs0w.fsf@dick> <83lf0y3np1.fsf@gnu.org> Date: Sun, 05 Dec 2021 14:06:14 -0500 In-Reply-To: <83lf0y3np1.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 05 Dec 2021 20:34:50 +0200") Message-ID: <87mtlej2hl.fsf@dick> User-Agent: Gnus/5.14 (Gnus v5.14) Commercial/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 52302 Cc: 52302@debbugs.gnu.org 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 (-) Just want to get `move_it_to` right on a (MOVE_TO_VPOS | MOVE_TO_POS) to a line ending in an invisible string. This is nicely tested in `xdisp-tests--minibuffer-resizing` in reference to bug#43519, but the erstwhile fix was a paper-over (calling move_it_vertically_backward with arg 0 as many times as it took to get back to line start, then adding a long-winded justification -- no dearth of those). If you're not interested or not wanting the FUD, I understand. It's not a showstopper. From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 05 14:48:18 2021 Received: (at 52302) by debbugs.gnu.org; 5 Dec 2021 19:48:18 +0000 Received: from localhost ([127.0.0.1]:59518 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtxUg-0003Aw-D6 for submit@debbugs.gnu.org; Sun, 05 Dec 2021 14:48:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53980) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtxUe-0003Af-Rd for 52302@debbugs.gnu.org; Sun, 05 Dec 2021 14:48:17 -0500 Received: from [2001:470:142:3::e] (port=47882 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtxUZ-0000gQ-Il; Sun, 05 Dec 2021 14:48:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=P/e2ryQ9GLNaCgLWSGhzitVRf27OrU9bvwgZZAoearw=; b=mOsGMRwU1XsT wAGNDVbZAMJOWaegD0PMegMovK8f+ayF57DvcRZZfxg3LgqLc7uFKzkn2G8x8ZRbPkt3rtR9m6UWL swUglDReJ8C6TiXLmGZ9wANSP3/7kSP3ay3T1nddqENVht8gHTvm8dxihIPEfZeppS4IkVEpU7bTr mvqN1mDXQlIs0QJaMVAZhXTcegw69LfHBQrZ583lKQ8ycqGD16Rh1sOYkSgRPNdp9FhBY7zc4FH1k f4FdmYr80JJVw7aQ4JAHrW9E/PrfoXnVv2PEmKp73qcDiUxa4JIdoZAmCiSfytCi4KSNYfVIcCwfL d697Qps+YKk/75eU6Zvcmg==; Received: from [87.69.77.57] (port=2232 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtxUS-0005Xl-C5; Sun, 05 Dec 2021 14:48:11 -0500 Date: Sun, 05 Dec 2021 21:47:59 +0200 Message-Id: <83ilw23kb4.fsf@gnu.org> From: Eli Zaretskii To: dick In-Reply-To: <87mtlej2hl.fsf@dick> (message from dick on Sun, 05 Dec 2021 14:06:14 -0500) Subject: Re: bug#52302: 28.0.50; [PATCH] Overlay strings should not increment vpos References: <87v903hs0w.fsf@dick> <83lf0y3np1.fsf@gnu.org> <87mtlej2hl.fsf@dick> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52302 Cc: 52302@debbugs.gnu.org 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: dick > Cc: 52302@debbugs.gnu.org > Date: Sun, 05 Dec 2021 14:06:14 -0500 > > Just want to get `move_it_to` right on a (MOVE_TO_VPOS | MOVE_TO_POS) to > a line ending in an invisible string. Are you using "invisible" here as in "text with the invisible property"? Or does "invisible" mean "not shown on display"? If the latter, then I don't understand what does visibility have to do with coordinates maintained by move_it_to -- that function doesn't care whether the text it traverses is or isn't shown. > This is nicely tested in > `xdisp-tests--minibuffer-resizing` in reference to bug#43519, but the > erstwhile fix was a paper-over (calling move_it_vertically_backward with > arg 0 as many times as it took to get back to line start, then adding a > long-winded justification -- no dearth of those). I see just one call to move_it_vertically_backward, not "as many as". And the long comment explains why we call move_it_to (also a single call), not move_it_vertically_backward. So I don't understand what you are saying here. And the overall motivation is also not clear -- is it just to save us one call to move_it_vertically_backward? From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 05 17:10:13 2021 Received: (at 52302) by debbugs.gnu.org; 5 Dec 2021 22:10:13 +0000 Received: from localhost ([127.0.0.1]:59910 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtzi0-0001Dl-Po for submit@debbugs.gnu.org; Sun, 05 Dec 2021 17:10:12 -0500 Received: from mail-qt1-f174.google.com ([209.85.160.174]:42803) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtzhz-0001DQ-4G for 52302@debbugs.gnu.org; Sun, 05 Dec 2021 17:10:11 -0500 Received: by mail-qt1-f174.google.com with SMTP id z9so9100146qtj.9 for <52302@debbugs.gnu.org>; Sun, 05 Dec 2021 14:10:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=zmgi30l2vyXQOBxj5NDChnxMM9IxDQtVnjEhm7Xc8H4=; b=Fbp+/2Dwn06o382BPb9cyasnEJ4hP9TvB3KGKKCs0ev3bgxzvJTwIwnxfHqxk/j7Vm Q3imOfJBc687E8TvN7igeIR1u1UW9J3WQDMRKzcaDNRUCQ+929nZJS2aAHSz+MgNpPU0 osDK16jiLIWmP+JI0OVNzrNzK8DZ8pbSPa6ZHrMGxtWXQ5o4H7GUIq6HutW2AnTpeEIS gR3ca8UJlwkPYEVSmE4CxvDt5/gcpIKihVNcauvCmgVkX6cY3x7H5BrK4NArq09w7LxY FStre7mvzDRfEAhgBnxlFGqoFSgYbkk/vvS3zTGSIwUw5HK19PjOUpqLtLG+KMQSeU56 6YRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=zmgi30l2vyXQOBxj5NDChnxMM9IxDQtVnjEhm7Xc8H4=; b=I19YLNX2xSvN8S2WVBnVgFmJgqYZ2gSgWRMvjH0G4YsxlEo4dWG5gbxJ2thZNHAPe1 QBcdQYkOCoP6EtQH2TuKST6XSqQTZWo+NepPGMPLuaCUKazEKKJzfomcy1Y1MtURIonc 1vviWmiPejtyoon58Gb+kyK4JiUWLQjbY4okpP1CxTgXJ6tjKDOEjm9lTRl2B0wHBHxG qyCssoy0DCOxRSjLonqdwU3bUX0++K1F0Njd59FfUe7Q2sjCcHUZUgxctONTVggQcGUf O/CaQzSYCkSF6eBKBGW7PvOUxWAQLk2I1pnKrjQdf/to9kiwAQN7K64y8PQ9PTWz8l5k z/1Q== X-Gm-Message-State: AOAM533Jha9whFor/kv3m7N7kIMNCUoNwBK2D+wIDgdPUjvTfWTaBHVu PZ0rossHXI8/1WDIXf6P6q6F9AbPA7A= X-Google-Smtp-Source: ABdhPJyLWDpzDOg255g12JCYeFWvhoJNT0rSPxpxTM0rpCBgZPARl6/YbnmVB4OCPi6uYQTMUtPIQA== X-Received: by 2002:ac8:5f82:: with SMTP id j2mr35322411qta.572.1638742205785; Sun, 05 Dec 2021 14:10:05 -0800 (PST) Received: from localhost ([68.237.93.126]) by smtp.gmail.com with ESMTPSA id 8sm6720814qtz.28.2021.12.05.14.10.05 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 05 Dec 2021 14:10:05 -0800 (PST) From: dick To: Eli Zaretskii Subject: Re: bug#52302: 28.0.50; [PATCH] Overlay strings should not increment vpos References: <87v903hs0w.fsf@dick> <83lf0y3np1.fsf@gnu.org> <87mtlej2hl.fsf@dick> <83ilw23kb4.fsf@gnu.org> Date: Sun, 05 Dec 2021 17:10:05 -0500 In-Reply-To: <83ilw23kb4.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 05 Dec 2021 21:47:59 +0200") Message-ID: <87ilw2itz6.fsf@dick> User-Agent: Gnus/5.14 (Gnus v5.14) Commercial/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 52302 Cc: 52302@debbugs.gnu.org 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 (-) > Are you using "invisible" here as in "text with the invisible > property"? Good question. I'm also annoyed when comments use "invisible" interchangeably. I have come to refer to display prop strings as "unvisible," so my bad. > I see just one call to move_it_vertically_backward, not "as many as". Two: move_it_vertically (&it, unit - bottom_y); // unit - bottom_y is zero move_it_by_lines (&it, 0); // that's the second one > And the overall motivation is also not clear -- is it just to save us > one call to move_it_vertically_backward? I want to live in an xdisp world where calling move_it_vertically_backward(0) once gets me to line start without exception. From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 06 14:47:56 2021 Received: (at 52302) by debbugs.gnu.org; 6 Dec 2021 19:47:56 +0000 Received: from localhost ([127.0.0.1]:35488 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muJxs-0004zW-4r for submit@debbugs.gnu.org; Mon, 06 Dec 2021 14:47:56 -0500 Received: from mail-qv1-f52.google.com ([209.85.219.52]:34392) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muJxq-0004yv-R1 for 52302@debbugs.gnu.org; Mon, 06 Dec 2021 14:47:55 -0500 Received: by mail-qv1-f52.google.com with SMTP id i13so10941255qvm.1 for <52302@debbugs.gnu.org>; Mon, 06 Dec 2021 11:47:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=QBZftdIMd1NraTwOU5u6X4WkKCwKIUs7+Sm7yUn1Uhc=; b=WK9tgz+KGLbfk46S+qPpfZzdF5K5Rmjs+cOCceH5qYE/PM5Q59+emWrIsTY+E19iz1 kCL03Vn6kGX6aXpI8gYoqxM2w7Ss/fgxpwta6md8yaMOoEXwih8lCohiKlDyztuy6Um5 BsmHSgFNpp3JqY+1miDCFXDd26ZOvrwk/Mz34u1ZwKOqFqOM+3hy0Uon56XKVcGqT8AZ sD9AzWqxJpkAVuzGJJB9h6gTDkAj1pU50mzLHi6y01JNo5iNTvbtcFR8fo/SW91+/NHL Uq1nUDP/Q3UAXxlEaoDCaKHrGb7vKz28rK7Bvtzj+CsCBIuQqk3VCU3d7vRwXuDQAYk3 fAQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=QBZftdIMd1NraTwOU5u6X4WkKCwKIUs7+Sm7yUn1Uhc=; b=1RUmMLHpcAh6q3U2QiUWiFstPhK3Ybx+J7fMr0z5yYEkvQ92gnRx8CE1c2UZzmphoG xGJGcn0om/1T3+Uca46ledYRFsuOxON25lrgKcOB/Occlmnlw9tIEHXL4A9V1xLmZpNL i9zm9F2smdO9Zrp+R80gO4rIcDFIlRg42pTvJXMe66b6F3pYu7B1IJoMhZwb0To6bgqs +6YUL4GsS/UpBVQK8J3p1S8y3+nX1XHQh3PtJm32JQcxviNtqORSMFq3m1tWE/aA3roo kWZj0m+IxrN6xsE8ybr+9MqKfsgYujNTZegNXWNZYMNcHTrBgvtodg6pI0Ee8sVsvkmH m+oA== X-Gm-Message-State: AOAM531T9GO8a6dF0zV/QY3eJa5QbMFjYzdUhV8yWPVW9e3YtYveVsSb 1Pfhqi/UIFYpwXLa51CEj9gwVd/JIkg= X-Google-Smtp-Source: ABdhPJwR8tW08Qf+NENvCe/wBVc45wx8ZtxquC/sMKWwemRACEpdPSLcf79ydUHSRSl6H7OpK2IP6A== X-Received: by 2002:a05:6214:2a84:: with SMTP id jr4mr39798823qvb.35.1638820068938; Mon, 06 Dec 2021 11:47:48 -0800 (PST) Received: from localhost ([68.237.93.126]) by smtp.gmail.com with ESMTPSA id x4sm8239342qtw.44.2021.12.06.11.47.46 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Dec 2021 11:47:46 -0800 (PST) From: dick To: 52302@debbugs.gnu.org Subject: Re: bug#52302: 28.0.50; [PATCH] Overlay strings should not increment vpos References: <87v903hs0w.fsf@dick> Date: Mon, 06 Dec 2021 14:47:45 -0500 In-Reply-To: <87v903hs0w.fsf@dick> (dick r. chiang's message of "Sun, 05 Dec 2021 12:37:35 -0500") Message-ID: <875ys1ikgu.fsf@dick> User-Agent: Gnus/5.14 (Gnus v5.14) Commercial/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 52302 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 (-) --=-=-= Content-Type: text/plain A more dangerous change like the below would break the cycle of fixes that minimize impact while maximizing obfuscation. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-A-small-change-with-disastrous-potential.patch >From 5f734c1d50953836dda444b8371642c6f20d4065 Mon Sep 17 00:00:00 2001 From: dickmao Date: Mon, 6 Dec 2021 14:30:17 -0500 Subject: [PATCH] A small change with disastrous potential * src/xdisp.c (move_it_in_display_line_to): How this function has managed to get by without a notion of visibility is a real mystery. --- src/xdisp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xdisp.c b/src/xdisp.c index 0ff6286af74..1522c6b3193 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -9561,7 +9561,7 @@ #define IT_RESET_X_ASCENT_DESCENT(IT) \ PRODUCE_GLYPHS (it); - if (it->area != TEXT_AREA) + if (it->area != TEXT_AREA || it->method == GET_FROM_STRING) { prev_method = it->method; if (it->method == GET_FROM_BUFFER) -- 2.26.2 --=-=-= Content-Type: text/plain I'll explore this more deeply in my longlines rewrite. In the meantime, closing. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 06 14:48:53 2021 Received: (at control) by debbugs.gnu.org; 6 Dec 2021 19:48:53 +0000 Received: from localhost ([127.0.0.1]:35492 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muJyn-00051N-Ei for submit@debbugs.gnu.org; Mon, 06 Dec 2021 14:48:53 -0500 Received: from mail-qv1-f42.google.com ([209.85.219.42]:40494) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muJyl-000519-Vu for control@debbugs.gnu.org; Mon, 06 Dec 2021 14:48:52 -0500 Received: by mail-qv1-f42.google.com with SMTP id b11so10919927qvm.7 for ; Mon, 06 Dec 2021 11:48:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:to:from:subject; bh=fvEEXx2ArRrRwBcI3StMhvqcIVv46AioCTVGN5nKfnU=; b=YZKtflCF4z43lnqBapceK4U/vPTnGUGm18LNvQd5N5EmW0TF+gvLRsT20UafQH33ij EBIBDzioqvBIqWAda4kn99g5Q6IDfoyyLxS/MX85B8f+PqIPOXvMIRKqFfUYi2aI1u91 OyVv+ETSSXFuAga7O/nP+rFFS9EeB/OWzRLJEX9E1sTe5OnUcrX65BOBbA55p8Y2xSTe i+2guKNI/NbBu1K69cC/9hFE3Y9Y4BklTZUZ5r/TVGEH/HgBFgfrZj5YB33VgzbUzb+8 9ugEBxrd2hPXXwtXcHaS05LL93D5oFmFnRYVucwuGsJHgJyoirnmHKASsOa3rOZhjB17 TqEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:to:from:subject; bh=fvEEXx2ArRrRwBcI3StMhvqcIVv46AioCTVGN5nKfnU=; b=6QrfJUItc1eP3mzExBzpDU05leTiNGV6iuWmEyJ/6XEPKq2piLi11PwzWz//H74Hj3 fpZL/aaCaC6+v62ms/mgkU9HnBL32cUvmr/yUB02fIpo/nfLkNi65tpVph/qEdAeqDhE gTSz65oXL/foMEyxY18itfSqWWH5aW3L6oaKYQk5qIly2Nlhg1BUjwb5P6UZFoijFMsD 06AKikxuJC57v5amTaTcrmI5vRf4qRN2dUyU9xPuhpoHhfBayn5Fi0oxlEvd8IIRAjEf O43Fh7ObBG6lhbP1d6DXFhmF7VAeJl/51bbQkqDmmzhDgc4UPHHsQ6MP3Dhg1Qwz6EqN RsCw== X-Gm-Message-State: AOAM5332I2eAJ8LBPtN4BHOYPjXCj9xOBjyZ8BegheKUZ0GZHPe/3evc TTYPPbO2RltFZ24TFooE4Cx0jvSdUzk= X-Google-Smtp-Source: ABdhPJzKUc10IX7g4AdxkGBq00Tbx+NAcnQMCL3Tu+C6SWE83dFQb0cX1cfNRGFtLCrD3qzc00zj5w== X-Received: by 2002:a0c:f942:: with SMTP id i2mr39723898qvo.51.1638820126344; Mon, 06 Dec 2021 11:48:46 -0800 (PST) Received: from localhost ([68.237.93.126]) by smtp.gmail.com with ESMTPSA id h11sm7186875qko.18.2021.12.06.11.48.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Dec 2021 11:48:46 -0800 (PST) Message-ID: <61ae691e.1c69fb81.ce24f.ba12@mx.google.com> Date: Mon, 06 Dec 2021 14:48:45 -0500 To: control@debbugs.gnu.org From: dick Subject: control message for bug #52302 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control 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 (-) close 52302 28.1 quit From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 06 15:03:09 2021 Received: (at 52302) by debbugs.gnu.org; 6 Dec 2021 20:03:09 +0000 Received: from localhost ([127.0.0.1]:35503 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muKCa-0007a2-U9 for submit@debbugs.gnu.org; Mon, 06 Dec 2021 15:03:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57420) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muKCY-0007ZW-Kp for 52302@debbugs.gnu.org; Mon, 06 Dec 2021 15:03:07 -0500 Received: from [2001:470:142:3::e] (port=39574 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muKCP-0007qe-01; Mon, 06 Dec 2021 15:02:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=c2w3wvq66qTvjdd8Htgpac/Z8z+EtwGRo+G4XDGyg/4=; b=la1bSIh42LZh U1lrEGySAH9UIHBE4VwderS1as1hroXRBFf8MZS9sYOcK1acfkLGpVvdH2/fiu95hF29iMB1FQiqx V4k5clcqBY0J/4Tr87bGdOute+c33DmfMoX6NQlXv04p6ZR3t0v6M489fDSXalpeV2ajOpFMVjb+0 2dsXf5ZyA++yqAJAbTfjCckUtFUr0lV0iTYMOrxfjqI64NyGDedXpIgEz5np+xSGx/qklwZiNDBDW jtmoLJ8D36ZosN3dvcsOjliNO5cmWAeaWoAOz0/c1p4T+SX0sSRIfx//Ny1MOqDy5JjzK7rG0uRVd VlUA48j+0lKteA93bUX+rQ==; Received: from [87.69.77.57] (port=4465 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muKCO-0003B1-5N; Mon, 06 Dec 2021 15:02:57 -0500 Date: Mon, 06 Dec 2021 22:02:54 +0200 Message-Id: <8335n51oy9.fsf@gnu.org> From: Eli Zaretskii To: dick In-Reply-To: <875ys1ikgu.fsf@dick> (message from dick on Mon, 06 Dec 2021 14:47:45 -0500) Subject: Re: bug#52302: 28.0.50; [PATCH] Overlay strings should not increment vpos References: <87v903hs0w.fsf@dick> <875ys1ikgu.fsf@dick> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52302 Cc: 52302@debbugs.gnu.org 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: dick > Date: Mon, 06 Dec 2021 14:47:45 -0500 > > A more dangerous change like the below would break the cycle of fixes > that minimize impact while maximizing obfuscation. > > >From 5f734c1d50953836dda444b8371642c6f20d4065 Mon Sep 17 00:00:00 2001 > From: dickmao > Date: Mon, 6 Dec 2021 14:30:17 -0500 > Subject: [PATCH] A small change with disastrous potential > > * src/xdisp.c (move_it_in_display_line_to): How this function has > managed to get by without a notion of visibility is a real mystery. > --- > src/xdisp.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/xdisp.c b/src/xdisp.c > index 0ff6286af74..1522c6b3193 100644 > --- a/src/xdisp.c > +++ b/src/xdisp.c > @@ -9561,7 +9561,7 @@ #define IT_RESET_X_ASCENT_DESCENT(IT) \ > > PRODUCE_GLYPHS (it); > > - if (it->area != TEXT_AREA) > + if (it->area != TEXT_AREA || it->method == GET_FROM_STRING) > { > prev_method = it->method; > if (it->method == GET_FROM_BUFFER) I don't understand this change. Glyphs delivered from display and overlay strings are subject to wrapping and truncation exactly like glyphs delivered from buffer text. Only glyphs that are written into the display margins are silently truncated. So I don't think your additional condition is correct. For example, what happens if there's a display or overlay string that is very long, so that it overflows the window width? This additional condition will cause the code behave as if the window had infinite width, for the whole time it traverses the string. From unknown Tue Jun 24 13:54:17 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 04 Jan 2022 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator