Function: semantic-analyze-possible-completions-srecode-template-mode

semantic-analyze-possible-completions-srecode-template-mode is a byte-compiled function defined in srt-mode.el.gz.

Signature

(semantic-analyze-possible-completions-srecode-template-mode CONTEXT &rest FLAGS)

Documentation

Return a list of possible completions based on NONTEXT.

Override semantic-analyze-possible-completions in srecode-template-mode buffers.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/srecode/srt-mode.el.gz
(define-mode-local-override semantic-analyze-possible-completions
  srecode-template-mode (context &rest _flags)
  "Return a list of possible completions based on NONTEXT."
  (with-current-buffer (oref context buffer)
    (let* ((prefix (car (last (oref context prefix))))
	   (prefixstr (cond ((stringp prefix)
			     prefix)
			    ((semantic-tag-p prefix)
			     (semantic-tag-name prefix))))
;	   (completetext (cond ((semantic-tag-p prefix)
;				(semantic-tag-name prefix))
;			       ((stringp prefix)
;				prefix)
;			       ((stringp (car prefix))
;				(car prefix))))
	   (argtype (car (oref context argument)))
	   (matches nil))

      ;; Depending on what the analyzer is, we have different ways
      ;; of creating completions.
      (cond ((eq argtype 'template)
	     (setq matches (semantic-find-tags-for-completion
			    prefixstr (current-buffer)))
	     (setq matches (semantic-find-tags-by-class
			    'function matches))
	     )
	    ((eq argtype 'elispfcn)
	     (with-mode-local emacs-lisp-mode
	       (setq matches (semanticdb-find-tags-for-completion
			      prefixstr))
	       (setq matches (semantic-find-tags-by-class
			      'function matches))
	       )
	     )
	    ((eq argtype 'macro)
	     (let ((scope (oref context scope)))
	       (setq matches
		     (semantic-find-tags-for-completion
		      prefixstr (oref scope fullscope))))
	     )
	    )

      matches)))