Function: cedet-cscope-version-check
cedet-cscope-version-check is an interactive and byte-compiled
function defined in cedet-cscope.el.gz.
Signature
(cedet-cscope-version-check &optional NOERROR)
Documentation
Check the version of the installed CScope command.
If optional programmatic argument NOERROR is non-nil, then instead of throwing an error if CScope isn't available, return nil.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/cedet/cedet-cscope.el.gz
(defun cedet-cscope-version-check (&optional noerror)
"Check the version of the installed CScope command.
If optional programmatic argument NOERROR is non-nil,
then instead of throwing an error if CScope isn't available,
return nil."
(interactive)
(let ((b (condition-case nil
(cedet-cscope-call (list "-V"))
(error nil)))
(rev nil))
(if (not b)
(progn
(when (called-interactively-p 'interactive)
(message "CScope not found."))
nil)
(with-current-buffer b
(goto-char (point-min))
(re-search-forward "cscope: version \\([0-9.]+\\)" nil t)
(setq rev (match-string 1))
(if (version< rev cedet-cscope-min-version)
(if noerror
nil
(error "Version of CScope is %s. Need at least %s"
rev cedet-cscope-min-version))
;; Else, return TRUE, as in good enough.
(when (called-interactively-p 'interactive)
(message "CScope %s - Good enough for CEDET." rev))
t)))))