changeset 94508:4d31120b081e

(define-ibuffer-sorter): Define the sorter to reverse sorting order if last sorting mode was the sorter's.
author John Paul Wallington <jpw@pobox.com>
date Thu, 01 May 2008 01:19:26 +0000
parents f72e4491c400
children b24d68e95e4e
files lisp/ibuf-macs.el
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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))