From 2a2cd23c0364fea0961a0ee6de4be49f2dcfb696 Mon Sep 17 00:00:00 2001 From: morioka Date: Tue, 16 Mar 1999 13:48:31 +0000 Subject: [PATCH] (defun-maybe-cond): Don't use `unless'. --- poe.el | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) 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." -- 1.7.10.4