Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(init InitFunction)
Register makes sure a function will be called at module initialization
Types ¶
type EmacsCompat ¶
type EmacsCompat int
const ( EMACS25 EmacsCompat = 25 EMACS26 EmacsCompat = 26 EMACS27 EmacsCompat = 27 )
type Environment ¶
type Environment interface { MakeGlobalRef(Value) Value FreeGlobalRef(Value) NonLocalExitCheck() error GoString(Value) (string, error) String(string) String GoBool(Value) bool Bool(bool) Value GoInt(Value) int64 Int(int64) Int GoFloat(Value) float64 Float(float64) Float MakeFunction(FunctionType, int, string, interface{}) Function MakeUserPointer(interface{}) UserPointer ResolveUserPointer(UserPointer) (interface{}, bool) VecSize(Vector) int VecSet(Vector, int, Value) VecGet(Vector, int) Value // additional helpers StdLib() StdLib RegisterFunction(string, FunctionType, int, string, interface{}) Function ProvideFeature(string) CheckCompatibility(EmacsCompat) bool }
Environment provides primitives for emacs modules
type FunctionCallContext ¶
type FunctionCallContext interface { Environment() Environment NumberArgs() int Arg(int) Value StringArg(int) String UserPointerArg(int) UserPointer GoStringArg(int) (string, error) }
FunctionCallContext is the one argument module functions will receive
type FunctionType ¶
type FunctionType func(FunctionCallContext) (Value, error)
FunctionType is the type for module functions
type InitFunction ¶
type InitFunction func(Environment)
InitFunction is the type for functions to be called at module initialization
type Registry ¶
type Registry interface { Register(interface{}) int64 Lookup(int64) (interface{}, bool) Unregister(int64) }
Registry is a key-value store for arbitrary objects
type StdLib ¶
type StdLib interface { Funcall(f Callable, args ...Value) (Value, error) Eq(a, b Value) bool Equal(a, b Value) bool Intern(s string) Symbol Fset(sym Symbol, f Function) Fboundp(sym Symbol) bool Provide(sym Symbol) Message(s string) List(items ...Value) List Nil() Value T() Value }
StdLib exposes high-level emacs functions
type UserPointer ¶
type UserPointer interface { Value }
UserPointer represents a module-created pointer
type Value ¶
type Value interface { AsString() String AsInt() Int AsFloat() Float AsSymbol() Symbol AsFunction() Function AsVector() Vector AsList() List AsUserPointer() UserPointer // contains filtered or unexported methods }
Value wraps an emacs value
Source Files
¶
Click to show internal directories.
Click to hide internal directories.