define-ibuffer-sorter

define-ibuffer-sorter is a Lisp macro in `ibuf-macs.el'.

(define-ibuffer-sorter NAME DOCUMENTATION (&key DESCRIPTION) &rest BODY)

Define a method of sorting named NAME.
DOCUMENTATION is the documentation of the function, which will be called
`ibuffer-do-sort-by-NAME'.
DESCRIPTION is a short string describing the sorting method.

For sorting, the forms in BODY will be evaluated with `a' bound to one
buffer object, and `b' bound to another. BODY should return a non-nil
value if and only if `a' is "less than" `b'.