diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2010-05-02 22:29:46 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2010-05-02 22:29:46 -0400 |
commit | 56eb09046e00ac7ee6d3d3d752cb1ee664b7e062 (patch) | |
tree | 6ff481ffba16576053b3cb2a8ad24a4f66bdec4a /lisp/ibuf-ext.el | |
parent | 063371f2b0dc2519db3abcbe54955167bde8ca9e (diff) | |
download | emacs-56eb09046e00ac7ee6d3d3d752cb1ee664b7e062.tar.gz |
Use define-minor-mode where applicable.
* mh-show.el (mh-showing-mode): Move function to mh-e.el.
* mh-e.el (mh-showing-mode):
* url-dired.el (url-dired-minor-mode):
* org-table.el (orgtbl-mode):
* view.el (view-mode):
* type-break.el (type-break-query-mode)
(type-break-mode-line-message-mode):
* textmodes/reftex.el (reftex-mode):
* term/vt100.el (vt100-wide-mode):
* tar-mode.el (tar-subfile-mode):
* savehist.el (savehist-mode):
* ibuf-ext.el (ibuffer-auto-mode):
* composite.el (auto-composition-mode):
* progmodes/vhdl-mode.el (vhdl-electric-mode, vhdl-stutter-mode):
Use define-minor-mode.
(vhdl-mode): Use static mode-line format.
(vhdl-mode-line-update): Delete.
(vhdl-create-mode-menu, vhdl-activate-customizations)
(vhdl-hs-minor-mode): Don't bother calling it.
Diffstat (limited to 'lisp/ibuf-ext.el')
-rw-r--r-- | lisp/ibuf-ext.el | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el index 69eb3188862..dcea1e57472 100644 --- a/lisp/ibuf-ext.el +++ b/lisp/ibuf-ext.el @@ -91,11 +91,6 @@ regardless of any active filters in this buffer." (defvar ibuffer-tmp-show-regexps nil "A list of regexps which should match buffer names to always show.") -(defvar ibuffer-auto-mode nil - "If non-nil, Ibuffer auto-mode should be enabled for this buffer. -Do not set this variable directly! Use the function -`ibuffer-auto-mode' instead.") - (defvar ibuffer-auto-buffers-changed nil) (defcustom ibuffer-saved-filters '(("gnus" @@ -220,6 +215,16 @@ Currently, this only applies to `ibuffer-saved-filters' and (ibuffer-included-in-filters-p buf ibuffer-filtering-qualifiers) (ibuffer-buf-matches-predicates buf ibuffer-always-show-predicates))))) +;;;###autoload +(define-minor-mode ibuffer-auto-mode + "Toggle use of Ibuffer's auto-update facility. +With numeric ARG, enable auto-update if and only if ARG is positive." + 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)) + (defun ibuffer-auto-update-changed () (when (frame-or-buffer-changed-p 'ibuffer-auto-buffers-changed) (dolist (buf (buffer-list)) @@ -230,20 +235,6 @@ Currently, this only applies to `ibuffer-saved-filters' and (ibuffer-update nil t))))))) ;;;###autoload -(defun ibuffer-auto-mode (&optional arg) - "Toggle use of Ibuffer's auto-update facility. -With numeric ARG, enable auto-update if and only if ARG is positive." - (interactive) - (unless (derived-mode-p 'ibuffer-mode) - (error "This buffer is not in Ibuffer mode")) - (set (make-local-variable 'ibuffer-auto-mode) - (if arg - (plusp arg) - (not ibuffer-auto-mode))) - (frame-or-buffer-changed-p 'ibuffer-auto-buffers-changed) ; Initialize state vector - (add-hook 'post-command-hook 'ibuffer-auto-update-changed)) - -;;;###autoload (defun ibuffer-mouse-filter-by-mode (event) "Enable or disable filtering by the major mode chosen via mouse." (interactive "e") |