2

Suppose I want to show text data in two columns like here:

enter image description here

As you can see the font in the columns is proportional (not monospace).

How can text data be shown in an emacs buffer like this, with the first characters in the two columns lining up nicely like on the picture? With proportional font.

  • Interesting, thanks. I haven't yet used the space display property, so this didn't occur to me. – Tom Apr 9 '20 at 19:58
  • @Drew post it as an answer and I'll accept it – Tom Apr 10 '20 at 16:21
  • Done............ – Drew Apr 10 '20 at 16:57
1

See the Elisp manual, node Specified Space:

To display a space of specified width and/or height, use a display specification of the form (space . PROPS), where PROPS is a property list (a list of alternating properties and values). You can put this property on one or more consecutive characters; a space of the specified height and width is displayed in place of all of those characters.

For example, use a display spec that includes (space :align-to 30).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.