diff --git a/etc/NEWS b/etc/NEWS index 602c375dc2f..a6f897c602f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -737,6 +737,12 @@ To use this, add a list to both electric pair user options: '("/*" . "*/")'. You can also specify to insert an extra space after the first string pair: '("/*" " */" t)'. +--- +** New user option 'electric-indent-actions'. +This user options specifies a list of actions to reindent. The possible +elements for this list are: 'yank', reindent the yanked text; +'before-save', indent the whole buffer before saving it. + +++ ** You can now use 'M-~' during 'C-x s' ('save-some-buffers'). Typing 'M-~' while saving some buffers means not to save the buffer and diff --git a/lisp/electric.el b/lisp/electric.el index 6ecdea57d6b..a1131499be6 100644 --- a/lisp/electric.el +++ b/lisp/electric.el @@ -196,9 +196,9 @@ Returns nil when we can't find this char." "List of actions to indent. The valid elements of this list can be: - - yank: Indent the yanked text only if point is not in a string or + - `yank': Indent the yanked text only if point is not in a string or comment and yanked region is longer than 1 line. - - save: Indent the whole buffer before saving it. + - `before-save': Indent the whole buffer before saving it. The indentation will not happen when the major mode is unable to reindent code reliably, such as in buffers where indentation is