From: John Paul Wallington Date: Thu, 1 May 2008 01:19:26 +0000 (+0000) Subject: (define-ibuffer-sorter): Define the sorter to reverse sorting order if X-Git-Tag: emacs-pretest-23.0.90~5917 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e3b714390480e3082a6fab0ea636cb1d8a6c93e5;p=emacs.git (define-ibuffer-sorter): Define the sorter to reverse sorting order if last sorting mode was the sorter's. --- diff --git a/lisp/ibuf-macs.el b/lisp/ibuf-macs.el index d3a4da54e50..947c2b7040a 100644 --- a/lisp/ibuf-macs.el +++ b/lisp/ibuf-macs.el @@ -150,7 +150,10 @@ value if and only if `a' is \"less than\" `b'. ,(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))