Is it possible to more nicely format the help for a function?
When I use describe-function
, I get the documentation text displayed in a Help buffer.
If the doc is long enough, it will w开发者_运维问答rap in the buffer, but it doesn't wrap nicely. like this:
I can make the docstring use 72-character lines, but that supposes that the window will be 80 characters, which is not always the case.
Is it possible to get describe-function
to emit documentation in a more nicely formatted way?
Try enabling global-visual-line-mode
to get nice text wrapping in all your buffers. It works in code and help buffers, but doesn't mess up your line numbering! Of all the line wrapping modes for emacs, I find it to be the best. If you don't want to use it globally, simply try M-x visual-line-mode
.
No, please do not "try enabling global-visual-line-mode" as your solution for this.
Just try adopting the Emacs conventions for doc strings. See the Elisp manual, node Documentation Tips
(aka "Tips for Documentation Strings").
In general, doc strings should not have lines wider than 60 chars.
Remember that there are multiple places where Emacs uses doc strings, including for apropos
. Emacs expects doc strings to follow the documented conventions, for best results.
精彩评论