From: morioka Date: Tue, 16 Mar 1999 13:48:31 +0000 (+0000) Subject: (defun-maybe-cond): Don't use `unless'. X-Git-Tag: apel-9_15~3 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a2cd23c0364fea0961a0ee6de4be49f2dcfb696;p=elisp%2Fapel.git (defun-maybe-cond): Don't use `unless'. --- diff --git a/poe.el b/poe.el index aea989c..ff39396 100644 --- a/poe.el +++ b/poe.el @@ -103,26 +103,27 @@ ))) (defmacro defun-maybe-cond (name args &optional doc &rest everything-else) - (unless (stringp doc) - (setq everything-else (cons doc everything-else) - doc nil) - ) + (or (stringp doc) + (setq everything-else (cons doc everything-else) + doc nil) + ) (or (and (fboundp name) (not (get name 'defun-maybe))) - (` (unless (fboundp (quote (, name))) - (cond (,@ (mapcar (function - (lambda (case) - (list (car case) - (if doc - (` (defun (, name) (, args) - (, doc) - (,@ (cdr case)))) - (` (defun (, name) (, args) - (,@ (cdr case)))) - )))) - everything-else))) - (put (quote (, name)) 'defun-maybe t) - )))) + (` (or (fboundp (quote (, name))) + (progn + (cond (,@ (mapcar (function + (lambda (case) + (list (car case) + (if doc + (` (defun (, name) (, args) + (, doc) + (,@ (cdr case)))) + (` (defun (, name) (, args) + (,@ (cdr case)))) + )))) + everything-else))) + (put (quote (, name)) 'defun-maybe t) + ))))) (defsubst subr-fboundp (symbol) "Return t if SYMBOL's function definition is a built-in function."