From: Glenn Morris Date: Wed, 7 May 2008 02:57:53 +0000 (+0000) Subject: (ignore-errors): Move here from cl-macs.el. X-Git-Tag: emacs-pretest-23.0.90~5760 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6b5de136853e922ee17aed7aec6b99b875bdeff4;p=emacs.git (ignore-errors): Move here from cl-macs.el. --- diff --git a/lisp/subr.el b/lisp/subr.el index ae7c70d6781..8264055651a 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -202,6 +202,11 @@ the return value (nil if RESULT is omitted). Treated as a declaration when used at the right place in a `defmacro' form. \(See Info anchor `(elisp)Definition of declare'.)" nil) + +(defmacro ignore-errors (&rest body) + "Execute BODY; if an error occurs, return nil. +Otherwise, return result of last form in BODY." + `(condition-case nil (progn ,@body) (error nil))) ;;;; Basic Lisp functions.