Function: decf
decf is an autoloaded macro defined in gv.el.gz.
Signature
(decf PLACE &optional DELTA)
Documentation
Decrement generalized variable PLACE by DELTA (default to 1).
The DELTA is first subtracted from PLACE, and then stored in PLACE. Return the decremented value of PLACE.
For more information about generalized variables, see Info node
(elisp) Generalized Variables.
See also incf.
Other relevant functions are documented in the number group.
Probably introduced at or before Emacs version 31.1.
Shortdoc
;; number
(let ((x 4)) (decf x) x)
=> 3
(let ((x 4)) (decf x 2))
=> 2
Aliases
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/gv.el.gz
;;;###autoload
(defmacro decf (place &optional delta)
"Decrement generalized variable PLACE by DELTA (default to 1).
The DELTA is first subtracted from PLACE, and then stored in PLACE.
Return the decremented value of PLACE.
For more information about generalized variables, see Info node
`(elisp) Generalized Variables'.
See also `incf'."
(declare (debug (gv-place &optional form)))
(gv-letplace (getter setter) place
(funcall setter `(- ,getter ,(or delta 1)))))