6

If I use info inside emacs and enable variable-pitch-mode, all text is displayed in proportional fonts, but the text width is all wrong, because info-mode laid out the text assuming fixed-width characters and a window width of something like 70 characters. The same thing happens in help buffers as well.

How do I get info-mode to lay out the text neatly when using a variable-width font?

Kirill
  • 1,019
  • 7
  • 19
  • [magic-buffer](https://github.com/sabof/magic-buffer) has a demonstration on how to align proportional text in Emacs. Perhaps this can be used to hack this into `M-x info`. – wasamasa Dec 24 '14 at 08:37
  • Another approach can be seen in [justify-kp](https://github.com/Fuco1/justify-kp), a demonstration of justified text filling for proportional text. – wasamasa Dec 24 '14 at 08:38

1 Answers1

7

You can't. A proper text layout for proportional fonts would require dynamic re-filling of paragraphs, which is generally impossible to do correctly with info documents, since they contain no semantic information at all. Same for docstrings, which you see in Help Mode, except that these don't even start with any markup at all...

Hence it's impossible to know a given paragraph could be re-filled, if at all. In other words, the Info viewer has no chance to find out whether a paragraph is free text, or preformatted text like a source code example, which must not be refilled.

That's a big weakness of Info and one if the reasons why Emacs' documentation infrastructure is in dire need of modernisation.

  • Regarding docstrings: I can use `fill-paragraph` when I'm editing them, but not when I'm reading them, so it can't be *completely* impossible. Is there a way to get fill-paragraph to do something helpful? – Kirill Dec 24 '14 at 23:47
  • @Kirill You still need to know whether what you're attempting to refill is a paragraph or not (and a list or code example instead). This answer points out that there is no generic way to know that for sure and therefore, achieving your goal perfectly is impossible. – wasamasa Dec 25 '14 at 08:58
  • The Texinfo sources *do* contain semantic information, however. Can that be used? –  Jul 25 '15 at 20:03