all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Wolfgang Jenkner <wjenkner@inode.at>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Leo <sdl.web@gmail.com>, emacs-devel@gnu.org
Subject: Re: /srv/bzr/emacs/trunk r107126: Document yet more things that were never added to NEWS
Date: Tue, 07 Feb 2012 20:02:12 +0100	[thread overview]
Message-ID: <85aa4uea4v.fsf@iznogoud.viz> (raw)
In-Reply-To: jwvobtcc97n.fsf-monnier+emacs@gnu.org

On Mon, Feb 06 2012, Stefan Monnier wrote:

>> Is there a better name for this macro _condition-case-no-debug_?
>
> Not yet.  How 'bout "condition-case-unless-debugging"?

The newly added parts in <info:(elisp) Handling Errors> mention that
with-demoted-errors is implemented in terms of condition-case-no-debug,
but this leaves me wondering why, in this or other cases, this should be
better than using condition-case with the `debug' pseudo-condition, viz.

#+begin_src emacs-lisp
(defmacro with-demoted-errors (&rest body)
  "Run BODY and demote any errors to simple messages.
If `debug-on-error' is non-nil, run BODY without catching its errors.
This is to be used around code which is not expected to signal an error
but which should be robust in the unexpected case that an error is signaled."
  (declare (debug t) (indent 0))
  (let ((err (make-symbol "err")))
    `(condition-case ,err
	 (progn ,@body)
       ((debug error) (message "Error: %S" ,err) nil))))
#+end_src 

Wolfgang



  reply	other threads:[~2012-02-07 19:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1RuDCk-0000uU-8t@vcs.savannah.gnu.org>
2012-02-06  4:10 ` /srv/bzr/emacs/trunk r107126: Document yet more things that were never added to NEWS Leo
2012-02-06 14:45   ` Stefan Monnier
2012-02-07 19:02     ` Wolfgang Jenkner [this message]
2012-02-07 23:58       ` Stefan Monnier
2012-02-08  2:01     ` Leo
2012-02-08 19:09       ` Stefan Monnier
2012-02-09  3:43         ` Leo
2012-02-09  6:06           ` Glenn Morris
2012-02-09  6:43             ` Leo
2012-02-09  6:54               ` Glenn Morris
2012-02-09  7:47                 ` Leo
2012-02-09 21:57                   ` Stefan Monnier
2012-02-10 12:52                     ` Leo
2012-02-10 15:27                       ` Stefan Monnier

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

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

  git send-email \
    --in-reply-to=85aa4uea4v.fsf@iznogoud.viz \
    --to=wjenkner@inode.at \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=sdl.web@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.