* How to Display a Zero Height Line
@ 2024-11-30 3:02 Psionic K
2024-11-30 7:35 ` Eli Zaretskii
0 siblings, 1 reply; 12+ messages in thread
From: Psionic K @ 2024-11-30 3:02 UTC (permalink / raw)
To: help-gnu-emacs; +Cc: Psionic K
Related dslide user issue:
https://github.com/positron-solutions/dslide/issues/15
If I use line height or line spacing to accomplish the slide-in
effect, text with any background color set have that background
stretched out.
To work around this, I was going to use a zero height line but could
not achieve the effect after a couple tries.
While I achieved vanishing line height in a fundamental mode buffer
using an actual newline with text properties, I could not reproduce
the effect in a fontified buffer, where I needed to use an overlay. I
messed around a bit with 'before-string etc.
I'm aware this might be a display limitation and want to confirm
before labeling my user's issue accordingly.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: How to Display a Zero Height Line
2024-11-30 3:02 Psionic K
@ 2024-11-30 7:35 ` Eli Zaretskii
0 siblings, 0 replies; 12+ messages in thread
From: Eli Zaretskii @ 2024-11-30 7:35 UTC (permalink / raw)
To: help-gnu-emacs
> From: Psionic K <psionik@positron.solutions>
> Date: Sat, 30 Nov 2024 12:02:05 +0900
> Cc: Psionic K <psionik@positron.solutions>
>
> Related dslide user issue:
> https://github.com/positron-solutions/dslide/issues/15
>
> If I use line height or line spacing to accomplish the slide-in
> effect, text with any background color set have that background
> stretched out.
>
> To work around this, I was going to use a zero height line but could
> not achieve the effect after a couple tries.
>
> While I achieved vanishing line height in a fundamental mode buffer
> using an actual newline with text properties, I could not reproduce
> the effect in a fontified buffer, where I needed to use an overlay. I
> messed around a bit with 'before-string etc.
>
> I'm aware this might be a display limitation and want to confirm
> before labeling my user's issue accordingly.
I'm sorry, I could understand neither the problem you were trying to
solve ("slide-in effect"), nor how you tried to do that ("use line
height or line spacing"), nor the problems you've encountered while
trying to solve this ("background stretched out", zero-height line
that didn't work in a fontified buffer).
So please tell more about this, and perhaps show some simple Lisp to
illustrate.
In general, if something works in Fundamental mode but not in a
fontified buffer, it means you use 'face' properties, which
font-lock-mode wipes out. The usual solution for this is to use
'font-lock-face' properties instead. But this is a stub in the dark,
so apologies if it makes no sense or is completely off the target.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: How to Display a Zero Height Line
@ 2024-12-01 1:04 Psionic K
2024-12-01 6:41 ` Eli Zaretskii
2024-12-03 13:30 ` Stefan Monnier via Users list for the GNU Emacs text editor
0 siblings, 2 replies; 12+ messages in thread
From: Psionic K @ 2024-12-01 1:04 UTC (permalink / raw)
To: help-gnu-emacs
For motivating context, the Dslide package currently uses a
`line-height` modifying overlay to animate text below, achieving a
"slide-in" effect in graphical terminals. The implementation is
visible around line 2699 in dslide.el, available on Non-GNU ELPA.
The problem with the use of `line-height` is that it interacts with
Emacs display to stretch out the `:inverse-video' background of TODO
tags from the org-modern package. I expect text with a background
property will be similarly affected.
As I was saying in the title, I am looking for more ways to display a
zero-height line above a line of actual text. This line can be real,
exist in an overlay, or be achieved through some kind of specified
vertical space or similar concept. The design requirements are as
follows:
1. There is vertical space between a target line and the line above or
top of the buffer
2. This vertical space does not have a side effect of extending the
background or `:inverse-video' background of the target line or the
line above it
3. The vertical space can be drawn at zero height and at fractional
heights up to the distance content is slid in from
I have set these boundary conditions wide because I might not be aware
of all ways to achieve the desired effect.
Within a fontified buffer, I have been unable to make actual newlines
into fractional or zero height using overlays. I have neither been
able to use `:before-string` or `:after-string` as properties or
overlays. I have used what I believe are every combination of
`line-height' and `line-spacing'. However, the vertical spacing I
have achieved either cannot be drawn all the way down to zero height
or stretches the background of the animated line or preceding line.
As I did not write the display, I am unfamiliar with any intersection
of conditions that is capable of achieving the desired effect.
To be clear, this email is not replying to any previous email in this thread.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: How to Display a Zero Height Line
2024-12-01 1:04 Psionic K
@ 2024-12-01 6:41 ` Eli Zaretskii
2024-12-03 13:30 ` Stefan Monnier via Users list for the GNU Emacs text editor
1 sibling, 0 replies; 12+ messages in thread
From: Eli Zaretskii @ 2024-12-01 6:41 UTC (permalink / raw)
To: help-gnu-emacs
> From: Psionic K <psionik@positron.solutions>
> Date: Sun, 1 Dec 2024 10:04:32 +0900
>
> 1. There is vertical space between a target line and the line above or
> top of the buffer
> 2. This vertical space does not have a side effect of extending the
> background or `:inverse-video' background of the target line or the
> line above it
> 3. The vertical space can be drawn at zero height and at fractional
> heights up to the distance content is slid in from
What do you mean by "extending the background of :inverse-video
background" of a line? Can you show some simple Lisp which produces
this effect on display?
Since this seems to be the main obstacle you found, it is very
important to understand what it is and how it is created.
> Within a fontified buffer, I have been unable to make actual newlines
> into fractional or zero height using overlays. I have neither been
> able to use `:before-string` or `:after-string` as properties or
> overlays.
Did you try to use an overlay with just the line-height overlay
property, and put that overlay on the newline at end of line?
IOW, I don't understand why you are talking about before-string and
after-string: those are used to show text that doesn't come from the
buffer (but from strings instead), which AFAIU is not your case, at
least not for the purpose of affecting the height of a text line.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: How to Display a Zero Height Line
2024-12-01 1:04 Psionic K
2024-12-01 6:41 ` Eli Zaretskii
@ 2024-12-03 13:30 ` Stefan Monnier via Users list for the GNU Emacs text editor
1 sibling, 0 replies; 12+ messages in thread
From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2024-12-03 13:30 UTC (permalink / raw)
To: help-gnu-emacs
> 3. The vertical space can be drawn at zero height and at fractional
> heights up to the distance content is slid in from
I think currently, you won't be able to get down to actual zero *except*
by making that line `invisible`.
Stefan
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: How to Display a Zero Height Line
@ 2024-12-04 5:08 Psionic K
2024-12-04 13:10 ` Eli Zaretskii
0 siblings, 1 reply; 12+ messages in thread
From: Psionic K @ 2024-12-04 5:08 UTC (permalink / raw)
To: help-gnu-emacs; +Cc: Stefan Monnier, Eli Zaretskii
> I think currently, you won't be able to get down to actual zero *except*
> by making that line `invisible`.
It is appropriate to merely get "pretty close" to zero, a pixel or so.
In animation, as long as the final height is quite small, it appears
to smoothly vanish on the final frame.
Regarding Eli's reply:
> What do you mean by "extending the background of :inverse-video
> background" of a line? Can you show some simple Lisp which produces
> this effect on display?
(let ((buffer (get-buffer-create "testorito")))
(set-buffer buffer)
(erase-buffer)
(insert "* ")
(insert (propertize "TODO" 'face '(:inverse-video t)))
(insert " Org Modern Uses Inverse Video")
(insert "\n")
(insert "* ")
(insert (propertize "TODO" 'face '(:inverse-video t :foreground
"#ff2222")))
(insert " To Draw Fancy Todos")
(setq-local p (point-max))
(insert "\n")
(setq-local o (make-overlay p (1+ p)))
(overlay-put o 'line-height 4.0)
(switch-to-buffer buffer))
This example re-creates the situation that exists in Dslide. I need
to separate the two lines by some floating point multiple of lines in
order to "slide in" to a vanishing degree of separation between two
lines of content. I use the same technique between list items and
sub-headings. All text that has a background exhibits the behavior,
not just `:inverse-video`.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: How to Display a Zero Height Line
2024-12-04 5:08 Psionic K
@ 2024-12-04 13:10 ` Eli Zaretskii
0 siblings, 0 replies; 12+ messages in thread
From: Eli Zaretskii @ 2024-12-04 13:10 UTC (permalink / raw)
To: help-gnu-emacs
> From: Psionic K <psionik@positron.solutions>
> Date: Wed, 4 Dec 2024 14:08:16 +0900
> Cc: Stefan Monnier <monnier@iro.umontreal.ca>, Eli Zaretskii <eliz@gnu.org>
>
> Regarding Eli's reply:
> > What do you mean by "extending the background of :inverse-video
> > background" of a line? Can you show some simple Lisp which produces
> > this effect on display?
>
> (let ((buffer (get-buffer-create "testorito")))
> (set-buffer buffer)
> (erase-buffer)
> (insert "* ")
> (insert (propertize "TODO" 'face '(:inverse-video t)))
> (insert " Org Modern Uses Inverse Video")
> (insert "\n")
> (insert "* ")
> (insert (propertize "TODO" 'face '(:inverse-video t :foreground
> "#ff2222")))
> (insert " To Draw Fancy Todos")
> (setq-local p (point-max))
> (insert "\n")
> (setq-local o (make-overlay p (1+ p)))
> (overlay-put o 'line-height 4.0)
> (switch-to-buffer buffer))
>
> This example re-creates the situation that exists in Dslide. I need
> to separate the two lines by some floating point multiple of lines in
> order to "slide in" to a vanishing degree of separation between two
> lines of content. I use the same technique between list items and
> sub-headings. All text that has a background exhibits the behavior,
> not just `:inverse-video`.
And what is the problem with what the above snippet produces? Is the
problem that you _want_ the background color extended to EOL? If so,
you need to use (:extend t), and you need to make sure the face
affects the entire line till the newline.
But maybe I misunderstand what you want to achieve?
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: How to Display a Zero Height Line
@ 2024-12-12 6:37 Psionic K
2024-12-12 6:47 ` Eli Zaretskii
0 siblings, 1 reply; 12+ messages in thread
From: Psionic K @ 2024-12-12 6:37 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: help-gnu-emacs
> And what is the problem with what the above snippet produces? Is the
> problem that you _want_ the background color extended to EOL? If so,
> you need to use (:extend t), and you need to make sure the face
> affects the entire line till the newline.
The background of TODO extends vertically in a graphical client. I
want the space between the two lines. I do not want the background of
the TODO to extend to the previous line. Any and all intended
workarounds are acceptable. I am merely choosing an implementation of
an effect in Dslide and it doesn't matter how it works.
Please CC me. I don't subscribe to this list directly.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: How to Display a Zero Height Line
2024-12-12 6:37 How to Display a Zero Height Line Psionic K
@ 2024-12-12 6:47 ` Eli Zaretskii
2024-12-12 9:00 ` Psionic K
0 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2024-12-12 6:47 UTC (permalink / raw)
To: Psionic K; +Cc: help-gnu-emacs
> From: Psionic K <psionik@positron.solutions>
> Date: Thu, 12 Dec 2024 15:37:31 +0900
> Cc: help-gnu-emacs@gnu.org
>
> > And what is the problem with what the above snippet produces? Is the
> > problem that you _want_ the background color extended to EOL? If so,
> > you need to use (:extend t), and you need to make sure the face
> > affects the entire line till the newline.
>
> The background of TODO extends vertically in a graphical client. I
> want the space between the two lines. I do not want the background of
> the TODO to extend to the previous line. Any and all intended
> workarounds are acceptable. I am merely choosing an implementation of
> an effect in Dslide and it doesn't matter how it works.
I still don't understand, but did you try to use the :extend
attribute? It extends the background to the window's edge past the
last character visible on the line. It does NOT extend to previous
lines.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: How to Display a Zero Height Line
2024-12-12 6:47 ` Eli Zaretskii
@ 2024-12-12 9:00 ` Psionic K
2024-12-12 9:23 ` Eli Zaretskii
0 siblings, 1 reply; 12+ messages in thread
From: Psionic K @ 2024-12-12 9:00 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Psionic K, help-gnu-emacs
> > The background of TODO extends vertically in a graphical client. I
> > want the space between the two lines. I do not want the background of
> > the TODO to extend to the previous line. Any and all intended
> > workarounds are acceptable. I am merely choosing an implementation of
> > an effect in Dslide and it doesn't matter how it works.
> I still don't understand, but did you try to use the :extend
> attribute?
Why would I be in such a rush to horizontally :extend that which must
be vertically truncated?
I have further inspected the possibility of using empty lines with
actual newlines in the buffer text. No combination of assigning the
current line, an extraneous line used to create space, and the newline
before the next heading, via overlays with line-height, face height,
and line-spacing of zero, appear to overcome the font locking
behavior.
Directly manipulating the font locking behavior is acceptable if there
is a precise means of targeting. I have in the past applied
properties independent of font locking and then read these via new
font locking rules. As an implementation I prefer to avoid it because
if org learns tree-sitter, my solution will break depending on the
font locking in use.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: How to Display a Zero Height Line
2024-12-12 9:00 ` Psionic K
@ 2024-12-12 9:23 ` Eli Zaretskii
2024-12-12 12:25 ` Psionic K
0 siblings, 1 reply; 12+ messages in thread
From: Eli Zaretskii @ 2024-12-12 9:23 UTC (permalink / raw)
To: Psionic K; +Cc: help-gnu-emacs
> From: Psionic K <psionik@positron.solutions>
> Date: Thu, 12 Dec 2024 18:00:15 +0900
> Cc: Psionic K <psionik@positron.solutions>, help-gnu-emacs@gnu.org
>
> > > The background of TODO extends vertically in a graphical client. I
> > > want the space between the two lines. I do not want the background of
> > > the TODO to extend to the previous line. Any and all intended
> > > workarounds are acceptable. I am merely choosing an implementation of
> > > an effect in Dslide and it doesn't matter how it works.
>
> > I still don't understand, but did you try to use the :extend
> > attribute?
>
> Why would I be in such a rush to horizontally :extend that which must
> be vertically truncated?
I thought you wanted the background extended horizontally past the end
of line?
If not, what is it that you want to achieve? Can you explain your
goal in simple words what kind of background extension are you after?
> I have further inspected the possibility of using empty lines with
> actual newlines in the buffer text. No combination of assigning the
> current line, an extraneous line used to create space, and the newline
> before the next heading, via overlays with line-height, face height,
> and line-spacing of zero, appear to overcome the font locking
> behavior.
Sorry, I don't understand what you are saying here. What "font
locking behavior" you want to overcome?
> Directly manipulating the font locking behavior is acceptable if there
> is a precise means of targeting. I have in the past applied
> properties independent of font locking and then read these via new
> font locking rules. As an implementation I prefer to avoid it because
> if org learns tree-sitter, my solution will break depending on the
> font locking in use.
I don't understand that, either, probably because it is based on the
previous paragraph, which I also didn't understand.
Sorry for being so dumb. Feel free to terminate this discussion if it
doesn't help.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: How to Display a Zero Height Line
2024-12-12 9:23 ` Eli Zaretskii
@ 2024-12-12 12:25 ` Psionic K
0 siblings, 0 replies; 12+ messages in thread
From: Psionic K @ 2024-12-12 12:25 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Psionic K, help-gnu-emacs
> I thought you wanted the background extended horizontally past the end
> of line?
For context, my goal is the total and senseless destruction of Microsoft.
You may have heard of a b-tier piece of software they sell known as "Power
Point". It is widely used as a tool of crime. It is the express goal of
Dslide to ensure that more software engineers become healthcare CEOs rather
than healthcare CEOs being murdered by disaffected software engineers.
During sales and presentation, there is a natural benefit to drawing
attention to text as it is introduced to aid attention and focus of
would-be buyers, whose attention and time is scarcely granted. One
technique is to "slide" text in from below. In Dslide, this is
accomplished by using a line-height. An unwanted side-effect is that the
line being "slide in" also has very tall backgrounds (it is vertically
extended, as line-height is supposed to do, but I do not want). When used
with the popular org modern tags, a package that has a strong user overlap
with Dslide, the tag and todo backgrounds appear stretched out as the text
slides in.
> Sorry, I don't understand what you are saying here. What "font
> locking behavior" you want to overcome?
I do not particularly care. I am merely implementing a behavior. If it
can be done by sending carefully crafted regex through an FSF email server,
and that technique is stable enough to work with Emacs display for the
planned and likely future, I will do it.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2024-12-12 12:25 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-12 6:37 How to Display a Zero Height Line Psionic K
2024-12-12 6:47 ` Eli Zaretskii
2024-12-12 9:00 ` Psionic K
2024-12-12 9:23 ` Eli Zaretskii
2024-12-12 12:25 ` Psionic K
-- strict thread matches above, loose matches on Subject: below --
2024-12-04 5:08 Psionic K
2024-12-04 13:10 ` Eli Zaretskii
2024-12-01 1:04 Psionic K
2024-12-01 6:41 ` Eli Zaretskii
2024-12-03 13:30 ` Stefan Monnier via Users list for the GNU Emacs text editor
2024-11-30 3:02 Psionic K
2024-11-30 7:35 ` Eli Zaretskii
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.