Function: math-expr-contains-count

math-expr-contains-count is an autoloaded and byte-compiled function defined in calc-alg.el.gz.

Signature

(math-expr-contains-count EXPR THING)

Source Code

;; Defined in /usr/src/emacs/lisp/calc/calc-alg.el.gz
;;; Simple operations on expressions.

;;; Return number of occurrences of thing in expr, or nil if none.
(defun math-expr-contains-count (expr thing)
  (cond ((equal expr thing) 1)
	((Math-primp expr) nil)
	(t
	 (let ((num 0))
	   (while (setq expr (cdr expr))
	     (setq num (+ num (or (math-expr-contains-count
				   (car expr) thing) 0))))
	   (and (> num 0)
		num)))))