This fixes bug#20846 where it transpired that there is no good reason
to shy away from auto-indenting inside comments and strings.
(electric-indent-post-self-insert-function): Don't check syntax-ppss.
\f
* Incompatible Editing Changes in Emacs 28.1
+** `electric-indent-mode` now also indents inside strings and comments,
+(unless the indentation function doesn't, of course).
+To recover the previous behavior you can use:
+
+ (add-hook 'electric-indent-functions
+ (lambda (_) (if (nth 8 (syntax-ppss)) 'no-indent)))
+
** The 'M-o' ('facemenu-keymap') global binding has been removed.
To restore the old binding, say something like:
'electric-indent-functions
last-command-event)
(memq last-command-event electric-indent-chars))))
- (not
- (or (memq act '(nil no-indent))
- ;; In a string or comment.
- (unless (eq act 'do-indent) (nth 8 (syntax-ppss))))))))
+ (not (memq act '(nil no-indent))))))
;; If we error during indent, silently give up since this is an
;; automatic action that the user didn't explicitly request.
;; But we don't want to suppress errors from elsewhere in *this*