[Top][All Lists]

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

Re: New macro with-demoted-errors

From: Stefan Monnier
Subject: Re: New macro with-demoted-errors
Date: Sun, 08 Jul 2007 10:08:54 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

>     +    `(lexical-let ((f (lambda () ,@body)))
> lexical-let is a cl macro, and I'd rather not make subr.el use them.

It probably breaks bootstrapping indeed.
I can make it use make-symbol, if you prefer.

> Perhaps we should add a way to make condition-case operate only if
> (null debug-on-error).  It could use some sort of marker symbol
> in the handler:

>         (condition-case ,err
>             (funcall f)
>           ((debug error) (message "Error: %s" ,err) nil))))))

> would mean to catch all errors but only if debug-on-error is nil.

But that same syntax currently means "catch `error' or `debug' signals", so
it seems a bit dangerous to change its meaning.  How 'bout

         (condition-case ,err
             (funcall f)
           (((not debug) error) (message "Error: %s" ,err) nil))))))

Still, a problem here is that it requires extending `condition-case' in the
C code and in the byte-compiler.  I'd rather just provide a new
macro condition-case-non-debug.

> That would be a lot more convenient, whether for writing the macro,
> for for direct use.



reply via email to

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