]> code.delx.au - gnu-emacs-elpa/commitdiff
Merge commit '6238e7402adabd0003f6ffcf5c57d9f18f1e7684'
authorArtur Malabarba <bruce.connor.am@gmail.com>
Wed, 19 Aug 2015 10:14:23 +0000 (11:14 +0100)
committerArtur Malabarba <bruce.connor.am@gmail.com>
Wed, 19 Aug 2015 10:14:23 +0000 (11:14 +0100)
1  2 
packages/aggressive-indent/aggressive-indent.el

index d6d201dbaa5850abd2014fc0d3da6fec2cd9ad9b,1412ee9d49c32389fe44693cb5a73f237902b087..f9a0df313d453c36a7bdc3deeaf4a6d36b4be7b0
@@@ -1,10 -1,10 +1,10 @@@
 -;;; 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 Free Software Foundation, Inc
  
  ;; Author: Artur Malabarba <emacs@endlessparentheses.com>
  ;; URL: http://github.com/Malabarba/aggressive-indent-mode
- ;; Version: 1.1.2
+ ;; Version: 1.1.3
  ;; Package-Requires: ((emacs "24.1") (names "20150125.9") (cl-lib "0.5"))
  ;; Keywords: indent lisp maint tools
  ;; Prefix: aggressive-indent
@@@ -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,
@@@ -325,10 -325,15 +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))))