diff options
author | Stefan Kangas <stefankangas@gmail.com> | 2025-02-17 21:58:53 +0100 |
---|---|---|
committer | Stefan Kangas <stefankangas@gmail.com> | 2025-02-17 22:46:56 +0100 |
commit | afbf932106fdd1043b0debe9fc9134e031e4c9a6 (patch) | |
tree | 2bbd79a4e77be4e02dbf2c37d223896f16236762 /lisp/emacs-lisp | |
parent | 1d27028df803e4dc1c063db5593222311838e051 (diff) | |
download | emacs-afbf932106fdd1043b0debe9fc9134e031e4c9a6.tar.gz emacs-afbf932106fdd1043b0debe9fc9134e031e4c9a6.tar.bz2 emacs-afbf932106fdd1043b0debe9fc9134e031e4c9a6.zip |
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.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/cl-lib.el | 18 | ||||
-rw-r--r-- | lisp/emacs-lisp/shortdoc.el | 12 |
2 files changed, 16 insertions, 14 deletions
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. diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index af995123dc5..23b9b582a9a 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -1412,12 +1412,12 @@ A FUNC form can have any number of `:no-eval' (or `:no-value'), :eval (natnump -1) :eval (natnump 0) :eval (natnump 23)) - (cl-plusp - :eval (cl-plusp 0) - :eval (cl-plusp 1)) - (cl-minusp - :eval (cl-minusp 0) - :eval (cl-minusp -1)) + (plusp + :eval (plusp 0) + :eval (plusp 1)) + (minusp + :eval (minusp 0) + :eval (minusp -1)) (oddp :eval (oddp 3)) (evenp |