Subject: bug#33648: 25.2; feature request: configurable position of strike-through line

From: Stefan Kangas <[email-masked]>
Date: Mon, 31 Aug 2020 11:21:09 +0000

tags 33648 + confirmed
thanks

Robert Samal <[email-masked]> writes:

> When I use set-face-attribute to give some text a strike-through
> attribute, I see that emacs behaves differently from other pieces of
> software: Apparently, the line is drawn at the level of half the glyph's
> height -- which causes the line to be just touching letters like "a",
> "c", "e", ... and it isn't perceived as striking the text out (at least
> not by me).
>
> In comparison, web browsers interpreting html strike tag make the
> line at the level of half of the "small lowercase letters" -- basically
> at the level of the line in lowercase "e". The same is done by Libre
> Office ... and others.
>
> My suggestion is to make this configurable in some way. I'm not sure,
> if it would be better to have a global option for all files, or
> if "(set-face-attribute ... :strike-through" should accept more choices
> to make each line configurable. (I personally would change all of my
> striking lines, if possible.)
>
> Thanks in advance for considering this, for some uses (in particular
> org-mode) this would help a lot.

This is what I see on current master:

diff --git a/src/xterm.c b/src/xterm.c
index 2e0407aff4..5792574e05 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -3932,7 +3932,7 @@ x_draw_glyph_string (struct glyph_string *s)
 	  /* Strike-through width and offset from the glyph string's
 	     top edge.  */
           unsigned long h = 1;
-          unsigned long dy = (glyph_height - h) / 2;
+          unsigned long dy = (glyph_height - h) / 3;
 
 	  if (s->face->strike_through_color_defaulted_p)
 	    x_fill_rectangle (s->f, s->gc, s->x, glyph_y + dy,