From afbf932106fdd1043b0debe9fc9134e031e4c9a6 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 17 Feb 2025 21:58:53 +0100 Subject: New functions plusp and minusp * lisp/emacs-lisp/cl-lib.el (cl-plusp, cl-minusp): Move from here... * lisp/subr.el (plusp, minusp): ...to here. Make old names into aliases, documented as deprecated. Add type declarations. Change from defsubst to regular functions with compiler macros. * lisp/obsolete/cl.el: Don't alias plusp and minusp. * test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-test-plusp) (cl-lib-test-minusp): Move tests from here... * test/lisp/subr-tests.el (subr-test-plusp, subr-test-minusp): ...to here. * doc/lispref/numbers.texi (Predicates on Numbers): Document plusp and minusp. * doc/misc/cl.texi (Predicates on Numbers): Delete cl-plusp and cl-minusp. * lisp/emacs-lisp/shortdoc.el (number): Document plusp and minusp instead of cl-plusp and cl-minusp. --- lisp/emacs-lisp/cl-lib.el | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'lisp/emacs-lisp/cl-lib.el') diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el index 1fc36517796..4a83e9d6a7c 100644 --- a/lisp/emacs-lisp/cl-lib.el +++ b/lisp/emacs-lisp/cl-lib.el @@ -270,15 +270,17 @@ so that they are registered at compile-time as well as run-time." (define-obsolete-function-alias 'cl-floatp-safe 'floatp "24.4") -(defsubst cl-plusp (number) - "Return t if NUMBER is positive." - (declare (side-effect-free t)) - (> number 0)) +(defalias 'cl-plusp #'plusp + "Return t if NUMBER is positive. -(defsubst cl-minusp (number) - "Return t if NUMBER is negative." - (declare (side-effect-free t)) - (< number 0)) +This function is considered deprecated in favor of the built-in function +`plusp' that was added in Emacs 31.1.") + +(defalias 'cl-minusp #'minusp + "Return t if NUMBER is negative. + +This function is considered deprecated in favor of the built-in function +`minusp' that was added in Emacs 31.1.") (defalias 'cl-oddp #'oddp "Return t if INTEGER is odd. -- cgit v1.2.3