diff options
| author | Lars Ingebrigtsen | 2019-07-26 09:58:23 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-07-26 09:58:53 +0200 |
| commit | eb45cc9521e25dc685bdfb4a6b7926c244fbf259 (patch) | |
| tree | 293d9e053560d62f055e3348fb7378a75d5c7000 /test | |
| parent | 66db7b2c36c9189baf6f6b3d3fd7d04b3903cab4 (diff) | |
| download | emacs-eb45cc9521e25dc685bdfb4a6b7926c244fbf259.tar.gz emacs-eb45cc9521e25dc685bdfb4a6b7926c244fbf259.zip | |
Add new macro `ignore-error'
* doc/lispref/control.texi (Handling Errors): Document
`ignore-error'.
* lisp/subr.el (ignore-error): New macro.
* lisp/progmodes/elisp-mode.el (elisp-completion-at-point):
Provide completion for `ignore-error'.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/subr-tests.el | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index 06db8f5c902..0023680738d 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el | |||
| @@ -400,5 +400,15 @@ See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19350." | |||
| 400 | (should (equal subr-tests--hook '(f5 f10 f9 f6 f2 f1 f4 f3 f7 f8))) | 400 | (should (equal subr-tests--hook '(f5 f10 f9 f6 f2 f1 f4 f3 f7 f8))) |
| 401 | ) | 401 | ) |
| 402 | 402 | ||
| 403 | (ert-deftest ignore-error-tests () | ||
| 404 | (should (equal (ignore-error (end-of-file) | ||
| 405 | (read "")) | ||
| 406 | nil)) | ||
| 407 | (should (equal (ignore-error end-of-file | ||
| 408 | (read "")) | ||
| 409 | nil)) | ||
| 410 | (should-error (ignore-error foo | ||
| 411 | (read "")))) | ||
| 412 | |||
| 403 | (provide 'subr-tests) | 413 | (provide 'subr-tests) |
| 404 | ;;; subr-tests.el ends here | 414 | ;;; subr-tests.el ends here |