Is it possible to add visual padding around a variable width character (generally too, I suppose)?

I've looked into using propertize and buffer-display-table to accomplish this, but every solution using those two has been a hack that ultimately fakes adding padding around the character.

An example of what I am trying to accomplish:

🍋| <-- I want this pipe to line up with the others

Another example:

Manually adding padding around the variable width characters above is what I'd like to do. I don't know if it's possible though.

I already have a 'working' solution where I can add a space character after the other char and then change the width of that space to line up the pipes. That isn't really 'padding' / 'margin' as it has the artifact of another character.

  • You might want to be a bit more specific about this. Perhaps an example of what you're starting with and what you want the result (even if just visual) to be.
    – Drew
    May 10 '20 at 4:34
  • Thanks, I added a little more detail. Let me know if that's better. I know what I want to accomplish in my head, but I don't know how to ask the right questions.
    – tylerware
    May 10 '20 at 5:31
  • Yes, thanks. (elisp) Specified Space (e.g. :align-to) might offer some help with this (maybe, maybe not).
    – Drew
    May 10 '20 at 15:31
  • I think that would work, but it would still require me to add a space character (as that property only applies to spaces), which I'm hoping I don't have to do.
    – tylerware
    May 10 '20 at 23:16

Your Answer

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

Browse other questions tagged or ask your own question.