From 6b5de136853e922ee17aed7aec6b99b875bdeff4 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 7 May 2008 02:57:53 +0000 Subject: [PATCH] (ignore-errors): Move here from cl-macs.el. --- lisp/subr.el | 5 +++++ 1 file changed, 5 insertions(+) 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. -- 2.39.5