From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Kyle Meyer <kyle@kyleam.com>
Cc: lomov.vl@yandex.ru, 54225-done@debbugs.gnu.org
Subject: bug#54225: [PATCH] with-demoted-errors: Fix macroexp-warn-and-return call
Date: Thu, 03 Mar 2022 10:14:04 -0500 [thread overview]
Message-ID: <jwvbkynrs02.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <20220303030035.570230-1-kyle@kyleam.com> (Kyle Meyer's message of "Wed, 2 Mar 2022 22:00:35 -0500")
Kyle Meyer [2022-03-02 22:00:35] wrote:
> The macroexp-warn-and-return call added to with-demoted-errors in
> d52c929e31f (2022-02-04) is incorrect. The with-demoted-errors format
> string is passed as MSG, the actual message is passed as FORM, and the
> form is passed as CATEGORY, leading to with-demoted-errors returning
> "Missing format argument".
>
> * lisp/subr.el (with-demoted-errors): Call macroexp-warn-and-return
> with correct arguments.
> ---
> lisp/subr.el | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lisp/subr.el b/lisp/subr.el
> index eb9af0b36da..7dde7589dd9 100644
> --- a/lisp/subr.el
> +++ b/lisp/subr.el
> @@ -4560,7 +4560,7 @@ with-demoted-errors
> (if (eq orig-body body) exp
> ;; The use without `format' is obsolete, let's warn when we bump
> ;; into any such remaining uses.
> - (macroexp-warn-and-return format "Missing format argument" exp))))
> + (macroexp-warn-and-return "Missing format argument" exp))))
>
> (defmacro combine-after-change-calls (&rest body)
> "Execute BODY, but don't call the after-change functions till the end.
>
> base-commit: 543640628607ec06e9698cc50c33497ca75155a4
Thanks. I used the patch below, instead.
Stefan
diff --git a/lisp/subr.el b/lisp/subr.el
index eb9af0b36da..2321765f953 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -4560,7 +4560,7 @@ with-demoted-errors
(if (eq orig-body body) exp
;; The use without `format' is obsolete, let's warn when we bump
;; into any such remaining uses.
- (macroexp-warn-and-return format "Missing format argument" exp))))
+ (macroexp-warn-and-return "Missing format argument" exp nil nil format))))
(defmacro combine-after-change-calls (&rest body)
"Execute BODY, but don't call the after-change functions till the end.
prev parent reply other threads:[~2022-03-03 15:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-03 3:00 bug#54225: [PATCH] with-demoted-errors: Fix macroexp-warn-and-return call Kyle Meyer
2022-03-03 14:36 ` Lars Ingebrigtsen
2022-03-04 0:21 ` Michael Heerdegen
2022-03-03 15:14 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvbkynrs02.fsf-monnier+emacs@gnu.org \
--to=bug-gnu-emacs@gnu.org \
--cc=54225-done@debbugs.gnu.org \
--cc=kyle@kyleam.com \
--cc=lomov.vl@yandex.ru \
--cc=monnier@iro.umontreal.ca \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).