-(defun -softly-indent-region-and-on (l r &rest _)
- "Indent current defun unobstrusively.
-Like `aggressive-indent-indent-region-and-on', but wrapped in a
-`aggressive-indent--do-softly'."
- (unless (or (run-hook-wrapped
- 'aggressive-indent--internal-dont-indent-if
- #'eval)
- (aggressive-indent--run-user-hooks))
- (ignore-errors
- (cl-letf (((symbol-function 'message) #'ignore))
- (indent-region-and-on l r)))))
-
-(defvar -changed-list-right nil
- "List of right limit of regions changed in the last command loop.")
-
-(defvar -changed-list-left nil
- "List of left limit of regions changed in the last command loop.")
-
-(defun -indent-if-changed ()
- "Indent any region that changed in the last command loop."
- (let ((inhibit-modification-hooks t))
- (when -changed-list-left
- (-softly-indent-region-and-on
- (apply #'min -changed-list-left)
- (apply #'max -changed-list-right))
- (setq -changed-list-left nil
- -changed-list-right nil))))
-
-(defun -keep-track-of-changes (l r &rest _)
- "Store the limits of each change that happens in the buffer."
- (push l -changed-list-left)
- (push r -changed-list-right))
-
-(defun -in-comment-p ()
- "Return non-nil if point is inside a comment.
-Assumes that the syntax table is sufficient to find comments."
- (nth 4 (syntax-ppss)))
-
-\f
-;;; Keymap
-(defun delete-backward ()
- "Either `delete-indentation' or call [backspace]."
- (interactive)
- (if (looking-back "^[[:blank:]]+")
- (call-interactively 'delete-indentation)
- (let ((mode nil))
- (execute-kbd-macro [backspace]))))
+(defun aggressive-indent--softly-indent-region-and-on (l r &rest _)
+ "Indent region between L and R, and a bit more.
+Like `aggressive-indent-indent-region-and-on', but without errors
+or messages."
+ (cl-letf (((symbol-function 'message) #'ignore))
+ (ignore-errors (aggressive-indent-indent-region-and-on l r))))