Mercurial > emacs
comparison lisp/subr.el @ 94703:4520f20e7dd1
(ignore-errors): Move here from cl-macs.el.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Wed, 07 May 2008 02:57:53 +0000 |
parents | ee5932bf781d |
children | 52e3cee99f90 |
comparison
equal
deleted
inserted
replaced
94702:80bd1cb865de | 94703:4520f20e7dd1 |
---|---|
200 (defmacro declare (&rest specs) | 200 (defmacro declare (&rest specs) |
201 "Do not evaluate any arguments and return nil. | 201 "Do not evaluate any arguments and return nil. |
202 Treated as a declaration when used at the right place in a | 202 Treated as a declaration when used at the right place in a |
203 `defmacro' form. \(See Info anchor `(elisp)Definition of declare'.)" | 203 `defmacro' form. \(See Info anchor `(elisp)Definition of declare'.)" |
204 nil) | 204 nil) |
205 | |
206 (defmacro ignore-errors (&rest body) | |
207 "Execute BODY; if an error occurs, return nil. | |
208 Otherwise, return result of last form in BODY." | |
209 `(condition-case nil (progn ,@body) (error nil))) | |
205 | 210 |
206 ;;;; Basic Lisp functions. | 211 ;;;; Basic Lisp functions. |
207 | 212 |
208 (defun ignore (&rest ignore) | 213 (defun ignore (&rest ignore) |
209 "Do nothing and return nil. | 214 "Do nothing and return nil. |