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

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

[elpa] master c4957eb 041/108: Fix bug on buffers with no final newline.


From: Artur Malabarba
Subject: [elpa] master c4957eb 041/108: Fix bug on buffers with no final newline.
Date: Wed, 25 Mar 2015 18:39:00 +0000

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

    Fix bug on buffers with no final newline.
    
    Fixes #19
---
 aggressive-indent.el |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/aggressive-indent.el b/aggressive-indent.el
index ee106e4..b0bc742 100644
--- a/aggressive-indent.el
+++ b/aggressive-indent.el
@@ -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)))
 



reply via email to

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