Function: semantic-ctxt-current-symbol-and-bounds-default

semantic-ctxt-current-symbol-and-bounds-default is a byte-compiled function defined in ctxt.el.gz.

Signature

(semantic-ctxt-current-symbol-and-bounds-default &optional POINT)

Documentation

Return the current symbol and bounds the cursor is on at POINT.

Uses semantic-ctxt-current-symbol to calculate the symbol. Return (PREFIX ENDSYM BOUNDS).

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/ctxt.el.gz
(defun semantic-ctxt-current-symbol-and-bounds-default (&optional point)
  "Return the current symbol and bounds the cursor is on at POINT.
Uses `semantic-ctxt-current-symbol' to calculate the symbol.
Return (PREFIX ENDSYM BOUNDS)."
  (save-excursion
    (when point (goto-char (point)))
    (let* ((prefix (semantic-ctxt-current-symbol))
	   (endsym (car (reverse prefix)))
	   ;; @todo - Can we get this data direct from ctxt-current-symbol?
	   (bounds (save-excursion
		     (cond ((string= endsym "")
			    (cons (point) (point))
			    )
			   ((and prefix (looking-at endsym))
			    (cons (point) (progn
					    (condition-case nil
						(forward-sexp 1)
					      (error nil))
					    (point))))
			   (prefix
			    (condition-case nil
				(cons (progn (forward-sexp -1) (point))
				      (progn (forward-sexp 1) (point)))
			      (error nil)))
			   (t nil))))
	   )
      (list prefix endsym bounds))))