bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#51550: 29.0.50; Customize Group INS buttons sometimes don't have a l


From: Po Lu
Subject: bug#51550: 29.0.50; Customize Group INS buttons sometimes don't have a left box line
Date: Wed, 29 Dec 2021 21:54:38 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

> Why did you want to use a before-string? why not simply a single
> invisible character before the button?

It has to be an overlay, because wid-insert might not be able to insert
such a character before the button.  (In general, the display of
everything in a button except for text seems to be done entirely with
overlays -- I don't think the buffer is supposed to contain anything
other than the text of the button itself.)

> It sounds like an unnecessary complication to me, since before-strings
> and after-strings are inherently tricky, even when they aren't
> invisible.

> But if you want me to look into this, you know what to do: show me a
> short Lisp recipe which I could investigate.

I hope this helps:

  (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.

Thanks in advance.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]