Function: idlwave-routine-entry-compare

idlwave-routine-entry-compare is a byte-compiled function defined in idlwave.el.gz.

Signature

(idlwave-routine-entry-compare A B)

Documentation

Compare two routine info entries for sorting.

This is the general case. It first compares class, names, and type. If it turns out that A and B are twins (same name, class, and type), calls another routine which compares twins on the basis of their file names and path locations.

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/idlwave.el.gz
(defun idlwave-routine-entry-compare (a b)
  "Compare two routine info entries for sorting.
This is the general case.  It first compares class, names, and type.
If it turns out that A and B are twins (same name, class, and type),
calls another routine which compares twins on the basis of their file
names and path locations."
  (let ((name (car a)) (type (nth 1 a)) (class (nth 2 a)))
    (cond
     ((not (equal (idlwave-downcase-safe class)
		  (idlwave-downcase-safe (nth 2 b))))
      ;; Class decides
      (cond ((null (nth 2 b)) nil)
	    ((null class) t)
	    (t (string< (downcase class) (downcase (nth 2 b))))))
     ((not (equal (downcase name) (downcase (car b))))
      ;; Name decides
      (string< (downcase name) (downcase (car b))))
     ((not (eq type (nth 1 b)))
      ;; Type decides
      (< (if (eq type 'fun) 1 0) (if (eq (nth 1 b) 'fun) 1 0)))
     (t
      ;; A and B are twins - so the decision is more complicated.
      ;; Call twin-compare with the proper arguments.
      (idlwave-routine-entry-compare-twins a b)))))