summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2014-01-23 20:11:48 -0800
committerGlenn Morris <rgm@gnu.org>2014-01-23 20:11:48 -0800
commit1e548e4056d46414fa30bb6cab1c660fa30ac905 (patch)
tree0d72443d74fad7f47306fb08f302401ca68f3af1 /lisp
parent96c983e0d3034ae09406c4b1fb76ca4d06008fcf (diff)
downloademacs-1e548e4056d46414fa30bb6cab1c660fa30ac905.tar.gz
Doc updates for with-demoted-errors
* doc/lispref/control.texi (Handling Errors): Update with-demoted-errors. * lisp/subr.el (with-demoted-errors): Doc fix. * etc/NEWS: Related edit.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/subr.el4
2 files changed, 8 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 738fe6d37be..6743a537744 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
+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).
diff --git a/lisp/subr.el b/lisp/subr.el
index 6709ebf0d02..e3cc4b05f3f 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -3246,9 +3246,13 @@ even if this catches the signal."
(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\"."