From c2b8058c07dfa2aa142c11d9240e7b1fa4f520ff Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sat, 25 Sep 2021 12:11:26 +0200 Subject: [PATCH] Document the new paren-space indentation rule * doc/emacs/programs.texi (Lisp Indent): Mention the new paren-space indentation rule. --- doc/emacs/programs.texi | 17 +++++++++++++++++ etc/NEWS | 2 ++ 2 files changed, 19 insertions(+) diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index ec11b0c00f2..51a48df2e27 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi @@ -471,6 +471,23 @@ the function name. This is normally done for macro definitions, using the @code{declare} construct. @xref{Defining Macros,,, elisp, The Emacs Lisp Reference Manual}. + In Emacs Lisp, lists are usually indented as if they are +function-like forms: + +@lisp +(setq foo '(bar zot + gazonk)) +@end lisp + + However, if you add a space after the opening parenthesis, this tells +Emacs that it's a data list instead of a piece of code, and Emacs will +then indent it like this: + +@lisp +(setq foo '( bar zot + gazonk)) +@end lisp + @node C Indent @subsection Commands for C Indentation diff --git a/etc/NEWS b/etc/NEWS index 56fdbecff39..f211a98678c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1703,8 +1703,10 @@ work as before. ** Emacs Lisp mode +--- *** The mode-line now indicates whether we're using lexical or dynamic scoping. ++++ *** A space between an open paren and a symbol changes the indentation rule. The presence of a space between an open paren and a symbol now is taken as a statement by the programmer that this should be indented -- 2.39.2