]> code.delx.au - gnu-emacs/commitdiff
(ibuffer-default-display-maybe-show-predicates): New customizable
authorJohn Paul Wallington <jpw@pobox.com>
Sun, 17 Oct 2004 18:09:42 +0000 (18:09 +0000)
committerJohn Paul Wallington <jpw@pobox.com>
Sun, 17 Oct 2004 18:09:42 +0000 (18:09 +0000)
variable; whether to display buffers that match
`ibuffer-maybe-show-predicates' by default.
(ibuffer-maybe-show-predicates): Mention it in docstring.
(ibuffer-display-maybe-show-predicates): New variable.
(ibuffer-update): Prefix arg now toggles whether buffers that match
`ibuffer-maybe-show-predicates' should be displayed.
(ibuffer-mode): Set `ibuffer-display-maybe-show-predicates' locally to heed
`ibuffer-default-display-maybe-show-predicates'.
(ibuffer-redisplay-engine): Rename optional second arg to `ignore'.

lisp/ChangeLog
lisp/ibuffer.el

index 7eec61491390da9339f35b056227fb64389b4a30..9f5fae1590780c1e109d579a25241672ee4f96c6 100644 (file)
@@ -1,3 +1,16 @@
+2004-10-17  John Paul Wallington  <jpw@gnu.org>
+
+       * ibuffer.el (ibuffer-default-display-maybe-show-predicates):
+       New customizable variable; whether to display buffers that match
+       `ibuffer-maybe-show-predicates' by default.
+       (ibuffer-maybe-show-predicates): Mention it in docstring.
+       (ibuffer-display-maybe-show-predicates): New variable.
+       (ibuffer-update): Prefix arg now toggles whether buffers that
+       match `ibuffer-maybe-show-predicates' should be displayed.
+       (ibuffer-mode): Set `ibuffer-display-maybe-show-predicates'
+       locally to heed `ibuffer-default-display-maybe-show-predicates'.
+       (ibuffer-redisplay-engine): Rename optional second arg to `ignore'.
+
 2004-10-17  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/tramp.el: Redo sync with Tramp 2.0.45.  Last commit did not
index f013f8e3c7240d94f11db3034295f80cd4024aec..12f29bdac638072995e7c87a7d8cc8fb0dffab0c 100644 (file)
@@ -213,12 +213,20 @@ If a regexp, then it will be matched against the buffer's name.
 If a function, it will be called with the buffer as an argument, and
 should return non-nil if this buffer should be shown.
 
-Viewing of buffers hidden because of these predicates is enabled by
-giving a non-nil prefix argument to `ibuffer-update'.  Note that this
-specialized filtering occurs before real filtering."
+Viewing of buffers hidden because of these predicates may be customized
+via `ibuffer-default-display-maybe-show-predicates' and is toggled by 
+giving a non-nil prefix argument to `ibuffer-update'.
+Note that this specialized filtering occurs before real filtering."
   :type '(repeat (choice regexp function))
   :group 'ibuffer)
 
+(defcustom ibuffer-default-display-maybe-show-predicates nil
+  "Non-nil means show buffers that match `ibuffer-maybe-show-predicates'."
+  :type 'boolean
+  :group 'ibuffer)
+
+(defvar ibuffer-display-maybe-show-predicates nil)
+
 (defvar ibuffer-current-format nil)
 
 (defcustom ibuffer-movement-cycle t
@@ -2069,11 +2077,15 @@ If optional arg SILENT is non-nil, do not display progress messages."
 
 (defun ibuffer-update (arg &optional silent)
   "Regenerate the list of all buffers.
-Display buffers whose name matches one of `ibuffer-maybe-show-predicates'
-iff arg ARG is non-nil.
+
+Prefix arg non-nil means to toggle whether buffers that match
+`ibuffer-maybe-show-predicates' should be displayed.
 
 If optional arg SILENT is non-nil, do not display progress messages."
   (interactive "P")
+  (if arg
+      (setq ibuffer-display-maybe-show-predicates
+           (not ibuffer-display-maybe-show-predicates)))
   (ibuffer-forward-line 0)
   (let* ((bufs (buffer-list))
         (blist (ibuffer-filter-buffers
@@ -2086,7 +2098,7 @@ If optional arg SILENT is non-nil, do not display progress messages."
                     (caddr bufs)
                   (cadr bufs))
                 (ibuffer-current-buffers-with-marks bufs)
-                arg)))
+                ibuffer-display-maybe-show-predicates)))
     (when (null blist)
       (if (and (featurep 'ibuf-ext)
               ibuffer-filtering-qualifiers)
@@ -2148,7 +2160,7 @@ If optional arg SILENT is non-nil, do not display progress messages."
      'ibuffer-filter-group
      name)))
 
-(defun ibuffer-redisplay-engine (bmarklist &optional all)
+(defun ibuffer-redisplay-engine (bmarklist &optional ignore)
   (assert (eq major-mode 'ibuffer-mode))
   (let* ((--ibuffer-insert-buffers-and-marks-format
          (ibuffer-current-format))
@@ -2475,6 +2487,8 @@ will be inserted before the group at point."
        ibuffer-default-sorting-reversep)
   (set (make-local-variable 'ibuffer-shrink-to-minimum-size)
        ibuffer-default-shrink-to-minimum-size)
+  (set (make-local-variable 'ibuffer-display-maybe-show-predicates)
+       ibuffer-default-display-maybe-show-predicates)
   (set (make-local-variable 'ibuffer-filtering-qualifiers) nil)
   (set (make-local-variable 'ibuffer-filter-groups) nil)
   (set (make-local-variable 'ibuffer-filter-group-kill-ring) nil)