defsubst
#byte-run #emacs28.2 #SUBST #macro
インライン関数を定義するマクロ。
https://github.com/emacs-mirror/emacs/blob/emacs-28.2/lisp/emacs-lisp/byte-run.el#L379-L394
code: byte-run.el
(defmacro defsubst (name arglist &rest body)
"Define an inline function. The syntax is just like that of `defun'.
\(fn NAME ARGLIST &optional DOCSTRING DECL &rest BODY)"
(declare (debug defun) (doc-string 3))
(or (memq (get name 'byte-optimizer)
'(nil byte-compile-inline-expand))
(error "`%s' is a primitive" name))
`(prog1
(defun ,name ,arglist ,@body)
(eval-and-compile
;; Never native-compile defsubsts as we need the byte
;; definition in `byte-compile-unfold-bcf' to perform the
;; inlining (Bug#42664, Bug#43280, Bug#44209).
,(byte-run--set-speed name nil -1)
(put ',name 'byte-optimizer 'byte-compile-inline-expand))))
defmacro
declare
or
memq
prog1
defun
eval-and-compile
byte-run--set-speed
put