;;; 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))
(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))
(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))
))
)))
+(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))