Function: ibuffer-toggle-sorting-mode

ibuffer-toggle-sorting-mode is an autoloaded, interactive and byte-compiled function defined in ibuf-ext.el.gz.

Signature

(ibuffer-toggle-sorting-mode)

Documentation

Toggle the current sorting mode.

Default sorting modes are:
 Recency - the last time the buffer was viewed
 Name - the name of the buffer
 Major Mode - the name of the major mode of the buffer
 Size - the size of the buffer

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/ibuf-ext.el.gz
;;; Sorting

;;;###autoload
(defun ibuffer-toggle-sorting-mode ()
  "Toggle the current sorting mode.
Default sorting modes are:
 Recency - the last time the buffer was viewed
 Name - the name of the buffer
 Major Mode - the name of the major mode of the buffer
 Size - the size of the buffer"
  (interactive)
  (let ((modes (mapcar #'car ibuffer-sorting-functions-alist)))
    (cl-pushnew 'recency modes)
    (setq modes (sort modes #'string-lessp))
    (let ((next (or (car-safe (cdr-safe (memq ibuffer-sorting-mode modes)))
                    (car modes))))
      (setq ibuffer-sorting-mode next)
      (message "Sorting by %s" next)))
  (ibuffer-redisplay t))