* bug#74536: 30.0.50; undocumented box behaviour in faces
@ 2024-11-25 19:34 Al Haji-Ali
2024-11-25 19:44 ` Eli Zaretskii
0 siblings, 1 reply; 3+ messages in thread
From: Al Haji-Ali @ 2024-11-25 19:34 UTC (permalink / raw)
To: 74536
The output of the following code is
--8<---------------cut here---------------start------------->8---
(progn
(fundamental-mode)
(insert (concat "\n"
(propertize "hello" 'face '(:box (:line-width (3 . 0) :color "red")))
(propertize " again" 'face '(:box (:line-width (3 . 0) :color "yellow")))
(propertize " other" 'face '(:box (:line-width (3 . 0) :color "green"))))
"\n"))
--8<---------------cut here---------------end--------------->8---
|hello again other|
where the left border is red and the right one is green and the yellow border is completely hidden. Having negative line-width produces the same output.
It seems that one cannot have multiple adjacent borders unless one has some text in between without a border, like this
--8<---------------cut here---------------start------------->8---
(progn
(fundamental-mode)
(insert (concat "\n"
(propertize "hello" 'face '(:box (:line-width (3 . 0) :color "red")))
" "
(propertize " again" 'face '(:box (:line-width (3 . 0) :color "yellow")))
(propertize " othe " 'face '(:box (:line-width (3 . 0) :color "green"))))
"\n"))
--8<---------------cut here---------------end--------------->8---
produces
|hello| | again other|
with (red, red, yellow, green) borders.
I find this behaviour, if intended, sometimes helpful as it allows one to have a one-sided border. Though it would be helpful if the exact mechanism is documented.
In any case, I was also originally expecting, and wanting, an output like this
|hello| again | other|
with `(red, yellow, green, green)` and no text in between, but it seems there is no way to achieve such output? Is that correct?
-- Al
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#74536: 30.0.50; undocumented box behaviour in faces
2024-11-25 19:34 bug#74536: 30.0.50; undocumented box behaviour in faces Al Haji-Ali
@ 2024-11-25 19:44 ` Eli Zaretskii
2024-11-25 21:08 ` Al Haji-Ali
0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2024-11-25 19:44 UTC (permalink / raw)
To: Al Haji-Ali; +Cc: 74536
tags 74536 notabug
thanks
> From: Al Haji-Ali <abdo.haji.ali@gmail.com>
> Date: Mon, 25 Nov 2024 19:34:41 +0000
>
>
> The output of the following code is
>
> --8<---------------cut here---------------start------------->8---
> (progn
> (fundamental-mode)
> (insert (concat "\n"
> (propertize "hello" 'face '(:box (:line-width (3 . 0) :color "red")))
> (propertize " again" 'face '(:box (:line-width (3 . 0) :color "yellow")))
> (propertize " other" 'face '(:box (:line-width (3 . 0) :color "green"))))
> "\n"))
> --8<---------------cut here---------------end--------------->8---
>
>
> |hello again other|
>
> where the left border is red and the right one is green and the yellow border is completely hidden. Having negative line-width produces the same output.
As expected.
> It seems that one cannot have multiple adjacent borders unless one has some text in between without a border, like this
> --8<---------------cut here---------------start------------->8---
> (progn
> (fundamental-mode)
> (insert (concat "\n"
> (propertize "hello" 'face '(:box (:line-width (3 . 0) :color "red")))
> " "
> (propertize " again" 'face '(:box (:line-width (3 . 0) :color "yellow")))
> (propertize " othe " 'face '(:box (:line-width (3 . 0) :color "green"))))
> "\n"))
> --8<---------------cut here---------------end--------------->8---
>
> produces
>
> |hello| | again other|
>
> with (red, red, yellow, green) borders.
Yes. Basically, Emacs doesn't examine box face changes unless it
changes from box to no-box or vice versa.
> I find this behaviour, if intended, sometimes helpful as it allows one to have a one-sided border. Though it would be helpful if the exact mechanism is documented.
What mechanism would you like to be documented?
> In any case, I was also originally expecting, and wanting, an output like this
> |hello| again | other|
>
> with `(red, yellow, green, green)` and no text in between, but it seems there is no way to achieve such output? Is that correct?
Yes.
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#74536: 30.0.50; undocumented box behaviour in faces
2024-11-25 19:44 ` Eli Zaretskii
@ 2024-11-25 21:08 ` Al Haji-Ali
0 siblings, 0 replies; 3+ messages in thread
From: Al Haji-Ali @ 2024-11-25 21:08 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 74536
Thanks for the response.
On 25/11/2024, Eli Zaretskii wrote:
>> I find this behaviour, if intended, sometimes helpful as it allows one to have a one-sided border. Though it would be helpful if the exact mechanism is documented.
>
> What mechanism would you like to be documented?
>
Exactly what you explained:
> Yes. Basically, Emacs doesn't examine box face changes unless it
> changes from box to no-box or vice versa.
-- Al
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-11-25 21:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-25 19:34 bug#74536: 30.0.50; undocumented box behaviour in faces Al Haji-Ali
2024-11-25 19:44 ` Eli Zaretskii
2024-11-25 21:08 ` Al Haji-Ali
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).