From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: miha--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#58175: 29.0.50; M-x window-swap-states during an active mark leaves behind a region overlay Date: Thu, 29 Sep 2022 19:29:46 +0200 Message-ID: <86sfkaay2d.fsf@miha-pc> Reply-To: miha@kamnitnik.top Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27445"; mail-complaints-to="usenet@ciao.gmane.io" To: 58175@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 29 20:03:20 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 1odxsV-0006vO-Sw for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 29 Sep 2022 20:03:20 +0200 Original-Received: from localhost ([::1]:42766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odxsU-0000Rl-VF for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 29 Sep 2022 14:03:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38138) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odx9i-0002kq-U0 for bug-gnu-emacs@gnu.org; Thu, 29 Sep 2022 13:17:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40437) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1odx9i-0002mi-Lg for bug-gnu-emacs@gnu.org; Thu, 29 Sep 2022 13:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1odx9i-00037M-DW for bug-gnu-emacs@gnu.org; Thu, 29 Sep 2022 13:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: miha@kamnitnik.top Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 29 Sep 2022 17:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 58175 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.166447177311916 (code B ref -1); Thu, 29 Sep 2022 17:17:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Sep 2022 17:16:13 +0000 Original-Received: from localhost ([127.0.0.1]:39515 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odx8u-000368-Db for submit@debbugs.gnu.org; Thu, 29 Sep 2022 13:16:12 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:35384) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odx8o-00035x-FG for submit@debbugs.gnu.org; Thu, 29 Sep 2022 13:16:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45068) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odx8o-0001X9-4P for bug-gnu-emacs@gnu.org; Thu, 29 Sep 2022 13:16:06 -0400 Original-Received: from kamnitnik.top ([2001:19f0:5001:bf2:5400:2ff:fee0:2626]:59942) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odx8j-0002df-Q9 for bug-gnu-emacs@gnu.org; Thu, 29 Sep 2022 13:16:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kamnitnik.top; s=mail; t=1664471758; bh=2Pbjju8HydcminQHX40efTF+3LdpjYyuviNMtDeVnd0=; h=From:To:Subject:Date:From; b=xfc5adFV7w5nKnTziPaBKn4V92ONC09f3uW4ctmuarDxVkMfs+NyWkfL6P9lb4kCt Pyh6W63tVD0i9Ugn2H7NZUH3hFTWIJMKGaH7Yjwa7yV3wYNQqdM6pBJGRFcUTtFCMu MlYnsaXjjpQOorOQCnfkfsv1jLWQmOLKM3QqNS5TU/u4J7Wgp57JYmT13j2u1zyCeC vZdvUamnqNAG9WUcRDb6IDIxnpFVa3bWBqhXpBtMQ/rYYg9w/7yIAuQOBgH2JZriqT Ci0Ctj92+sr8px8nkscbimuijWn1Pkc3Ef3zZruayOw6Qi4TehG13Xz2I6jGy3ZAFv Z6470gmBwnNaQ== Received-SPF: pass client-ip=2001:19f0:5001:bf2:5400:2ff:fee0:2626; envelope-from=miha@kamnitnik.top; helo=kamnitnik.top X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.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, FROM_SUSPICIOUS_NTLD=0.001, FROM_SUSPICIOUS_NTLD_FP=1.999, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_PDS_OTHER_BAD_TLD=0.01 autolearn=no 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:243936 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable emacs -q: 1. 'C-h e' to display *Messages* in a new window 2. 'C-SPC C-n' to mark an active region 3. 'M-x window-swap-states' 4. 'C-g C-n' to deactivate the mark Notice how the region overlay stays there. To make this easier to debug, instrument 'window-swap-states' by applying the following diff diff --git a/lisp/window.el b/lisp/window.el index 905803b19e..daddd18b74 100644 =2D-- a/lisp/window.el +++ b/lisp/window.el @@ -6518,8 +6518,14 @@ window-swap-states (height-2 (and height (window-text-height window-2 t))) old preserved) ;; Swap basic states. + (message "Before %S \n %S" + (window-parameter window-1 'internal-region-overlay) + (window-parameter window-2 'internal-region-overlay)) (window-state-put state-1 window-2 t) (window-state-put state-2 window-1 t) + (message "After: %S \n %S" + (window-parameter window-1 'internal-region-overlay) + (window-parameter window-2 'internal-region-overlay)) ;; Swap overlays with `window' property. (with-current-buffer (window-buffer window-1) (dolist (overlay (overlays-in (point-min) (point-max))) Follow the bug recipe and notice the following messages: Before: #=20 nil After: nil=20 nil window-state-put sets 'internal-region-overlay' window parameter to nil without removing the actual region overlay, so it remains there in the buffer. I'm not sure how to fix this. Perhaps we should add 'internal-region-overlay' to 'window-persistent-parameters'? Are other commands that use window-state-get + window-state-put affected by this bug as well? In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.34, cairo version 1.17.6) of 2022-09-29 built on miha-pc Repository revision: 0edd7770e0ce70cac59f239134962d10f48dec79 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101004 System Description: Arch Linux Configured using: 'configure -C --prefix=3D/usr --without-libsystemd --enable-checking=3Dyes,glyphs --enable-check-lisp-object-type 'CFLAGS=3D-O0 -g3'' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LANG: en_US.utf8 locale-coding-system: utf-8-unix Major mode: Shell Minor modes in effect: shell-dirtrack-mode: t comint-fl-mode: t tooltip-mode: t global-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 line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils sh-script smie executable files-x shell pcomplete comint osc ansi-color ring tabify thingatpt help-fns radix-tree help-mode cus-edit pp cus-start cus-load icons wid-edit time-date subr-x cl-loaddefs cl-lib rmc 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 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 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 77394 9282) (symbols 48 8002 0) (strings 32 23223 1949) (string-bytes 1 634193) (vectors 16 13518) (vector-slots 8 208026 15295) (floats 8 46 42) (intervals 56 1050 0) (buffers 1000 16)) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAEBCAAxFiEEmxVnesoT5rQXvVXnswkaGpIVmT8FAmM11gsTHG1paGFAa2Ft bml0bmlrLnRvcAAKCRCzCRoakhWZP95mD/9HyGBDiujDacibWLTzAm2iWiI1JOIE AmxtF9iQsJ7qgxANePGxHBapSkbkOTeTEiB+q1l1KKxP3L1OOgK/pUP7FxX6FOJN R2/q/X9ym/+h+1C4hosAKSFbMLpBK3JK4VDn0K14PNQpeBui0JoD241QDsuGI14s xTNLbp1BskpKGjCeo5rrNMCxPlM3OPmey/C/5Lw+GjtREZWpgKt40f6SlL6N+FsE /GPG4fZ64RKUARhPYgn3pjD3CgP3S1sqTtFp6IcqEKFaFeJL4NKB0ZC+ZLU4hbm2 QWXCraaj6E+UIDK+y5jrQWXL1smFymDklreTDbUXocoD+aCo4SDZq4Fg5xH9p3Wm 2xqBIE+RN/InPqzq95Y161voCQYuB8Jgty/Q+bZdhnw/Ric7lfCChh7dZ4lY+lK0 xCVNaLnFIDuB1tWzRlSxYwVM/15DBiTH9lb4Mbg+b9Uiezn4fAyi1P35fOP7xVpq x2+F6epdepy+Zhmj9DkL2i1dv6ysdTMLTrOUoWHR6W820vbVs1M8Fyppgxjuzx9f Fcz8o2BFv3642CzdzokHinmsMzwbPuUGHxyimLGxytjRaa/u7RxiArdAd7zgnwuB ed9INnjymFd3sB7NM6TSCIuPsnh6ELqIF3R6CGtg8mC1ojXQSjz108ykiMN657Mo sIKD/IUfCvTdGQ== =3vKK -----END PGP SIGNATURE----- --=-=-=--