]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/aggressive-indent/aggressive-indent.el
packages/fsm: Fix compilation error
[gnu-emacs-elpa] / packages / aggressive-indent / aggressive-indent.el
index ac3ff96fab34d877fae1a6f8fdcdb468c167e327..3828bf2a3c19c6ee603095d0238f6c8e9a4f2ab5 100644 (file)
@@ -4,7 +4,7 @@
 
 ;; Author: Artur Malabarba <emacs@endlessparentheses.com>
 ;; URL: https://github.com/Malabarba/aggressive-indent-mode
-;; Version: 1.7
+;; Version: 1.8.1
 ;; Package-Requires: ((emacs "24.1") (cl-lib "0.5"))
 ;; Keywords: indent lisp maint tools
 ;; Prefix: aggressive-indent
@@ -129,6 +129,7 @@ Please include this in your report!"
     haskell-mode
     haskell-interactive-mode
     image-mode
+    inf-ruby-mode
     makefile-mode
     makefile-gmake-mode
     minibuffer-inactive-mode
@@ -348,10 +349,6 @@ or messages."
   "List of (left right) limit of regions changed in the last command loop.")
 (make-variable-buffer-local 'aggressive-indent--changed-list)
 
-(defvar aggressive-indent--balanced-parens t
-  "Non-nil if the current-buffer has balanced parens.")
-(make-variable-buffer-local 'aggressive-indent--balanced-parens)
-
 (defun aggressive-indent--proccess-changed-list-and-indent ()
   "Indent the regions in `aggressive-indent--changed-list'."
   (let ((inhibit-modification-hooks t)
@@ -371,7 +368,7 @@ or messages."
 
 (defun aggressive-indent--indent-if-changed ()
   "Indent any region that changed in the last command loop."
-  (when (and aggressive-indent--changed-list aggressive-indent--balanced-parens)
+  (when aggressive-indent--changed-list
     (save-excursion
       (save-selected-window
         (unless (or (run-hook-wrapped 'aggressive-indent--internal-dont-indent-if #'eval)
@@ -380,19 +377,10 @@ or messages."
             (redisplay)
             (aggressive-indent--proccess-changed-list-and-indent)))))))
 
-(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
-        (save-excursion
-          (ignore-errors
-            (zerop (car (syntax-ppss (point-max))))))))
-
 (defun aggressive-indent--keep-track-of-changes (l r &rest _)
   "Store the limits (L and R) of each change in the buffer."
   (when aggressive-indent-mode
-    (push (list l r) aggressive-indent--changed-list)
-    (aggressive-indent--check-parens)))
+    (push (list l r) aggressive-indent--changed-list)))
 
 ;;; Minor modes
 ;;;###autoload
@@ -419,7 +407,6 @@ Store result in `aggressive-indent--balanced-parens'."
                 (cl-member-if #'derived-mode-p aggressive-indent-dont-electric-modes))
             (aggressive-indent--local-electric nil)
           (aggressive-indent--local-electric t))
-        (aggressive-indent--check-parens)
         (add-hook 'after-change-functions #'aggressive-indent--keep-track-of-changes nil 'local)
         (add-hook 'before-save-hook #'aggressive-indent--proccess-changed-list-and-indent nil 'local)
         (add-hook 'post-command-hook #'aggressive-indent--indent-if-changed nil 'local))