Function: semantic-complete-inline-tag-project

semantic-complete-inline-tag-project is a byte-compiled function defined in complete.el.gz.

Signature

(semantic-complete-inline-tag-project)

Documentation

Complete a symbol name by name from within the current project.

This is similar to semantic-complete-read-tag-project, except that the completion interaction is in the buffer where the context was calculated from. Customize semantic-complete-inline-analyzer-displayer-class to control how completion options are displayed. See semantic-complete-inline-tag-engine for details on how completion works.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/complete.el.gz
(defun semantic-complete-inline-tag-project ()
  "Complete a symbol name by name from within the current project.
This is similar to `semantic-complete-read-tag-project', except
that the completion interaction is in the buffer where the context
was calculated from.
Customize `semantic-complete-inline-analyzer-displayer-class'
to control how completion options are displayed.
See `semantic-complete-inline-tag-engine' for details on how
completion works."
  (let* ((collector (semantic-collector-project-brutish
		     :buffer (current-buffer)
		     :path (current-buffer)))
	 (sbounds (semantic-ctxt-current-symbol-and-bounds))
	 (syms (car sbounds))
	 (start (car (nth 2 sbounds)))
	 (end (cdr (nth 2 sbounds)))
	 (rsym (reverse syms))
	 (thissym (nth 1 sbounds))
	 (nextsym (car-safe (cdr rsym)))
	 (complst nil))
    (when (and thissym (or (not (string= thissym ""))
			   nextsym))
      ;; Do a quick calculation of completions.
      (semantic-collector-calculate-completions
       collector thissym nil)
      ;; Get the master list
      (setq complst (semanticdb-strip-find-results
		     (semantic-collector-all-completions collector thissym)))
      ;; Shorten by name
      (setq complst (semantic-unique-tag-table-by-name complst))
      (if (or (and (= (length complst) 1)
		   ;; Check to see if it is the same as what is there.
		   ;; if so, we can offer to complete.
		   (let ((compname (semantic-tag-name (car complst))))
		     (not (string= compname thissym))))
	      (> (length complst) 1))
	  ;; There are several options.  Do the completion.
	  (semantic-complete-inline-tag-engine
	   collector
	   (funcall semantic-complete-inline-analyzer-displayer-class)
	   ;;(semantic-displayer-tooltip)
	   (current-buffer)
	   start end))
      )))