]> git.eshelyaron.com Git - emacs.git/commitdiff
(ibuffer-last-sorting-mode): New variable.
authorJohn Paul Wallington <jpw@pobox.com>
Thu, 1 May 2008 01:17:35 +0000 (01:17 +0000)
committerJohn Paul Wallington <jpw@pobox.com>
Thu, 1 May 2008 01:17:35 +0000 (01:17 +0000)
(ibuffer-do-sort-by-recency): Reverse sorting order if last sorting
mode was recency.

lisp/ibuffer.el

index fbd3769edd7210498f617e510583d8d8b49743f0..47c7ab2ab3d0fa8b9b134c478be370ddc8e41a0f 100644 (file)
@@ -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)