Function: ps-alist-position

ps-alist-position is a byte-compiled function defined in ps-print.el.gz.

Signature

(ps-alist-position ITEM LIST)

Source Code

;; Defined in /usr/src/emacs/lisp/ps-print.el.gz
;; Find the first occurrence of ITEM in LIST.
;; Return the index of the matching item, or nil if not found.
;; Elements are compared with `eq'.
(defun ps-alist-position (item list)
  (let ((tail list) (index 0) found)
    (while tail
      (if (setq found (eq (car (car tail)) item))
	  (setq tail nil)
	(setq index (1+ index)
	      tail (cdr tail))))
    (and found index)))