# HG changeset patch # User John Paul Wallington # Date 1209604766 0 # Node ID 4d31120b081e09efbccafd6e62d001d099d1dbc5 # Parent f72e4491c400f99896c5a551f4173805a0b1fde2 (define-ibuffer-sorter): Define the sorter to reverse sorting order if last sorting mode was the sorter's. diff -r f72e4491c400 -r 4d31120b081e lisp/ibuf-macs.el --- a/lisp/ibuf-macs.el Thu May 01 01:17:35 2008 +0000 +++ b/lisp/ibuf-macs.el Thu May 01 01:19:26 2008 +0000 @@ -150,7 +150,10 @@ ,(or documentation "No :documentation specified for this sorting method.") (interactive) (setq ibuffer-sorting-mode ',name) - (ibuffer-redisplay t)) + (when (eq ibuffer-sorting-mode ibuffer-last-sorting-mode) + (setq ibuffer-sorting-reversep (not ibuffer-sorting-reversep))) + (ibuffer-redisplay t) + (setq ibuffer-last-sorting-mode ',name)) (push (list ',name ,description #'(lambda (a b) ,@body))