Shortdoc: read and evaluate strings after :eval
* lisp/emacs-lisp/shortdoc.el (shortdoc--display-function): If the parameter of :eval is a string then read, evaluate and print the result. This was always the intention and is documented behaviour.
This commit is contained in:
parent
be165f7533
commit
931d97bf56
1 changed files with 9 additions and 7 deletions
|
@ -1440,14 +1440,16 @@ function's documentation in the Info manual"))
|
||||||
do
|
do
|
||||||
(cl-case type
|
(cl-case type
|
||||||
(:eval
|
(:eval
|
||||||
|
(insert " ")
|
||||||
(if (stringp value)
|
(if (stringp value)
|
||||||
(insert " " value "\n")
|
(insert value)
|
||||||
(insert " ")
|
(prin1 value (current-buffer)))
|
||||||
(prin1 value (current-buffer))
|
(insert "\n " double-arrow " ")
|
||||||
(insert "\n")
|
(let ((expr (if (stringp value)
|
||||||
(insert " " double-arrow " ")
|
(car (read-from-string value))
|
||||||
(prin1 (eval value) (current-buffer))
|
value)))
|
||||||
(insert "\n")))
|
(prin1 (eval expr) (current-buffer)))
|
||||||
|
(insert "\n"))
|
||||||
(:no-eval*
|
(:no-eval*
|
||||||
(if (stringp value)
|
(if (stringp value)
|
||||||
(insert " " value "\n")
|
(insert " " value "\n")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue