From: morioka Date: Sun, 25 Oct 1998 16:39:18 +0000 (+0000) Subject: (defalias-maybe): New macro. X-Git-Tag: apel-9_6~19 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=68874c7ee5fe902689a46b7c383b6564036d0679;p=elisp%2Fapel.git (defalias-maybe): New macro. --- diff --git a/poe.el b/poe.el index 9c00b52..65d742e 100644 --- a/poe.el +++ b/poe.el @@ -24,21 +24,9 @@ ;;; Code: -(defmacro defvar-maybe (name &rest everything-else) - (or (and (boundp name) - (not (get name 'defvar-maybe)) - ) - (` (or (boundp (quote (, name))) - (progn - (defvar (, name) (,@ everything-else)) - (put (quote (, name)) 'defvar-maybe t) - )) - ))) - (defmacro defun-maybe (name &rest everything-else) (or (and (fboundp name) - (not (get name 'defun-maybe)) - ) + (not (get name 'defun-maybe))) (` (or (fboundp (quote (, name))) (progn (defun (, name) (,@ everything-else)) @@ -48,8 +36,7 @@ (defmacro defsubst-maybe (name &rest everything-else) (or (and (fboundp name) - (not (get name 'defsubst-maybe)) - ) + (not (get name 'defsubst-maybe))) (` (or (fboundp (quote (, name))) (progn (defsubst (, name) (,@ everything-else)) @@ -59,8 +46,7 @@ (defmacro defmacro-maybe (name &rest everything-else) (or (and (fboundp name) - (not (get name 'defmacro-maybe)) - ) + (not (get name 'defmacro-maybe))) (` (or (fboundp (quote (, name))) (progn (defmacro (, name) (,@ everything-else)) @@ -68,10 +54,31 @@ )) ))) +(defmacro defalias-maybe (symbol definition) + (setq symbol (eval symbol)) + (or (and (fboundp symbol) + (not (get symbol 'defalias-maybe))) + (` (or (fboundp (quote (, symbol))) + (progn + (defalias (quote (, symbol)) (, definition)) + (put (quote (, symbol)) 'defalias-maybe t) + )) + ))) + (put 'defun-maybe 'lisp-indent-function 'defun) (put 'defsubst-maybe 'lisp-indent-function 'defun) (put 'defmacro-maybe 'lisp-indent-function 'defun) +(defmacro defvar-maybe (name &rest everything-else) + (or (and (boundp name) + (not (get name 'defvar-maybe))) + (` (or (boundp (quote (, name))) + (progn + (defvar (, name) (,@ everything-else)) + (put (quote (, name)) 'defvar-maybe t) + )) + ))) + (defmacro defconst-maybe (name &rest everything-else) (or (and (boundp name) (not (get name 'defconst-maybe))