How does one access the declare
specification of a function?
Edit: After the answer of npostavs I have to correct myself.
As long as a function is not byte-compiled the declare
forms are still in its symbol-function
. Where do they go after byte-compilation?
Example: (content of scratch buffer with lisp code and evaluation results)
(defun test (&rest args)
"Function with declare form."
(declare (indent 1))
(interactive)
(message args))
;; repl: test
(symbol-function 'test)
;; repl: (lambda (&rest args) "Function with declare form." (interactive) (message args))
(symbol-plist 'test)
;; repl: (lisp-indent-function 1)
That means the declare
forms are not contained in the function cell of the symbol after the defun
.
(defun test (&rest args)
"Function with declare form."
(interactive)
(declare (indent 1))
(message args))
(symbol-function 'test)
(lambda (&rest args) "Function with declare form." (interactive) (declare (indent 1)) (message args))
(setf f (byte-compile 'test))
#[(&rest args) "\301!\207" [args message] 2 "Function with declare form." nil]
What is the right way to access the declare information of a function in elisp?