Function: srecode-calculate-context

srecode-calculate-context is a byte-compiled function defined in ctxt.el.gz.

Signature

(srecode-calculate-context)

Documentation

Calculate the context at the current point.

The returned context is a list, with the top-most context first. Each returned context is a string that would show up in a context statement in an .srt file.

Some useful context values used by the provided srecode templates are:
  "file" - Templates that for a file (such as an empty file.)
     "empty" - The file is empty
  "declaration" - Top-level declarations in a file.
     "include" - In or near include statements
     "package" - In or near provide statements
     "function" - In or near function statements
         "NAME" - Near functions within NAME namespace or class
     "variable" - In or near variable statements.
     "type" - In or near type declarations.
     "comment" - In a comment
  "classdecl" - Declarations within a class/struct/etc.
     "variable" - In or near class fields
     "function" - In or near methods/functions
        "virtual" - Nearby items are virtual
           "pure" - and those virtual items are pure virtual
     "type" - In or near type declarations.
     "comment" - In a comment in a block of code
     -- these items show up at the end of the context list. --
     "public", "protected", "private" -
                  In or near a section of public/protected/private entries.
  "code" - In a block of code.
     "string" - In a string in a block of code
     "comment" - In a comment in a block of code

    ... More later.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/srecode/ctxt.el.gz
;;; Code:

(define-overloadable-function srecode-calculate-context ()
  "Calculate the context at the current point.
The returned context is a list, with the top-most context first.
Each returned context is a string that would show up in a `context'
statement in an `.srt' file.

Some useful context values used by the provided srecode templates are:
  \"file\" - Templates that for a file (such as an empty file.)
     \"empty\" - The file is empty
  \"declaration\" - Top-level declarations in a file.
     \"include\" - In or near include statements
     \"package\" - In or near provide statements
     \"function\" - In or near function statements
         \"NAME\" - Near functions within NAME namespace or class
     \"variable\" - In or near variable statements.
     \"type\"     - In or near type declarations.
     \"comment\"  - In a comment
  \"classdecl\" - Declarations within a class/struct/etc.
     \"variable\" - In or near class fields
     \"function\" - In or near methods/functions
        \"virtual\" - Nearby items are virtual
           \"pure\" - and those virtual items are pure virtual
     \"type\"     - In or near type declarations.
     \"comment\"  - In a comment in a block of code
     -- these items show up at the end of the context list.  --
     \"public\", \"protected\", \"private\" -
                  In or near a section of public/protected/private entries.
  \"code\" - In a block of code.
     \"string\" - In a string in a block of code
     \"comment\"  - In a comment in a block of code

    ... More later."
  )