]> code.delx.au - gnu-emacs-elpa/commitdiff
[Fix #78] save-excursion in check-parens
authorArtur Malabarba <bruce.connor.am@gmail.com>
Mon, 4 Apr 2016 17:18:09 +0000 (14:18 -0300)
committerArtur Malabarba <bruce.connor.am@gmail.com>
Mon, 4 Apr 2016 17:18:32 +0000 (14:18 -0300)
aggressive-indent.el

index 9aa82266ed10f19713c0fdb5e06394c5958d0350..31cee7253e4d622aa76d3aacbd6e7f4eac9515b7 100644 (file)
@@ -4,7 +4,7 @@
 
 ;; Author: Artur Malabarba <emacs@endlessparentheses.com>
 ;; URL: https://github.com/Malabarba/aggressive-indent-mode
-;; Version: 1.5.2
+;; Version: 1.5.3
 ;; Package-Requires: ((emacs "24.1") (cl-lib "0.5"))
 ;; Keywords: indent lisp maint tools
 ;; Prefix: aggressive-indent
@@ -375,11 +375,12 @@ or messages."
   "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))))
+        (save-excursion
+          (ignore-errors
+            (save-restriction
+              (narrow-to-defun)
+              (check-parens)
+              t)))))
 
 (defun aggressive-indent--keep-track-of-changes (l r &rest _)
   "Store the limits (L and R) of each change in the buffer."