From: John Paul Wallington Date: Thu, 1 May 2008 01:17:35 +0000 (+0000) Subject: (ibuffer-last-sorting-mode): New variable. X-Git-Tag: emacs-pretest-23.0.90~5918 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e782065477917c10759d618e43b2ec18330ffae3;p=emacs.git (ibuffer-last-sorting-mode): New variable. (ibuffer-do-sort-by-recency): Reverse sorting order if last sorting mode was recency. --- diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index fbd3769edd7..47c7ab2ab3d 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -214,6 +214,7 @@ view of the buffers." (const :tag "Major mode" :value major-mode)) :group 'ibuffer) (defvar ibuffer-sorting-mode nil) +(defvar ibuffer-last-sorting-mode nil) (defcustom ibuffer-default-sorting-reversep nil "If non-nil, reverse the default sorting order." @@ -1997,7 +1998,10 @@ the value of point at the beginning of the line for that buffer." "Sort the buffers by last view time." (interactive) (setq ibuffer-sorting-mode 'recency) - (ibuffer-update nil t)) + (when (eq ibuffer-last-sorting-mode 'recency) + (setq ibuffer-sorting-reversep (not ibuffer-sorting-reversep))) + (ibuffer-update nil t) + (setq ibuffer-last-sorting-mode 'recency)) (defun ibuffer-update-format () (when (null ibuffer-current-format)