emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] emacs-25 db436e9: Don't call debug on failed cl-assert


From: Noam Postavsky
Subject: Re: [Emacs-diffs] emacs-25 db436e9: Don't call debug on failed cl-assert
Date: Mon, 7 Nov 2016 20:12:50 -0500

On Sun, Nov 6, 2016 at 5:47 PM, Stefan Monnier <address@hidden> wrote:
>
>> I don't quite understand what's the benefit of calling debug when
>> debug-on-error is non-nil: signalling the error is going to call it
>> anyway.
>
> Not if the code is run within an `ignore-errors` clause or some other
> condition-case catching `error`.

Hmm, this seems like kind of a kludgy way to circumvent ignore-errors.
Wouldn't it better to use
(setq debug-on-error '(cl-assertion-failed) debug-on-signal t) along with:

(defun cl--assertion-failed (form &optional string sargs args)
  (signal 'cl-assertion-failed
          (if string (apply #'format-message string (append sargs args))
            `(,form ,@sargs))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]