summaryrefslogtreecommitdiff
path: root/lisp/ibuf-ext.el
diff options
context:
space:
mode:
authorTino Calancha <tino.calancha@gmail.com>2016-07-27 19:44:06 +0900
committerTino Calancha <tino.calancha@gmail.com>2016-07-27 19:44:06 +0900
commite0d425976e3a83585db9a586687897fe1ac6455f (patch)
tree6790ef076d00fedac524feceefe806b4719e00af /lisp/ibuf-ext.el
parent404765526af1a29ba9a9a8c870726588e423d657 (diff)
downloademacs-e0d425976e3a83585db9a586687897fe1ac6455f.tar.gz
Remove hook when disabling ibuffer-auto-mode
* lisp/ibuf-ext.el (ibuffer-auto-mode): Remove 'ibuffer-auto-update-changed' from 'post-command-hook'.
Diffstat (limited to 'lisp/ibuf-ext.el')
-rw-r--r--lisp/ibuf-ext.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el
index 96b42b99f5c..f93957ecb78 100644
--- a/lisp/ibuf-ext.el
+++ b/lisp/ibuf-ext.el
@@ -250,8 +250,11 @@ the mode if ARG is omitted or nil."
nil nil nil
(unless (derived-mode-p 'ibuffer-mode)
(error "This buffer is not in Ibuffer mode"))
- (frame-or-buffer-changed-p 'ibuffer-auto-buffers-changed) ; Initialize state vector
- (add-hook 'post-command-hook 'ibuffer-auto-update-changed))
+ (cond (ibuffer-auto-mode
+ (frame-or-buffer-changed-p 'ibuffer-auto-buffers-changed) ; Initialize state vector
+ (add-hook 'post-command-hook 'ibuffer-auto-update-changed))
+ (t
+ (remove-hook 'post-command-hook 'ibuffer-auto-update-changed))))
(defun ibuffer-auto-update-changed ()
(when (frame-or-buffer-changed-p 'ibuffer-auto-buffers-changed)