From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matt Armstrong Newsgroups: gmane.emacs.bugs Subject: bug#58958: 29.0.50; overlays fail to evaporate across indirect buffers Date: Tue, 01 Nov 2022 19:45:19 -0700 Message-ID: <87r0ym9irk.fsf@rfc20.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2685"; mail-complaints-to="usenet@ciao.gmane.io" To: 58958@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 02 03:46:23 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oq3lm-0000RL-TC for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 02 Nov 2022 03:46:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oq3lY-0004HN-3K; Tue, 01 Nov 2022 22:46:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oq3lU-0004Gu-Ij for bug-gnu-emacs@gnu.org; Tue, 01 Nov 2022 22:46:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oq3lS-0007ZA-NX for bug-gnu-emacs@gnu.org; Tue, 01 Nov 2022 22:46:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oq3lS-00064D-Jj for bug-gnu-emacs@gnu.org; Tue, 01 Nov 2022 22:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Matt Armstrong Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 02 Nov 2022 02:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 58958 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.166735714422601 (code B ref -1); Wed, 02 Nov 2022 02:46:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Nov 2022 02:45:44 +0000 Original-Received: from localhost ([127.0.0.1]:44568 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oq3l9-0005ph-Dh for submit@debbugs.gnu.org; Tue, 01 Nov 2022 22:45:44 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:48248) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oq3l7-0005ks-Po for submit@debbugs.gnu.org; Tue, 01 Nov 2022 22:45:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oq3l7-000477-4D for bug-gnu-emacs@gnu.org; Tue, 01 Nov 2022 22:45:41 -0400 Original-Received: from relay11.mail.gandi.net ([2001:4b98:dc4:8::231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oq3kt-0007FU-E5 for bug-gnu-emacs@gnu.org; Tue, 01 Nov 2022 22:45:37 -0400 Original-Received: (Authenticated sender: matt@rfc20.org) by mail.gandi.net (Postfix) with ESMTPSA id 3FED9100002 for ; Wed, 2 Nov 2022 02:45:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rfc20.org; s=gm1; t=1667357124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=+i4wWRvZDyCCx9NgfjvC4cOOXpmbhwzwsKxXoWQg+A4=; b=OtMC4d6hdbe8B+nhnCc4BUBB8I928xU4QNIYi6ECE8pcO/6rp5l4mAgKO/7ZcewSartotF PahrmxztkkcFkHM6OuWM95Cd++2A7CcxgjLnOXMHfl2lxK8y3XV/oDlZUT/VAPGJuZmmMZ OXVqd52UzoV7DujpM5hnQpacA51F+UZYtW6mxNkPmESe8dD8bUaU5k2VHL9BFoq6mjIYdG NCY4oJDGG9aPsXU4KaIC1TUA9q3x3NB8WpILRBoDLom6g6bBtolSHI4KLQytaXcyeG+n3o cwOJlYe42IN9yv/LubBYAG6ny4lFwdwBgJmddOPHdjvbVhcPDY3K7uPXw8or1Q== Original-Received: from matt by naz with local (Exim 4.96) (envelope-from ) id 1oq3kl-000QmO-0G for bug-gnu-emacs@gnu.org; Tue, 01 Nov 2022 19:45:19 -0700 Received-SPF: pass client-ip=2001:4b98:dc4:8::231; envelope-from=matt@rfc20.org; helo=relay11.mail.gandi.net 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246833 Archived-At: --=-=-= Content-Type: text/plain This bug is inspired by bug#58928, but not the same, and repros after Stefan's fix for that bug. In fact, it repros in Emacs 27 as well. See attached patch for repro steps as an ert test. Essentially, either: 1) Create an overlay in an indirect buffer, set its 'evaporate property to t. 2) Delete text from the base buffer such that the overlay is empty. 3) Verify it is no longer in the indirect buffer (in fact, it remains as an empty overlay). Repeat the above swapping the indirect and base buffers. The bug goes both ways. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Add-a-test-for-overlay-evaporation-across-indirect-b.patch >From 3da7e442467d5dad3c875d5bfb7e68017400a14b Mon Sep 17 00:00:00 2001 From: Matt Armstrong Date: Tue, 1 Nov 2022 19:40:20 -0700 Subject: [PATCH] Add a test for overlay evaporation across indirect buffers * test/src/buffer-tests.el (buffer-tests--overlays-indirect-evaporate): Test evaporation of overlays triggered by deleting text in base and in indirect buffers. Test doesn't pass at the moment. --- test/src/buffer-tests.el | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/test/src/buffer-tests.el b/test/src/buffer-tests.el index b96a8dcacd2..a4a1f609fd2 100644 --- a/test/src/buffer-tests.el +++ b/test/src/buffer-tests.el @@ -296,6 +296,42 @@ buffer-tests--overlays-indirect-bug58928 (should (equal (overlay-start ol1) (overlay-start ol2))) (should (equal (overlay-end ol1) (overlay-end ol2)))))) +(ert-deftest buffer-tests--overlays-indirect-evaporate () + "Verify that deleting text evaporates overlays in every related buffer. + +Deleting characters from either a base or an indirect buffer +should evaporate overlays in both." + :expected-result :failed + ;; Loop twice, erasing from the base buffer the first time and the + ;; indirect buffer the second. + (dolist (erase-where '(base indirect)) + (ert-info ((format "erase-where %S" erase-where)) + (with-temp-buffer + (insert "xxx") + (let* ((beg 2) + (end 3) + (base (current-buffer)) + (base-overlay (make-overlay beg end base)) + (indirect (make-indirect-buffer + base + (generate-new-buffer-name + (concat (buffer-name base) "-indirect")))) + (indirect-overlay (make-overlay beg end indirect))) + (overlay-put base-overlay 'evaporate t) + (overlay-put indirect-overlay 'evaporate t) + (with-current-buffer (pcase-exhaustive erase-where + (`base base) + (`indirect indirect)) + (delete-region beg end)) + (ert-info ((prin1-to-string + `(,base ,base-overlay ,indirect ,indirect-overlay))) + (should (not (buffer-live-p (overlay-buffer base-overlay)))) + (should (not (buffer-live-p (overlay-buffer indirect-overlay)))) + (should (equal nil (with-current-buffer base + (overlays-in (point-min) (point-max))))) + (should (equal nil (with-current-buffer indirect + (overlays-in (point-min) (point-max))))))))))) + (ert-deftest overlay-evaporation-after-killed-buffer () (let* ((ols (with-temp-buffer (insert "toto") -- 2.35.1 --=-=-= Content-Type: text/plain In GNU Emacs 29.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.24.34, cairo version 1.16.0) of 2022-10-30 built on naz Repository revision: 73953b23aad5af80275838cd3b1c88e045e1856e Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12201003 System Description: Debian GNU/Linux bookworm/sid Configured using: 'configure 'CFLAGS=-O2 -g3'' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: notmuch-show Minor modes in effect: msb-mode: t display-time-mode: t global-tab-line-mode: t tab-line-mode: t envrc-global-mode: t envrc-mode: t shell-dirtrack-mode: t auto-insert-mode: t keyfreq-autosave-mode: t keyfreq-mode: t savehist-mode: t icomplete-vertical-mode: t icomplete-mode: t editorconfig-mode: t which-key-mode: t electric-pair-mode: t override-global-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tab-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 buffer-read-only: t column-number-mode: t line-number-mode: t visual-line-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t temp-buffer-resize-mode: t Load-path shadows: ~/env/elisp/ol-notmuch hides /home/matt/.config/emacs/elpa/ol-notmuch-20220428.1337/ol-notmuch /home/matt/.config/emacs/elpa/transient-20221028.1430/transient hides /home/matt/git/e/daily-driver/lisp/transient Features: (shadow emacsbug cl-print pulse color display-line-numbers flymake-proc flymake compile edebug ert ewoc debug backtrace mm-archive eudc-capf eudc cus-edit cus-start cus-load eudc-vars apropos my timezone bug-reference shortdoc ob-ditaa ob-plantuml org-clock org-colview org-crypt org-plot help-fns radix-tree magit-base textsec uni-scripts idna-mapping ucs-normalize uni-confusable textsec-check qp dabbrev sort company-oddmuse company-keywords company-etags etags fileloop xref company-gtags company-dabbrev-code company-dabbrev company-files company-clang company-capf company-cmake company-semantic company-template company-bbdb company copyright bookmark pp tabify mail-extr org-capture shfmt reformatter sh-script executable vc-git vc-dispatcher autorevert mule-util misearch multi-isearch notmuch notmuch-tree notmuch-jump notmuch-hello notmuch-show notmuch-print notmuch-crypto notmuch-mua notmuch-message notmuch-draft notmuch-maildir-fcc notmuch-address notmuch-company notmuch-parser notmuch-wash diff-mode coolj goto-addr icalendar diary-lib diary-loaddefs notmuch-tag crm notmuch-lib notmuch-compat pcase hl-line protbuf msb time flyspell ispell org-element avl-tree generator ol-w3m ol-rmail ol-mhe ol-irc ol-info org-habit org-agenda org-refile ol-gnus nnselect gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig gnus-sum gnus-group gnus-undo gnus-start gnus-dbus dbus gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time gnus-spec gnus-int gnus-range message sendmail yank-media rfc822 mml mml-sec epa derived epg rfc6068 epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win ol-eww eww xdg url-queue shr pixel-fill kinsoku url-file svg xml dom puny mm-url gnus nnheader gnus-util text-property-search mail-utils range wid-edit mm-util mail-prsvr ol-doi org-link-doi ol-docview doc-view filenotify jka-compr image-mode exif dired dired-loaddefs ol-bibtex ol-bbdb tab-line server envrc inheritenv web-mode disp-table nix-mode ffap thingatpt smie nix-repl nix-shell nix-store magit-section dash compat-27 compat-26 nix-log nix-instantiate nix-shebang nix-format nix dirtrack ob-shell shell ob-ruby ob-python python compat compat-macs ob-dot org-protocol org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src ob-comint org-pcomplete pcomplete comint ansi-osc ansi-color ring org-list org-faces org-entities noutline outline org-version ob-emacs-lisp ob-core ob-eval org-table oc-basic bibtex iso8601 time-date org-keys oc org-loaddefs find-func cal-menu calendar cal-loaddefs finder-inf ol-notmuch ol rx org-compat org-macs format-spec skeleton autoinsert advice keyfreq project edmacro kmacro warnings icons savehist icomplete editorconfig editorconfig-core editorconfig-core-handle editorconfig-fnmatch which-key package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source eieio eieio-core password-cache json subr-x map byte-opt url-vars cl-extra help-mode cl-macs gv cl-seq elec-pair use-package use-package-ensure use-package-delight use-package-diminish use-package-bind-key bind-key easy-mmode use-package-core cl-loaddefs cl-lib bytecomp byte-compile info bazel-autoloads clang-format+-autoloads clang-format-autoloads cmake-mode-autoloads d-mode-autoloads debbugs-autoloads editorconfig-autoloads elpy-autoloads company-autoloads envrc-autoloads exec-path-from-shell-autoloads flymake-ruby-autoloads flymake-easy-autoloads flymake-yamllint-autoloads go-mode-autoloads google-c-style-autoloads graphviz-dot-mode-autoloads highlight-indentation-autoloads inheritenv-autoloads magit-autoloads git-commit-autoloads markdown-mode-autoloads meson-mode-autoloads nix-mode-autoloads magit-section-autoloads dash-autoloads nixpkgs-fmt-autoloads ol-notmuch-autoloads notmuch-autoloads orderless-autoloads org-drill-autoloads ox-hugo-autoloads persist-autoloads pylint-autoloads pyvenv-autoloads s-autoloads shfmt-autoloads reformatter-autoloads tomelr-autoloads transient-autoloads use-package-autoloads bind-key-autoloads vertico-autoloads web-mode-autoloads which-key-autoloads with-editor-autoloads compat-autoloads yaml-mode-autoloads yasnippet-autoloads rmc iso-transl tooltip cconv 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 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 lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process emacs) Memory information: ((conses 16 941521 83146) (symbols 48 39704 98) (strings 32 233884 11078) (string-bytes 1 6684537) (vectors 16 102158) (vector-slots 8 2025953 286858) (floats 8 543 603) (intervals 56 32489 598) (buffers 984 37)) --=-=-=--