Function: define-symbol-prop
define-symbol-prop is a byte-compiled function defined in subr.el.gz.
Signature
(define-symbol-prop SYMBOL PROP VAL)
Documentation
Define the property PROP of SYMBOL to be VAL.
This is to put what defalias is to fset.
Probably introduced at or before Emacs version 26.1.
Source Code
;; Defined in /usr/src/emacs/lisp/subr.el.gz
;; (defun autoload-type (object)
;; "Returns the type of OBJECT or `function' or `command' if the type is nil.
;; OBJECT should be an autoload object."
;; (when (autoloadp object)
;; (let ((type (nth 3 object)))
;; (cond ((null type) (if (nth 2 object) 'command 'function))
;; ((eq 'keymap t) 'macro)
;; (type)))))
;; (defalias 'autoload-file #'cadr
;; "Return the name of the file from which AUTOLOAD will be loaded.
;; \n\(fn AUTOLOAD)")
(defun define-symbol-prop (symbol prop val)
"Define the property PROP of SYMBOL to be VAL.
This is to `put' what `defalias' is to `fset'."
;; Can't use `cl-pushnew' here (nor `push' on (cdr foo)).
;; (cl-pushnew symbol (alist-get prop
;; (alist-get 'define-symbol-props
;; current-load-list)))
(let ((sps (assq 'define-symbol-props current-load-list)))
(unless sps
(setq sps (list 'define-symbol-props))
(push sps current-load-list))
(let ((ps (assq prop sps)))
(unless ps
(setq ps (list prop))
(setcdr sps (cons ps (cdr sps))))
(unless (member symbol (cdr ps))
(setcdr ps (cons symbol (cdr ps))))))
(put symbol prop val))