Subject: Re: bug#51550: 29.0.50; Customize Group INS buttons sometimes don't have a left box line
From: Po Lu <[email-masked]>
To: Eli Zaretskii <[email-masked]>
Cc: [email-masked], [email-masked], [email-masked]
Date: Thu, 30 Dec 2021 19:43:44 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Eli Zaretskii <[email-masked]> writes:

>> From: Po Lu <[email-masked]>
>> Cc: [email-masked],  [email-masked],  [email-masked]
>> Date: Wed, 29 Dec 2021 21:54:38 +0800
>> 
>>   (with-current-buffer (get-buffer-create "*test*")
>>     (insert #("foo\nfoo" 0 4 (face widget-field)))
>>     (let ((overlay (make-overlay 5 8 nil t nil)))
>>       (overlay-put overlay 'before-string (propertize " " 'invisible t))
>>       (overlay-put overlay 'face custom-button)))
>> 
>> After this, I would have expected the second "foo" in *test* to begin
>> with a box line, but it doesn't.
>
> It was a subtle bug in how we handle face's box attribute when the
> display engine changes the object on which it iterates.  Compare the
> effect of this:
>
>   (with-current-buffer (get-buffer-create "*test*")
>     (load "wid-edit")
>     (load "cus-edit")
>     (insert #("foo\nfoo" 0 4 (face widget-field)))
>     (let ((overlay (make-overlay 5 8 nil t nil)))
>       (overlay-put overlay 'before-string "X")
>       (overlay-put overlay 'face custom-button)))
>
> with this:
>
>   (with-current-buffer (get-buffer-create "*test*")
>     (load "wid-edit")
>     (load "cus-edit")
>     (insert #("foo\nXfoo" 0 4 (face widget-field)))
>     (let ((overlay (make-overlay 6 9 nil t nil)))
>       (overlay-put overlay 'face custom-button)))
>
> The change of face between the "X" and the following button should be
> displayed the same, but wasn't.
>
> I installed a fix on master.  Please see if it solves the real-life
> use case, and close the bug if it does.

Yes, that fixes the problem.  I'll push the corresponding fix to the
custom widget code, and I'm closing this bug.  Thanks.