* doc/lispref/control.texi (Handling Errors): Update with-demoted-errors.
* lisp/subr.el (with-demoted-errors): Doc fix.
* etc/NEWS: Related edit.
2014-01-24 Glenn Morris <rgm@gnu.org>
+ * control.texi (Handling Errors): Update with-demoted-errors.
+
* files.texi (File Locks): Every platform supports locking now.
2014-01-22 Glenn Morris <rgm@gnu.org>
@end example
@end defmac
-@defmac with-demoted-errors body@dots{}
+@defmac with-demoted-errors format body@dots{}
This macro is like a milder version of @code{ignore-errors}. Rather
than suppressing errors altogether, it converts them into messages.
-Use this form around code that is not expected to signal errors, but
+It uses the string @var{format} to format the message.
+@var{format} should contain a single @samp{%}-sequence; e.g.,
+@code{"Error: %S"}. Use @code{with-demoted-errors} around code
+that is not expected to signal errors, but
should be robust if one does occur. Note that this macro uses
@code{condition-case-unless-debug} rather than @code{condition-case}.
@end defmac
+++
*** New function `define-error'.
++++
*** `with-demoted-errors' takes an additional argument `format'.
+++
+2014-01-24 Glenn Morris <rgm@gnu.org>
+
+ * subr.el (with-demoted-errors): Doc fix.
+
2014-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/cl-macs.el: Improve type->predicate mapping (bug#16520).
(defmacro with-demoted-errors (format &rest body)
"Run BODY and demote any errors to simple messages.
+FORMAT is a string passed to `message' to format any error message.
+It should contain a single %-sequence; e.g., \"Error: %S\".
+
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.
+
For backward compatibility, if FORMAT is not a constant string, it
is assumed to be part of BODY, in which case the message format
used is \"Error: %S\"."