+(defvar-local aggressive-indent--balanced-parens t
+ "Non-nil if the current-buffer has balanced parens.")
+
+(defun aggressive-indent--check-parens ()
+ "Check if parens are balanced in the current buffer.
+Store result in `aggressive-indent--balanced-parens'."
+ (setq aggressive-indent--balanced-parens
+ (ignore-errors
+ (save-restriction
+ (narrow-to-defun)
+ (check-parens)
+ t))))
+