all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#58175: 29.0.50; M-x window-swap-states during an active mark leaves behind a region overlay
@ 2022-09-29 17:29 miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-09-29 18:34 ` Eli Zaretskii
  0 siblings, 1 reply; 22+ messages in thread
From: miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-09-29 17:29 UTC (permalink / raw)
  To: 58175

[-- Attachment #1: Type: text/plain, Size: 5036 bytes --]

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
--- 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: #<overlay from 77 to 123 in *GNU Emacs*> 
 nil
After: nil 
 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=/usr --without-libsystemd
 --enable-checking=yes,glyphs --enable-check-lisp-object-type
 'CFLAGS=-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))

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2022-10-09 14:05 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-29 17:29 bug#58175: 29.0.50; M-x window-swap-states during an active mark leaves behind a region overlay miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-29 18:34 ` Eli Zaretskii
2022-09-29 19:17   ` miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-29 19:19     ` Eli Zaretskii
2022-10-02 16:50       ` Eli Zaretskii
2022-10-04  8:23         ` martin rudalics
2022-10-04 16:54           ` Eli Zaretskii
2022-10-04 20:27             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-04 21:03               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-04 21:25                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-05  5:42                   ` Eli Zaretskii
2022-10-06 12:25                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-07  8:17                       ` martin rudalics
2022-10-07 19:28                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-08 10:05                           ` martin rudalics
2022-10-08 17:24                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-09 14:05                               ` martin rudalics
2022-10-05  7:36             ` martin rudalics
2022-10-05  8:28               ` Eli Zaretskii
2022-10-06  7:48                 ` martin rudalics
2022-10-06  8:13                   ` Eli Zaretskii
2022-10-07  8:09                     ` martin rudalics

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.