Function: bs-define-sort-function

bs-define-sort-function is a byte-compiled function defined in bs.el.gz.

Signature

(bs-define-sort-function NAME FUN &optional REGEXP-FOR-SORTING FACE)

Documentation

Define a new function for buffer sorting in Buffer Selection Menu.

NAME specifies the sort order defined by function FUN. A value of nil for FUN means don't sort the buffer list. Otherwise the functions must have two parameters - the buffers to compare. REGEXP-FOR-SORTING is a regular expression which describes the column title to highlight. FACE is a face used to fontify the sorted column title. A value of nil means don't highlight. The new sort aspect will be inserted into list bs-sort-functions.

Source Code

;; Defined in /usr/src/emacs/lisp/bs.el.gz
(defun bs-define-sort-function (name fun &optional regexp-for-sorting face)
  "Define a new function for buffer sorting in Buffer Selection Menu.
NAME specifies the sort order defined by function FUN.
A value of nil for FUN means don't sort the buffer list.  Otherwise the
functions must have two parameters - the buffers to compare.
REGEXP-FOR-SORTING is a regular expression which describes the
column title to highlight.
FACE is a face used to fontify the sorted column title.  A value of nil means
don't highlight.
The new sort aspect will be inserted into list `bs-sort-functions'."
  (let ((tupel (assoc name bs-sort-functions)))
    (if tupel
	(setcdr tupel (list fun regexp-for-sorting face))
      (setq bs-sort-functions
	    (cons (list name fun regexp-for-sorting face)
		  bs-sort-functions)))))