summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2022-02-04 19:39:53 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2022-02-04 19:39:53 -0500
commitd52c929e31f60ff0462371bfe27ebd479e3e82bd (patch)
treeb4b4085047333c005b10cee884c8dedef586128b /lisp/emacs-lisp
parentb4f1ceaf241239b8fc7ad1e91af62f4e425bda8a (diff)
downloademacs-d52c929e31f60ff0462371bfe27ebd479e3e82bd.tar.gz
emacs-d52c929e31f60ff0462371bfe27ebd479e3e82bd.tar.bz2
emacs-d52c929e31f60ff0462371bfe27ebd479e3e82bd.zip
(with-demoted-errors): Warn on missing `format` arg
The `format` arg has been mandatory for a while, but the backward compatibility code that handled the case of a missing `format` arg made it hard to notice when using the old calling convention. * lisp/subr.el (with-demoted-errors): Warn on missing `format` arg. * lisp/emacs-lisp/smie.el (smie-indent--separator-outdent): Don't abuse `with-demoted-errors`. (smie-indent-line, smie-auto-fill): * test/lisp/emacs-lisp/ert-tests.el (ert-test-with-demoted-errors): * lisp/vc/vc-hooks.el (vc-refresh-state): * lisp/vc/vc-annotate.el (vc-annotate-background-mode): * lisp/vc/diff-mode.el (diff-syntax-fontify-hunk): * lisp/textmodes/reftex-toc.el (reftex-re-enlarge): * lisp/progmodes/sh-script.el (sh-smie-sh-rules): * lisp/progmodes/octave.el (inferior-octave-startup): * lisp/pcmpl-gnu.el (pcmpl-gnu-make-all-targets): * lisp/org/org-refile.el (org-refile): * lisp/org/org-capture.el (org-capture-store-last-position): * lisp/nxml/nxml-mode.el (nxml-mode): * lisp/notifications.el (notifications-notify): * lisp/gnus/mm-view.el (mm-display-inline-fontify): * lisp/finder.el (finder-unload-function): * lisp/files.el (safe-local-variable-p, backup-buffer-copy * lisp/autorevert.el (auto-revert-notify-handler): Pass `format` arg to `with-demoted-errors`.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/smie.el10
1 files changed, 5 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el
index b2283e66e4f..2bab1319132 100644
--- a/lisp/emacs-lisp/smie.el
+++ b/lisp/emacs-lisp/smie.el
@@ -1301,9 +1301,9 @@ Only meaningful when called from within `smie-rules-function'."
(let ((afterpos (save-excursion
(let ((tok (funcall smie-forward-token-function)))
(unless tok
- (with-demoted-errors
- (error "smie-rule-separator: Can't skip token %s"
- smie--token))))
+ (funcall (if debug-on-error #'error #'message)
+ "smie-rule-separator: Can't skip token %s"
+ smie--token)))
(skip-chars-forward " ")
(unless (eolp) (point)))))
(or (and afterpos
@@ -1820,7 +1820,7 @@ to which that point should be aligned, if we were to reindent it.")
"Indent current line using the SMIE indentation engine."
(interactive)
(let* ((savep (point))
- (indent (or (with-demoted-errors
+ (indent (or (with-demoted-errors "SMIE Error: %S"
(save-excursion
(forward-line 0)
(skip-chars-forward " \t")
@@ -1846,7 +1846,7 @@ to which that point should be aligned, if we were to reindent it.")
(move-to-column fc)
(syntax-ppss))))
(while
- (and (with-demoted-errors
+ (and (with-demoted-errors "SMIE Error: %S"
(save-excursion
(let ((end (point))
(bsf nil) ;Best-so-far.