From: Lars Ingebrigtsen Date: Thu, 21 Apr 2022 13:11:25 +0000 (+0200) Subject: Clarify cl-incf/decf doc strings X-Git-Tag: emacs-29.0.90~1931^2~373 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=935f400a33d6ff0f5d61fc7ade688a4378613882;p=emacs.git Clarify cl-incf/decf doc strings * lisp/emacs-lisp/cl-lib.el (cl-incf): (cl-decf): Clarify that nil isn't a valid value for X (bug#31715). --- diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el index 4e60a3c63d0..3f40ab07605 100644 --- a/lisp/emacs-lisp/cl-lib.el +++ b/lisp/emacs-lisp/cl-lib.el @@ -114,7 +114,10 @@ a future Emacs interpreter will be able to use it.") (defmacro cl-incf (place &optional x) "Increment PLACE by X (1 by default). PLACE may be a symbol, or any generalized variable allowed by `setf'. -The return value is the incremented value of PLACE." +The return value is the incremented value of PLACE. + +If X is specified, it should be an expression that should +evaluate to a number." (declare (debug (place &optional form))) (if (symbolp place) (list 'setq place (if x (list '+ place x) (list '1+ place))) @@ -123,7 +126,10 @@ The return value is the incremented value of PLACE." (defmacro cl-decf (place &optional x) "Decrement PLACE by X (1 by default). PLACE may be a symbol, or any generalized variable allowed by `setf'. -The return value is the decremented value of PLACE." +The return value is the decremented value of PLACE. + +If X is specified, it should be an expression that should +evaluate to a number." (declare (debug cl-incf)) (if (symbolp place) (list 'setq place (if x (list '- place x) (list '1- place)))