Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

emacs console mode Org-mode strike-through is not displayed as expected

I'm using org-mode. Using '+' around a text, it displays correctly in the GUI as strike-through text (example: +striked-through+).

But this doesn't work in the emacs console mode, the text is not displayed striked-through: there are no difference with the default face.

My term know how to display strike-through as it properly displays striked-through text with this test:

echo -e "\e[9mtest\e[0m"

So this seems to be emacs not using the SGR code to render the text as strike-through.

Do you know any way to tell emacs to use strike-through in console ? Or is it on my end that something is not set ?

like image 216
vaab Avatar asked Jun 12 '14 13:06

vaab


1 Answers

The (Linux) virtual console does not implement strike-through. A few terminal emulators do this, but generally those are not referred to as "console". At most, emacs could show some other type of highlighting such as color.

The reference for the strike-through escape sequence is ECMA-48. However, keep in mind the fact that it was created by a committee and did not represent existing practice. Rather, it is a framework for both existing and proposed implementations. Many of the features described in it have not (30 years later) been implemented. You will not find strike-through as a standard terminfo (or termcap) capability, simply because few (if any) terminals implemented the feature. Read terminfo(5): there is no capability defined for this purpose.

If you read the source code for emacs, it's easy to see that it does not support strike-through. emacs' driver for terminals term.c uses termcap and lists the supported video attributes in a bitmask:

enum no_color_bit
{
  NC_STANDOUT    = 1 << 0,
  NC_UNDERLINE   = 1 << 1,
  NC_REVERSE     = 1 << 2,
  NC_ITALIC  = 1 << 3,
  NC_DIM     = 1 << 4,
  NC_BOLD    = 1 << 5,
  NC_INVIS   = 1 << 6,
  NC_PROTECT     = 1 << 7
};

It also retrieves many string capabilities using tgetstr (see code). There is no strike-through there. While emacs hardcodes some of the color escapes (to work around limitations of termcap), the driver contains nothing that would do strike-through.

Further reading:

  • console_codes - Linux console escape and control sequences
  • Why doesn't xterm support italics? (since 2014, xterm)
  • [vte/vte-next] emulation: Support italic text (since 2012, vte)
like image 82
Thomas Dickey Avatar answered Nov 15 '22 08:11

Thomas Dickey