summaryrefslogtreecommitdiff
path: root/lisp/subr.el
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-01-16 11:48:32 -0700
committerTom Tromey <tromey@redhat.com>2013-01-16 11:48:32 -0700
commit6f4de085f065e11f4df3195d47479f28f5ef08ba (patch)
tree1211a00f1afc86c2b73624897993db02a4852943 /lisp/subr.el
parente078a23febca14bc919c5806670479c395e3253e (diff)
parentffe04adc88e546c406f9b050238fb98a7243c7a0 (diff)
downloademacs-6f4de085f065e11f4df3195d47479f28f5ef08ba.tar.gz
merge from trunk
Diffstat (limited to 'lisp/subr.el')
-rw-r--r--lisp/subr.el19
1 files changed, 10 insertions, 9 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index 7e3c181e878..9f19268c864 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -3367,16 +3367,17 @@ If BODY finishes, `while-no-input' returns whatever value BODY produced."
(progn ,@body)))))))
(defmacro condition-case-unless-debug (var bodyform &rest handlers)
- "Like `condition-case' except that it does not catch anything when debugging.
-More specifically if `debug-on-error' is set, then it does not catch any signal."
+ "Like `condition-case' except that it does not prevent debugging.
+More specifically if `debug-on-error' is set then the debugger will be invoked
+even if this catches the signal."
(declare (debug condition-case) (indent 2))
- (let ((bodysym (make-symbol "body")))
- `(let ((,bodysym (lambda () ,bodyform)))
- (if debug-on-error
- (funcall ,bodysym)
- (condition-case ,var
- (funcall ,bodysym)
- ,@handlers)))))
+ `(condition-case ,var
+ ,bodyform
+ ,@(mapcar (lambda (handler)
+ `((debug ,@(if (listp (car handler)) (car handler)
+ (list (car handler))))
+ ,@(cdr handler)))
+ handlers)))
(define-obsolete-function-alias 'condition-case-no-debug
'condition-case-unless-debug "24.1")