Function: semantic-idle-summary-current-symbol-info-semantic-grammar-mode

semantic-idle-summary-current-symbol-info-semantic-grammar-mode is a byte-compiled function defined in grammar.el.gz.

Signature

(semantic-idle-summary-current-symbol-info-semantic-grammar-mode)

Documentation

Display additional eldoc information about grammar syntax elements.

Syntax element is the current symbol at point. If it is associated a help string in semantic-grammar-syntax-help, return that string. If it is a macro name, return a description of the associated expander function parameter list. If it is a function name, return a description of this function parameter list. If it is a variable name, return a brief (one-line) documentation string for the variable. If a default description of the current context can be obtained, return it. Otherwise return nil. Override semantic-idle-summary-current-symbol-info in semantic-grammar-mode buffers.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/grammar.el.gz
(define-mode-local-override semantic-idle-summary-current-symbol-info
  semantic-grammar-mode ()
  "Display additional eldoc information about grammar syntax elements.
Syntax element is the current symbol at point.
If it is associated a help string in `semantic-grammar-syntax-help',
return that string.
If it is a macro name, return a description of the associated expander
function parameter list.
If it is a function name, return a description of this function
parameter list.
If it is a variable name, return a brief (one-line) documentation
string for the variable.
If a default description of the current context can be obtained,
return it.
Otherwise return nil."
  (require 'eldoc)
  (let* ((elt (car (semantic-ctxt-current-symbol)))
         (val (and elt (cdr (assoc elt semantic-grammar-syntax-help)))))
    (when (and (not val) elt (semantic-grammar-in-lisp-p))
      ;; Ensure to load macro definitions before doing `intern-soft'.
      (setq val (semantic-grammar-macros)
            elt (intern-soft elt)
            val (and elt (cdr (assq elt val))))
      (cond
       ;; Grammar macro
       ((and val (fboundp val))
        (setq val (semantic-grammar-eldoc-get-macro-docstring elt val)))
       ;; Function
       ((and elt (fboundp elt))
        (setq val (if (fboundp 'eldoc-get-fnsym-args-string)
                      (eldoc-get-fnsym-args-string elt)
                    (elisp-get-fnsym-args-string elt))))
       ;; Variable
       ((and elt (boundp elt))
        (setq val (if (fboundp 'eldoc-get-var-docstring)
                      (eldoc-get-var-docstring elt)
                    (elisp-get-var-docstring elt))))
       (t nil)))
    (or val (semantic-idle-summary-current-symbol-info-default))))