X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=broken.el;h=c5d5e4042d553d520e38eaa7458c5b695ab721b5;hb=ded9e2b798c4a77d4660c7c85bd5c3185ea22729;hp=7d5949242306e5e76c1481c04d6956e2a91d9e2e;hpb=3e1c6c07e320a7ba2dc26963342a8112148fef3d;p=elisp%2Fapel.git diff --git a/broken.el b/broken.el index 7d59492..c5d5e40 100644 --- a/broken.el +++ b/broken.el @@ -1,6 +1,6 @@ ;;; broken.el --- Emacs broken facility infomation registry. -;; Copyright (C) 1998 Tanaka Akira +;; Copyright (C) 1998, 1999 Tanaka Akira ;; Author: Tanaka Akira ;; Keywords: emulation, compatibility, incompatibility, Mule @@ -24,6 +24,7 @@ ;;; Code: +(require 'static) (require 'poe) (eval-and-compile @@ -55,34 +56,38 @@ ASSERTION is evaluated statically. FACILITY must be symbol. -If ASSERTION is not ommited and evaluated to nil and NO-NOTICE is nil, it is noticed." - (let ((assertion-value (eval assertion))) - (eval (` (broken-facility-internal - '(, facility) (, docstring) '(, assertion-value)))) - (when (and assertion (not assertion-value) (not no-notice) - notice-non-obvious-broken-facility) - (message "BROKEN FACILITY DETECTED: %s" docstring)) - (` (broken-facility-internal - '(, facility) (, docstring) '(, assertion-value))))) +If ASSERTION is not ommited and evaluated to nil and NO-NOTICE is nil, +it is noticed." + (` (static-if (, assertion) + (eval-and-compile + (broken-facility-internal '(, facility) (, docstring) t)) + (eval-when-compile + (when (and '(, assertion) (not '(, no-notice)) + notice-non-obvious-broken-facility) + (message "BROKEN FACILITY DETECTED: %s" (, docstring))) + nil) + (eval-and-compile + (broken-facility-internal '(, facility) (, docstring) nil))))) (put 'if-broken 'lisp-indent-function 2) (defmacro if-broken (facility then &rest else) "If FACILITY is broken, expand to THEN, otherwise (progn . ELSE)." - (if (broken-p facility) - then - (` (progn . (, else))))) + (` (static-if (broken-p '(, facility)) + (, then) + (,@ else)))) + (put 'when-broken 'lisp-indent-function 1) (defmacro when-broken (facility &rest body) "If FACILITY is broken, expand to (progn . BODY), otherwise nil." - (when (broken-p facility) - (` (progn . (, body))))) + (` (static-when (broken-p '(, facility)) + (,@ body)))) (put 'unless-broken 'lisp-indent-function 1) (defmacro unless-broken (facility &rest body) "If FACILITY is not broken, expand to (progn . BODY), otherwise nil." - (unless (broken-p facility) - (` (progn . (, body))))) + (` (static-unless (broken-p '(, facility)) + (,@ body)))) (defmacro check-broken-facility (facility) "Check FACILITY is broken or not. If the status is different on