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: Sun, 6 Nov 2016 13:28:46 -0500

On Sat, Nov 5, 2016 at 1:22 PM, Stefan Monnier <address@hidden> wrote:
>
> >     Don't call debug on failed cl-assert
>
> That's really too bad: I introduced it very explicitly because I found
> it extremely convenient.

Oh, I see; it would be helpful if you had included the rational in the
commit message where you introduced it.

>
> > Doing this causes problems when running ert tests
>
> Can it be fixed somewhere else?

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.

But it looks like funcalling `debugger' instead of calling `debug'
seems to work:

(defun cl--assertion-failed (form &optional string sargs args)
  (if debug-on-error
      (funcall debugger `(cl-assertion-failed ,form ,string ,@sargs))
    (if string
        (apply #'error string (append sargs args))
      (signal 'cl-assertion-failed `(,form ,@sargs)))))



reply via email to

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