From: yamaoka Date: Thu, 10 Jun 1999 10:17:18 +0000 (+0000) Subject: (luna-define-class-function): Bind member variables statically for old Emacsen. X-Git-Tag: flim-1_13_0~14 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83eb3409c1be37c17c52821e29e41e7f953d0fb4;p=elisp%2Fflim.git (luna-define-class-function): Bind member variables statically for old Emacsen. (TopLevel): Require `static'; bind `:before', `:after' and `:around' statically for old Emacsen. [cf. ] --- diff --git a/luna.el b/luna.el index 65c647a..a35432b 100644 --- a/luna.el +++ b/luna.el @@ -27,6 +27,13 @@ (eval-when-compile (require 'cl)) +(eval-when-compile (require 'static)) + +(static-unless (or (>= emacs-major-version 20)(featurep 'xemacs)) + (defconst :before ':before) + (defconst :after ':after) + (defconst :around ':around)) + (defmacro luna-find-class (name) "Return the luna-class of the given NAME." `(get ,name 'luna-class)) @@ -52,6 +59,11 @@ If SLOTS is specified, TYPE will be defined to have them." ',slots)) (defun luna-define-class-function (type &optional parents slots) + (static-unless (or (>= emacs-major-version 20)(featurep 'xemacs)) + (let (key) + (dolist (slot slots) + (setq key (intern (format ":%s" slot))) + (set key key)))) (let ((oa (make-vector 31 0)) (rest parents) parent name