Subject: Re: bug#51550: 29.0.50; Customize Group INS buttons sometimes don't have a left box line

From: Stefan Kangas <[email-masked]>
Date: Wed, 3 Nov 2021 00:03:00 -0700

Po Lu <[email-masked]> writes:

> Eli Zaretskii <[email-masked]> writes:
>
>> So I guess someone will have to step through the relevant drawing code
>> and see where do those two border lines come from.  I cannot do this
>> because the problem doesn't exist on my system.
>
> It turns out that it's not a bug in the display code.  Bisect says:
>
> commit 8b024a6ff10f7907445ea60c4db8355638616ed1
> Author: Stefan Kangas <[email-masked]>
> Date:   Mon Mar 15 00:27:20 2021 +0100
>
>     * lisp/wid-edit.el (widget-field): Add subtle border to face.
>
>  lisp/wid-edit.el | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

It seems like the entire line is shifted a pixel to the left when using
:box, but only on the second consecutive line.  I tried experimenting
with :box 1, :box -1, and I get the same result.

Are we sure that's not a bug in the display code?

In any case, we could revert the commit for emacs-28 and continue investigating
on master.

The diff is:

diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index de2b5d4a7c..35e7b9ce7e 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -131,16 +131,21 @@ widget-field
                        (((class grayscale color)
                          (background light))
                         :background "gray85"
+                         ;; We use negative thickness of the
horizontal box border line to
+                         ;; avoid making lines taller when fields
become visible.
+                         :box (:line-width (1 . -1) :color "gray80")
                         :extend t)
                        (((class grayscale color)
                          (background dark))
                         :background "dim gray"
+                         :box (:line-width (1 . -1) :color "gray46")
                         :extend t)
                        (t
                         :slant italic
                         :extend t))
   "Face used for editable fields."
-  :group 'widget-faces)
+  :group 'widget-faces
+  :version "28.1")

 (defface widget-single-line-field '((((type tty))
                                     :background "green3"