Function: ibuffer-insert-filter-group-before

ibuffer-insert-filter-group-before is a byte-compiled function defined in ibuf-ext.el.gz.

Signature

(ibuffer-insert-filter-group-before NEWGROUP GROUP)

Source Code

;; Defined in /usr/src/emacs/lisp/ibuf-ext.el.gz
(defun ibuffer-insert-filter-group-before (newgroup group)
  (let* ((found nil)
	 (pos (let ((groups (mapcar #'car ibuffer-filter-groups))
		    (res 0))
		(while groups
		  (if (equal (car groups) group)
		      (setq found t
			    groups nil)
                    (incf res)
		    (setq groups (cdr groups))))
		res)))
    (cond ((not found)
	   (setq ibuffer-filter-groups
		 (nconc ibuffer-filter-groups (list newgroup))))
	  ((zerop pos)
	   (push newgroup ibuffer-filter-groups))
	  (t
	   (let ((cell (nthcdr pos ibuffer-filter-groups)))
	     (setf (cdr cell) (cons (car cell) (cdr cell)))
	     (setf (car cell) newgroup))))))