diff options
| -rw-r--r-- | lisp/subr.el | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index 22056046416..b674f364e46 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -43,17 +43,13 @@ BODY should be a list of lisp expressions." | |||
| 43 | ;; depend on backquote.el. | 43 | ;; depend on backquote.el. |
| 44 | (list 'function (cons 'lambda cdr))) | 44 | (list 'function (cons 'lambda cdr))) |
| 45 | 45 | ||
| 46 | ;;(defmacro defun-inline (name args &rest body) | 46 | (defmacro when (cond &rest body) |
| 47 | ;; "Create an \"inline defun\" (actually a macro). | 47 | "(when COND BODY...): if COND yields non-nil, do BODY, else return nil." |
| 48 | ;;Use just like `defun'." | 48 | (list 'if cond (cons 'progn body))) |
| 49 | ;; (nconc (list 'defmacro name '(&rest args)) | ||
| 50 | ;; (if (stringp (car body)) | ||
| 51 | ;; (prog1 (list (car body)) | ||
| 52 | ;; (setq body (or (cdr body) body)))) | ||
| 53 | ;; (list (list 'cons (list 'quote | ||
| 54 | ;; (cons 'lambda (cons args body))) | ||
| 55 | ;; 'args)))) | ||
| 56 | 49 | ||
| 50 | (defmacro unless (cond &rest body) | ||
| 51 | "(unless COND BODY...): if COND yields nil, do BODY, else return nil." | ||
| 52 | (cons 'if (cons cond (cons nil body)))) | ||
| 57 | 53 | ||
| 58 | ;;;; Keymap support. | 54 | ;;;; Keymap support. |
| 59 | 55 | ||