unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: rms@gnu.org
Cc: emacs-devel@gnu.org
Subject: Re: New macro with-demoted-errors
Date: Sun, 08 Jul 2007 10:08:54 -0400	[thread overview]
Message-ID: <jwvmyy7youd.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <E1I7HBJ-0007s4-3b@fencepost.gnu.org> (Richard Stallman's message of "Sat\, 07 Jul 2007 16\:47\:05 -0400")

>     +    `(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.

Indeed.


        Stefan

      reply	other threads:[~2007-07-08 14:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-07  6:07 New macro with-demoted-errors Stefan Monnier
2007-07-07 20:47 ` Richard Stallman
2007-07-08 14:08   ` Stefan Monnier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvmyy7youd.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).