aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMauro Aranda2025-02-24 19:39:43 -0300
committerMauro Aranda2025-02-24 19:55:31 -0300
commit363adcc69d322bdede1934b47e9dd1fbc3148ab9 (patch)
tree180c3ab8282d1121bedb0a7d312b1dc059f37218 /test
parent60232a30e360c00fb303cb033d4aec15a9e41342 (diff)
downloademacs-363adcc69d322bdede1934b47e9dd1fbc3148ab9.tar.gz
emacs-363adcc69d322bdede1934b47e9dd1fbc3148ab9.zip
Fix bad fontification of inactive widgets
* lisp/wid-edit.el (widget-specify-inactive): When a widget is already inactive, still move the overlay to the desired positions. Improve docstring. (Bug#69941) * doc/misc/widget.texi (default): Document the need to call the :deactivate function when modifying an inactive widget. * test/lisp/wid-edit-tests.el (widget-test-modification-of-inactive-widget): New test
Diffstat (limited to 'test')
-rw-r--r--test/lisp/wid-edit-tests.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/lisp/wid-edit-tests.el b/test/lisp/wid-edit-tests.el
index e34aa64f8d1..755bd12201f 100644
--- a/test/lisp/wid-edit-tests.el
+++ b/test/lisp/wid-edit-tests.el
@@ -481,4 +481,18 @@ markers (and so on) as well."
481 (should (= ofrom2 (widget-get group2 :from))) 481 (should (= ofrom2 (widget-get group2 :from)))
482 (should (= oto2 (widget-get group2 :to)))))) 482 (should (= oto2 (widget-get group2 :to))))))
483 483
484(ert-deftest widget-test-modification-of-inactive-widget ()
485 "Test that modifications to an inactive widget keep all of it inactive."
486 (with-temp-buffer
487 (let* ((radio (widget-create 'radio-button-choice
488 '(item "One") '(item "Two") '(item "Confirm")))
489 (from (widget-get radio :from))
490 (to (widget-get radio :to))
491 (ov (progn (widget-apply radio :deactivate)
492 (widget-get radio :inactive))))
493 (widget-value-set radio "")
494 (widget-apply radio :deactivate)
495 (should (= (overlay-start ov) from))
496 (should (= (overlay-end ov) to)))))
497
484;;; wid-edit-tests.el ends here 498;;; wid-edit-tests.el ends here