Subject: bug#54598: 27.2; Bad interraction between modus-theme and hs-minor-mode

From: Eli Zaretskii <[email-masked]>
Date: Thu, 07 Apr 2022 11:27:20 +0300

> From: Protesilaos Stavrou <[email-masked]>
> Cc: [email-masked], [email-masked], [email-masked]
> Date: Thu, 07 Apr 2022 11:00:14 +0300
> 
> > Please explain which part(s) of those face attributes are supposed to
> > produce the thin line, and why do you think that should happen.  Maybe
> > I'm missing something, but I'm not aware of any face-related feature
> > in Emacs that allows us to produce a thin vertical line.  That's why
> > we use for fill-column-indicator a character whose image is supposed
> > to be such a thin vertical line.
> 
> I think the end-result on GNU/Linux is puzzling, given that no face
> attribute should explicitly produce this thin line.  Still, this result
> was discovered experimentally.

I think it's a side effect of some peculiarity of the particular
implementation.  Did you try that with and without Cairo, for example?

> With 'emacs -Q' and a fallback/default typeface such as DejaVu Sans Mono
> or Hack:
> 
>  1. Create some empty lines in the scratch buffer, such as with 'C-o'.
>  2. M-x display-fill-column-indicator-mode
> 
> Notice the thin dashed line.

On my system, using DejaVu Sans Mono produces a contiguous vertical
line to begin with.

In any case, if that doesn't happen with some default font on some
system, the solution is either specify a font for this face which does
produce a contiguous vertical line, or maybe use an image instead of a
character.

>  3. (set-face-attribute 'fill-column-indicator nil :height 1 :background "gray50" :foreground "gray50")
> 
> The line is now thin and contiguous.
> 
> Note that the dashed line up to step 2 depends on the ':family'
> attribute of the 'default' face.  For example, Source Code Pro produces
> a contiguous line with the above recipe.  Though it too changes to a
> dashed style when 'line-spacing' is >= 2.
> 
> When the 'fill-column-indicator' is changed with what is in step 3, even
> a higher 'line-spacing' value produces a contiguous line.

The background color fills the entire character cell, which is why it
isn't affected by the line-spacing.  But we have no mechanism that I'm
aware of to make the background be 1-pixel thin.

> >> (set-face-attribute 'fill-column-indicator nil :inherit 'variable-pitch :height 1 :background "gray50" :foreground "gray50")
> >
> > Why do you think this should change anything?  What do you think the
> > inheritance from variable-pitch should do here?
> 
> The assumption is that the proportionate spacing will produce a thinner
> character cell, as opposed to the 'default' face which in Pierre's case
> is a monospaced font.

The width that it takes is determined by the metrics of the U+2502
character in a particular font used by the variable-pitch face on the
user's platform.  You cannot expect in advance that this width is
indeed thin enough, because that character is not designed for these
purposes.

So I think what you are trying to do is fundamentally unportable, not
as long as characters are used for the indicator.