]> code.delx.au - gnu-emacs/blobdiff - lisp/ibuf-ext.el
Merge changes from emacs-23 branch
[gnu-emacs] / lisp / ibuf-ext.el
index c77a479c0b18768545fc86d157984d984b7083ae..073efaeee2ae4140310618fb51b0c373727e6e45 100644 (file)
@@ -505,7 +505,7 @@ To evaluate a form without viewing the buffer, see `ibuffer-do-eval'."
              (assoc (cdr filter)
                     ibuffer-saved-filters)))
         (unless data
-          (ibuffer-filter-disable)
+          (ibuffer-filter-disable t)
           (error "Unknown saved filter %s" (cdr filter)))
         (ibuffer-included-in-filters-p buf (cadr data))))
       (t
@@ -514,7 +514,7 @@ To evaluate a form without viewing the buffer, see `ibuffer-do-eval'."
         ;; filterdat should be like (TYPE DESCRIPTION FUNC)
         ;; just a sanity check
        (unless filterdat
-         (ibuffer-filter-disable)
+         (ibuffer-filter-disable t)
          (error "Undefined filter %s" (car filter)))
        (not
         (not
@@ -768,11 +768,14 @@ The value from `ibuffer-saved-filter-groups' is used."
   (ibuffer-update nil t))
 
 ;;;###autoload
-(defun ibuffer-filter-disable ()
-  "Disable all filters currently in effect in this buffer."
+(defun ibuffer-filter-disable (&optional delete-filter-groups)
+  "Disable all filters currently in effect in this buffer.
+With optional arg DELETE-FILTER-GROUPS non-nil, delete all filter
+group definitions by setting `ibuffer-filter-groups' to nil."
   (interactive)
-  (setq ibuffer-filtering-qualifiers nil
-       ibuffer-filter-groups nil)
+  (setq ibuffer-filtering-qualifiers nil)
+  (if delete-filter-groups
+      (setq ibuffer-filter-groups nil))
   (let ((buf (ibuffer-current-buffer)))
     (ibuffer-update nil t)
     (when buf
@@ -1219,12 +1222,10 @@ mean move backwards, non-negative integers mean move forwards."
     (setq direction 1))
   ;; Skip the title
   (ibuffer-forward-line 0)
-  (let ((opos (point))
-       curmark)
+  (let ((opos (point)))
     (ibuffer-forward-line direction)
     (while (not (or (= (point) opos)
-                   (eq (setq curmark (ibuffer-current-mark))
-                       mark)))
+                   (eq (ibuffer-current-mark) mark)))
       (ibuffer-forward-line direction))
     (when (and (= (point) opos)
               (not (eq (ibuffer-current-mark) mark)))
@@ -1247,7 +1248,7 @@ to move by.  The default is `ibuffer-marked-char'."
       (message "No buffers marked; use 'm' to mark a buffer")
     (let ((count
           (ibuffer-map-marked-lines
-           #'(lambda (buf mark)
+           #'(lambda (_buf _mark)
                'kill))))
       (message "Killed %s lines" count))))
 
@@ -1279,7 +1280,7 @@ a prefix argument reverses the meaning of that variable."
     (let (buf-point)
       ;; Blindly search for our buffer: it is very likely that it is
       ;; not in a hidden filter group.
-      (ibuffer-map-lines #'(lambda (buf marks)
+      (ibuffer-map-lines #'(lambda (buf _marks)
                             (when (string= (buffer-name buf) name)
                               (setq buf-point (point))
                               nil))
@@ -1293,7 +1294,7 @@ a prefix argument reverses the meaning of that variable."
          (dolist (group ibuffer-hidden-filter-groups)
            (ibuffer-jump-to-filter-group group)
            (ibuffer-toggle-filter-group)
-           (ibuffer-map-lines #'(lambda (buf marks)
+           (ibuffer-map-lines #'(lambda (buf _marks)
                                   (when (string= (buffer-name buf) name)
                                     (setq buf-point (point))
                                     nil))
@@ -1336,8 +1337,7 @@ a prefix argument reverses the meaning of that variable."
                                         (format "Buffer %s" (buffer-name buffer)))))
                       ,(shell-quote-argument (or oldtmp old))
                       ,(shell-quote-argument (or newtmp new)))
-                    " "))
-                  proc)
+                    " ")))
              (let ((inhibit-read-only t))
                (insert command "\n")
                (diff-sentinel
@@ -1396,7 +1396,7 @@ You can then feed the file name(s) to other commands with \\[yank]."
                      (t
                       'name))))
       (ibuffer-map-marked-lines
-       #'(lambda (buf mark)
+       #'(lambda (buf _mark)
           (setq ibuffer-copy-filename-as-kill-result
                 (concat ibuffer-copy-filename-as-kill-result
                         (let ((name (buffer-file-name buf)))
@@ -1417,7 +1417,7 @@ You can then feed the file name(s) to other commands with \\[yank]."
 (defun ibuffer-mark-on-buffer (func &optional ibuffer-mark-on-buffer-mark group)
   (let ((count
         (ibuffer-map-lines
-         #'(lambda (buf mark)
+         #'(lambda (buf _mark)
              (when (funcall func buf)
                (ibuffer-set-mark-1 (or ibuffer-mark-on-buffer-mark
                                        ibuffer-marked-char))
@@ -1585,7 +1585,7 @@ defaults to one."
   (let ((ibuffer-do-occur-bufs nil))
     ;; Accumulate a list of marked buffers
     (ibuffer-map-marked-lines
-     #'(lambda (buf mark)
+     #'(lambda (buf _mark)
         (push buf ibuffer-do-occur-bufs)))
     (occur-1 regexp nlines ibuffer-do-occur-bufs)))