From: Artur Malabarba Date: Wed, 18 May 2016 17:37:27 +0000 (-0300) Subject: Merge commit 'eaab57092284028b1567622c96d9b332de3c7a4d' X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/4c77f20e144dc409e3c59abdb7105fb0db41ee54?hp=-c Merge commit 'eaab57092284028b1567622c96d9b332de3c7a4d' --- 4c77f20e144dc409e3c59abdb7105fb0db41ee54 diff --combined packages/aggressive-indent/aggressive-indent.el index ac3ff96fa,f11612902..9c1f7d7b2 --- a/packages/aggressive-indent/aggressive-indent.el +++ b/packages/aggressive-indent/aggressive-indent.el @@@ -1,6 -1,6 +1,6 @@@ -;;; aggressive-indent.el --- Minor mode to aggressively keep your code always indented +;;; aggressive-indent.el --- Minor mode to aggressively keep your code always indented -*- lexical-binding:t -*- -;; Copyright (C) 2014 Free Software Foundation, Inc. +;; Copyright (C) 2014, 2015, 2016 Free Software Foundation, Inc ;; Author: Artur Malabarba ;; URL: https://github.com/Malabarba/aggressive-indent-mode @@@ -70,7 -70,7 +70,7 @@@ ;; ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License -;; as published by the Free Software Foundation; either version 2 +;; as published by the Free Software Foundation; either version 3 ;; of the License, or (at your option) any later version. ;; ;; This program is distributed in the hope that it will be useful, @@@ -300,7 -300,8 +300,7 @@@ messages. L and R passed to `aggressiv Call `indent-region' between L and R, and then keep indenting until nothing more happens." (interactive "r") - (let ((p (point-marker)) - was-begining-of-line) + (let ((p (point-marker))) (set-marker-insertion-type p t) (unwind-protect (progn @@@ -348,10 -349,6 +348,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 +367,7 @@@ (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 +376,10 @@@ (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