Why is the third line in this code indented "too much" to the left? It feels "off" to me.
(defun hello-world nil
"Greet the world.
This function implements the canonical example program."
(interactive)
(message "Hello world!"))
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.
Sign up to join this communityIt's so the docstring will look normal when the user views it in the help system.
The first line of the docstring is indented.
Since the G
directly follows the double quote "
there is no indentation in first line of the printed version of the string.
The newline at the end of the first line of the string is part of the string.
If you would add indentation to the second line of the string. That indentation would also be part of the printed representation of the string. That is most likely unwanted.
C-x C-e
. Then check the help with C-h hello-world
and see for yourself. :) Experiment to see what happens when you modify the docstring.
Jan 25, 2019 at 16:44