[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 4c2f34e 010/108: Add excluded mode
From: |
Artur Malabarba |
Subject: |
[elpa] master 4c2f34e 010/108: Add excluded mode |
Date: |
Wed, 25 Mar 2015 18:38:48 +0000 |
branch: master
commit 4c2f34e1788e762e87a59bd5151b374aa4998c66
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>
Add excluded mode
Fix point not moving with indent
---
aggressive-indent.el | 26 ++++++++++++++++----------
1 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/aggressive-indent.el b/aggressive-indent.el
index 03e52b3..0c6df36 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,29 +140,33 @@ 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
:autoload
+(define-globalized-minor-mode global-aggressive-indent-mode
+ mode mode)
+
+:autoload
(define-minor-mode mode nil nil " =>"
'(("\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))
(remove-hook 'post-command-hook #'-softly-indent-defun 'local)))
:autoload
-(define-globalized-minor-mode global-aggressive-indent-mode
- mode mode)
-
-:autoload
-(defalias #'aggressive-indent-global-mode
+(defalias 'aggressive-indent-global-mode
#'global-aggressive-indent-mode)
)
- [elpa] master updated (714fc5b -> 90473ac), Artur Malabarba, 2015/03/25
- [elpa] master 3a0cc9b 001/108: Initial commit, Artur Malabarba, 2015/03/25
- [elpa] master b97643c 005/108: Shorten package description, Artur Malabarba, 2015/03/25
- [elpa] master d48181e 003/108: Readme, Artur Malabarba, 2015/03/25
- [elpa] master 29bbd66 004/108: Changed Lighter, Artur Malabarba, 2015/03/25
- [elpa] master 32387c7 006/108: Merge pull request #1 from purcell/patch-1, Artur Malabarba, 2015/03/25
- [elpa] master 7854cfc 007/108: Replace ’ by ', Artur Malabarba, 2015/03/25
- [elpa] master 82bf8bd 009/108: Merge pull request #2 from Silex/master, Artur Malabarba, 2015/03/25
- [elpa] master 4c2f34e 010/108: Add excluded mode,
Artur Malabarba <=
- [elpa] master 3a4b76a 011/108: Merge branch 'dev', Artur Malabarba, 2015/03/25
- [elpa] master 027e7ed 012/108: Add variable dont-indent-if, so the user can prevent indentation., Artur Malabarba, 2015/03/25
- [elpa] master f23224a 014/108: Reactivate `electric-indent-mode'., Artur Malabarba, 2015/03/25
- [elpa] master 964bfae 016/108: Add yaml mode to excluded modes., Artur Malabarba, 2015/03/25
- [elpa] master 36abeb1 002/108: First Commit., Artur Malabarba, 2015/03/25
- [elpa] master 759f365 018/108: Merge pull request #8 from tuhdo/master, Artur Malabarba, 2015/03/25
- [elpa] master eaa8cee 013/108: Whitespace, Artur Malabarba, 2015/03/25
- [elpa] master 2e993b8 008/108: Remove trailing whitespace, Artur Malabarba, 2015/03/25
- [elpa] master a1429e5 019/108: Fix variable I forgot to namespace, Artur Malabarba, 2015/03/25
- [elpa] master 7cd4e57 015/108: Fix Version, Artur Malabarba, 2015/03/25