Function: gnus-make-sort-function-1

gnus-make-sort-function-1 is a byte-compiled function defined in gnus-util.el.gz.

Signature

(gnus-make-sort-function-1 FUNS)

Documentation

Return a composite sort condition based on the functions in FUNS.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-util.el.gz
(defun gnus-make-sort-function-1 (funs)
  "Return a composite sort condition based on the functions in FUNS."
  (let ((function (car funs))
	(first 't1)
	(last 't2))
    (when (consp function)
      (cond
       ;; Reversed spec.
       ((eq (car function) 'not)
	(setq function (cadr function)
	      first 't2
	      last 't1))
       ((functionp function)
	;; Do nothing.
	)
       (t
	(error "Invalid sort spec: %s" function))))
    (if (cdr funs)
	`(or (,function ,first ,last)
	     (and (not (,function ,last ,first))
		  ,(gnus-make-sort-function-1 (cdr funs))))
      `(,function ,first ,last))))