+;;; Preventing indentation
+(defvar aggressive-indent--internal-dont-indent-if
+ '((memq this-command aggressive-indent-protected-commands)
+ (region-active-p)
+ buffer-read-only
+ undo-in-progress
+ (null (buffer-modified-p))
+ (and (boundp 'smerge-mode) smerge-mode)
+ (let ((line (thing-at-point 'line)))
+ (when (stringp line)
+ (or (string-match "\\`[[:blank:]]*\n?\\'" line)
+ ;; If the user is starting to type a comment.
+ (and (stringp comment-start)
+ (string-match (concat "\\`[[:blank:]]*"
+ (substring comment-start 0 1)
+ "[[:blank:]]*$")
+ line)))))
+ (let ((sp (syntax-ppss)))
+ ;; Comments.
+ (or (and (not aggressive-indent-comments-too) (elt sp 4))
+ ;; Strings.
+ (elt sp 3))))
+ "List of forms which prevent indentation when they evaluate to non-nil.
+This is for internal use only. For user customization, use
+`aggressive-indent-dont-indent-if' instead.")
+