From 322f7bf67039fc9bcb91801dd55e943e57bedf03 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 24 Jul 2024 23:41:39 +0200 Subject: [PATCH] (error): Remove support for old calling convention * lisp/subr.el (error): Remove support for the Emacs 22 calling convention '(error &rest args)'. (cherry picked from commit a6a4ad13e48c656a530bea37d251a2dc55cc47d8) --- etc/NEWS | 3 +++ lisp/subr.el | 8 +++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index a3b72666dab..688ac56c81a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -149,6 +149,9 @@ positives. * Incompatible Lisp Changes in Emacs 31.1 +** The obsolete calling convention of 'error' has been removed. +That convention was: '(error &rest ARGS)'. + * Lisp Changes in Emacs 31.1 diff --git a/lisp/subr.el b/lisp/subr.el index 7822286ef46..edfac77d50b 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -463,8 +463,7 @@ Also see `ignore'." (declare (pure t) (side-effect-free error-free)) t) -;; Signal a compile-error if the first arg is missing. -(defun error (&rest args) +(defun error (string &rest args) "Signal an error, making a message by passing ARGS to `format-message'. Errors cause entry to the debugger when `debug-on-error' is non-nil. This can be overridden by `debug-ignored-errors'. @@ -481,9 +480,8 @@ for the sake of consistency. To alter the look of the displayed error messages, you can use the `command-error-function' variable." - (declare (ftype (function (&rest t) nil)) - (advertised-calling-convention (string &rest args) "23.1")) - (signal 'error (list (apply #'format-message args)))) + (declare (ftype (function (string &rest t) nil))) + (signal 'error (list (apply #'format-message string args)))) (defun user-error (format &rest args) "Signal a user error, making a message by passing ARGS to `format-message'. -- 2.39.2