From 747c5d45bcd3bb49ba2df7f968e7648d94ec49be Mon Sep 17 00:00:00 2001 From: akr Date: Fri, 9 Apr 1999 13:57:00 +0000 Subject: [PATCH] * EMU-ELS (emu-modules): Add `static'. * static.el: New file. * broken.el: New implementation using `static'. --- ChangeLog | 8 ++++++++ EMU-ELS | 3 ++- broken.el | 40 +++++++++++++++++++++++----------------- 3 files changed, 33 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index b4f7be0..3a1daf9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +1999-04-09 Tanaka Akira + + * EMU-ELS (emu-modules): Add `static'. + + * static.el: New file. + + * broken.el: New implementation using `static'. + 1999-04-09 MORIOKA Tomohiko * EMU-ELS (poem-modules): Add `poem-xfc' if file-coding feature is diff --git a/EMU-ELS b/EMU-ELS index c71aaca..dd01515 100644 --- a/EMU-ELS +++ b/EMU-ELS @@ -83,6 +83,7 @@ pccl-modules pcustom-modules emu-modules)) (setq emu-modules (cons 'broken emu-modules)) - ) + (setq emu-modules (cons 'static emu-modules)) + ) ;;; EMU-ELS ends here diff --git a/broken.el b/broken.el index 7d59492..cc35ff0 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 @@ -49,40 +50,45 @@ ) (put 'broken-facility 'lisp-indent-function 1) + (defmacro broken-facility (facility &optional docstring assertion no-notice) "Declare that FACILITY emulation is broken if ASSERTION is nil. 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 -- 1.7.10.4