# HG changeset patch # User Glenn Morris # Date 1210129073 0 # Node ID 4520f20e7dd130ec50423feb83dad8766d19c5bc # Parent 80bd1cb865dedad7167b6e4576c4d8c7f5704e68 (ignore-errors): Move here from cl-macs.el. diff -r 80bd1cb865de -r 4520f20e7dd1 lisp/subr.el --- a/lisp/subr.el Wed May 07 02:56:35 2008 +0000 +++ b/lisp/subr.el Wed May 07 02:57:53 2008 +0000 @@ -202,6 +202,11 @@ 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.