comparison lisp/subr.el @ 27482:a5ab0c9ced78

Move out indent and edebug specs for when and unless.
author Dave Love <fx@gnu.org>
date Fri, 28 Jan 2000 22:10:18 +0000
parents a10a13dd0670
children 1d7650c95e0a
comparison
equal deleted inserted replaced
27481:62a9d12e8637 27482:a5ab0c9ced78
67 (list 'setq listname (list 'cdr listname)))) 67 (list 'setq listname (list 'cdr listname))))
68 68
69 (defmacro when (cond &rest body) 69 (defmacro when (cond &rest body)
70 "(when COND BODY...): if COND yields non-nil, do BODY, else return nil." 70 "(when COND BODY...): if COND yields non-nil, do BODY, else return nil."
71 (list 'if cond (cons 'progn body))) 71 (list 'if cond (cons 'progn body)))
72 (put 'when 'lisp-indent-function 1)
73 (put 'when 'edebug-form-spec '(&rest form))
74 72
75 (defmacro unless (cond &rest body) 73 (defmacro unless (cond &rest body)
76 "(unless COND BODY...): if COND yields nil, do BODY, else return nil." 74 "(unless COND BODY...): if COND yields nil, do BODY, else return nil."
77 (cons 'if (cons cond (cons nil body)))) 75 (cons 'if (cons cond (cons nil body))))
78 (put 'unless 'lisp-indent-function 1)
79 (put 'unless 'edebug-form-spec '(&rest form))
80 76
81 (defmacro dolist (spec &rest body) 77 (defmacro dolist (spec &rest body)
82 "(dolist (VAR LIST [RESULT]) BODY...): loop over a list. 78 "(dolist (VAR LIST [RESULT]) BODY...): loop over a list.
83 Evaluate BODY with VAR bound to each car from LIST, in turn. 79 Evaluate BODY with VAR bound to each car from LIST, in turn.
84 Then evaluate RESULT to get return value, default nil." 80 Then evaluate RESULT to get return value, default nil."