]> code.delx.au - gnu-emacs/blobdiff - lisp/ibuf-macs.el
Switch to recommended form of GPLv3 permissions notice.
[gnu-emacs] / lisp / ibuf-macs.el
index f84b84cfd4d374cc3c37166913a3ff8436f4d912..947c2b7040af8856025ea2e622de4d87864aa3c8 100644 (file)
@@ -1,7 +1,7 @@
 ;;; ibuf-macs.el --- macros for ibuffer
 
 ;; Copyright (C) 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007 Free Software Foundation, Inc.
+;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 ;; Author: Colin Walters <walters@verbum.org>
 ;; Maintainer: John Paul Wallington <jpw@gnu.org>
@@ -12,7 +12,7 @@
 
 ;; This program is free software; you can redistribute it and/or
 ;; modify it under the terms of the GNU General Public License as
-;; published by the Free Software Foundation; either version 2, or (at
+;; published by the Free Software Foundation; either version 3, or (at
 ;; your option) any later version.
 
 ;; This program is distributed in the hope that it will be useful, but
@@ -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))
@@ -299,5 +302,5 @@ bound to the current value of the filter.
 
 (provide 'ibuf-macs)
 
-;;; arch-tag: 2748edce-82c9-4cd9-9d9d-bd73e43c20c5
+;; arch-tag: 2748edce-82c9-4cd9-9d9d-bd73e43c20c5
 ;;; ibuf-macs.el ends here