emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master a2fad89 1/3: [Fix #53] Indent more aggressively


From: Artur Malabarba
Subject: [elpa] master a2fad89 1/3: [Fix #53] Indent more aggressively
Date: Wed, 19 Aug 2015 10:17:02 +0000

branch: master
commit a2fad89e551490ab8250e57a754185efb657bee9
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>

    [Fix #53] Indent more aggressively
---
 aggressive-indent.el |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/aggressive-indent.el b/aggressive-indent.el
index 636504d..82e5fbf 100644
--- a/aggressive-indent.el
+++ b/aggressive-indent.el
@@ -325,10 +325,15 @@ until nothing more happens."
                  (point-limit (if (and eod (< (point) eod))
                                   eod (point-max-marker))))
             (while (and (null (eobp))
-                        (< (point) point-limit)
-                        (/= (point)
-                            (progn (indent-according-to-mode)
-                                   (point))))
+                        (let ((op (point))
+                              (np (progn (indent-according-to-mode)
+                                         (point))))
+                          ;; As long as we're indenting things to the
+                          ;; left, keep indenting.
+                          (or (< np op)
+                              ;; If we're indenting to the right, or
+                              ;; not at all, stop at the limit.
+                              (< (point) point-limit))))
               (forward-line 1)
               (skip-chars-forward "[:blank:]\n"))))
       (goto-char p))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]