diff options
| author | Glenn Morris | 2008-05-07 02:57:53 +0000 |
|---|---|---|
| committer | Glenn Morris | 2008-05-07 02:57:53 +0000 |
| commit | 6b5de136853e922ee17aed7aec6b99b875bdeff4 (patch) | |
| tree | 4568b2470d5bbd901a233759216413b90ebbf178 | |
| parent | 5a1dde61e2a71cf7f0663366f0b311679115808d (diff) | |
| download | emacs-6b5de136853e922ee17aed7aec6b99b875bdeff4.tar.gz emacs-6b5de136853e922ee17aed7aec6b99b875bdeff4.zip | |
(ignore-errors): Move here from cl-macs.el.
| -rw-r--r-- | lisp/subr.el | 5 |
1 files changed, 5 insertions, 0 deletions
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). | |||
| 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 | ||