diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 172da3db1e0..01319853edc 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -532,6 +532,17 @@ widget-inactive (defun widget-specify-inactive (widget from to) "Make WIDGET inactive for user modifications." + ;; When WIDGET is a radio-button-choice widget and its first child + ;; radio-button widget is inserted, the marker FROM, which has + ;; insertion type t, advances to the position after the radio button, + ;; and since the overlay setting the widget-inactive face begins at + ;; the position of FROM, this results in the first radio button + ;; incorrectly not being fontified with the widget-inactive face. To + ;; ensure it is correctly fontified, we move FROM backward by 3, + ;; i.e. the length of the radio-button widget (from its string + ;; representation "( )" or "(x)") (bug#69941). + (when (eq (widget-type widget) 'radio-button-choice) + (set-marker from (- from 3))) (unless (widget-get widget :inactive) (let ((overlay (make-overlay from to nil t nil))) (overlay-put overlay 'face 'widget-inactive)