]> git.eshelyaron.com Git - emacs.git/commit
Clean up text properties in 'visual-wrap-prefix-mode'
authorJim Porter <jporterbugs@gmail.com>
Wed, 28 May 2025 16:44:34 +0000 (09:44 -0700)
committerEshel Yaron <me@eshelyaron.com>
Wed, 18 Jun 2025 08:04:32 +0000 (10:04 +0200)
commitfc54671b12b06d32b583bc28874c22fcd04f6211
tree7b67cc1fdb9827c2c53c0c31e0daa65d43d7b49d
parent293b1f83ae0967890f1f99671ccad47e7608111e
Clean up text properties in 'visual-wrap-prefix-mode'

Before refontifying a region, remove any text properties we care about
so that we don't end up with stray properties.  Additionally, make sure
to remove all the properties when deactivating the mode.

* lisp/emacs-lisp/subr-x.el (add-remove--display-text-property): New
function, extracted from...
(add-display-text-property): ... here.
(remove-display-text-property): New function.

* lisp/visual-wrap.el (visual-wrap--remove-properties): New function...
(visual-wrap-prefix-function, visual-wrap-prefix-mode): ... call it.

* test/lisp/emacs-lisp/subr-x-tests.el
(subr-x-test-remove-display-text-property): New test.

* test/lisp/visual-wrap-tests.el
(visual-wrap-tests/wrap-prefix-stickiness, visual-wrap-tests/cleanup):
New tests.

* doc/lispref/display.texi (Display Property): Document
'remove-display-text-property'.

* etc/NEWS: Announce 'remove-display-text-property' (bug#76018).

(cherry picked from commit 90c0c9a01ed11944c5502f809817a028a1096ee6)
doc/lispref/display.texi
lisp/emacs-lisp/subr-x.el
lisp/visual-wrap.el
test/lisp/emacs-lisp/subr-x-tests.el
test/lisp/visual-wrap-tests.el