branch: master
commit 3a4b76a15004cf7419cfba7f86878b2826cfca39
Merge: 82bf8bd 4c2f34e
Author: Artur Malabarba <bruce.connor...@gmail.com>
Commit: Artur Malabarba <bruce.connor...@gmail.com>

    Merge branch 'dev'
    
    Conflicts:
        aggressive-indent.el
---
 aggressive-indent.el |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/aggressive-indent.el b/aggressive-indent.el
index b3ca3d4..ac3afee 100644
--- a/aggressive-indent.el
+++ b/aggressive-indent.el
@@ -101,7 +101,9 @@ Please include this in your report!"
 
 
 ;;; Start of actual Code:
-(defcustom excluded-modes '(text-mode tabulated-list-mode special-mode)
+(defcustom excluded-modes
+  '(text-mode tabulated-list-mode special-mode
+              minibuffer-inactive-mode)
   "Modes in which `aggressive-indent-mode' should not be activated.
 This variable is only used if `global-aggressive-indent-mode' is
 active. If the minor mode is turned on with the local command,
@@ -138,9 +140,12 @@ Meant for use in hooks. Interactively, use the other one."
   "Indent current defun.
 Throw an error if parentheses are unbalanced."
   (interactive)
-  (indent-region
-   (save-excursion (beginning-of-defun 1) (point))
-   (save-excursion (end-of-defun 1) (point))))
+  (let ((p (point-marker)))
+    (set-marker-insertion-type p t)
+    (indent-region
+     (save-excursion (beginning-of-defun 1) (point))
+     (save-excursion (end-of-defun 1) (point)))
+    (goto-char p)))
 
 
 ;;; Minor modes
@@ -149,7 +154,8 @@ Throw an error if parentheses are unbalanced."
   '(("\C-c\C-q" . aggressive-indent-indent-defun))
   (if mode
       (if (and global-aggressive-indent-mode
-               (cl-member-if #'derived-mode-p excluded-modes))
+               (or (cl-member-if #'derived-mode-p excluded-modes)
+                   buffer-read-only))
           (mode -1)
         (setq-local electric-indent-mode nil)
         (add-hook 'post-command-hook #'-softly-indent-defun nil 'local))
@@ -160,7 +166,7 @@ Throw an error if parentheses are unbalanced."
   mode mode)
 
 :autoload
-(defalias #'aggressive-indent-global-mode
+(defalias 'aggressive-indent-global-mode 
   #'global-aggressive-indent-mode)
 )
 

Reply via email to