From 5f64d69c0e8c100c5a9954a0b1317d9d345a78e2 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Tue, 22 Sep 2009 22:43:28 +0200 Subject: New implementation registration mechanism, for the elisp side of things. Implementations must invoke define-geiser-implementation with an appropriate set of methods. Simple inheritance is supported. Each geiser module defines and registers the method names it uses. --- elisp/geiser-eval.el | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'elisp/geiser-eval.el') diff --git a/elisp/geiser-eval.el b/elisp/geiser-eval.el index 5c84a57..c7b7d2c 100644 --- a/elisp/geiser-eval.el +++ b/elisp/geiser-eval.el @@ -14,6 +14,7 @@ +(require 'geiser-impl) (require 'geiser-connection) (require 'geiser-syntax) (require 'geiser-log) @@ -22,20 +23,26 @@ ;;; Plug-able functions: -(make-variable-buffer-local - (defvar geiser-eval--get-module-function nil - "Function used to obtain the module for current buffer. It -takes an optional argument, for cases where we want to force its value.")) +(defvar geiser-eval--get-module-function nil) + +(geiser-impl--register-local-method + 'geiser-eval--get-module-function 'find-module '(lambda (&rest) nil) + "Function used to obtain the module for current buffer. It takes +an optional argument, for cases where we want to force its +value.") (defsubst geiser-eval--get-module (&optional module) (and geiser-eval--get-module-function (funcall geiser-eval--get-module-function module))) -(make-variable-buffer-local - (defvar geiser-eval--geiser-procedure-function nil - "Translate a bare procedure symbol to one executable in Guile's -context. Return NULL for unsupported ones; at the very least, -EVAL, COMPILE, LOAD-FILE and COMPILE-FILE should be supported.")) +(defvar geiser-eval--geiser-procedure-function nil) + +(geiser-impl--register-local-method + 'geiser-eval--geiser-procedure-function 'marshall-procedure 'identity + "Function to translate a bare procedure symbol to one executable +in the Scheme context. Return NULL for unsupported ones; at the +very least, EVAL, COMPILE, LOAD-FILE and COMPILE-FILE should be +supported.") (defsubst geiser-eval--form (proc) (funcall geiser-eval--geiser-procedure-function proc)) -- cgit v1.2.3