]> code.delx.au - gnu-emacs-elpa/commitdiff
Fix bug on buffers with no final newline.
authorArtur Malabarba <bruce.connor.am@gmail.com>
Mon, 27 Oct 2014 12:55:11 +0000 (12:55 +0000)
committerArtur Malabarba <bruce.connor.am@gmail.com>
Mon, 27 Oct 2014 12:55:11 +0000 (12:55 +0000)
Fixes #19

aggressive-indent.el

index ee106e4b083d54852c0be56e9216921beff2f299..b0bc74206edad76f4348141fd11daf15c99737a0 100644 (file)
@@ -107,6 +107,7 @@ Please include this in your report!"
 (defcustom excluded-modes
   '(text-mode tabulated-list-mode special-mode
               minibuffer-inactive-mode
+              bibtex-mode
               yaml-mode jabber-chat-mode)
   "Modes in which `aggressive-indent-mode' should not be activated.
 This variable is only used if `global-aggressive-indent-mode' is
@@ -274,10 +275,11 @@ until nothing more happens."
       (indent-according-to-mode))
     ;; And then we indent each following line until nothing happens.
     (forward-line 1)
-    (while (/= (progn (skip-chars-forward "[:blank:]\n")
-                      (point))
-               (progn (indent-according-to-mode)
-                      (point)))
+    (while (and (null (eobp))
+                (/= (progn (skip-chars-forward "[:blank:]\n")
+                           (point))
+                    (progn (indent-according-to-mode)
+                           (point))))
       (forward-line 1))
     (goto-char p)))