Function: ps-put
ps-put is a byte-compiled function defined in ps-print.el.gz.
This function is obsolete since 25.1; use (setf (alist-get ..) ..) instead
Signature
(ps-put ALIST-SYM KEY VALUE)
Documentation
Store element (KEY . VALUE) into association list ALIST-SYM.
If KEY already exists in ALIST-SYM, modify cdr to VALUE.
It can be retrieved with (ps-get ALIST-SYM KEY).
Probably introduced at or before Emacs version 20.1.
Source Code
;; Defined in /usr/src/emacs/lisp/ps-print.el.gz
(defun ps-put (alist-sym key value)
"Store element (KEY . VALUE) into association list ALIST-SYM.
If KEY already exists in ALIST-SYM, modify cdr to VALUE.
It can be retrieved with `(ps-get ALIST-SYM KEY)'."
(declare (obsolete "use (setf (alist-get ..) ..) instead" "25.1"))
(let ((elt: (assq key (symbol-value alist-sym)))) ; to avoid name conflict
(if elt:
(setcdr elt: value)
(setq elt: (cons key value))
(set alist-sym (cons elt: (symbol-value alist-sym))))
elt:))