Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eval-expression-print-level|length are not respected #11

Open
jdtsmith opened this issue Sep 5, 2023 · 0 comments
Open

eval-expression-print-level|length are not respected #11

jdtsmith opened this issue Sep 5, 2023 · 0 comments

Comments

@jdtsmith
Copy link

jdtsmith commented Sep 5, 2023

Eros captures the return value of the prin1 call made by elisp--eval-last-sexp-print-value. But the return value is not subject to e.g. eval-expression-print-level|length, only its printed value is. As a result, these variables have no effect on eros' overlay display.

A possible fix is to, e.g.:

(let* ((result (eval-last-sexp eval-last-sexp-arg-internal))
	 (print-level eval-expression-print-level)
	 (print-length eval-expression-print-length)
	 (ores (prin1-to-string result t)))
...
  (eros--eval-overlay ores (point))

in eros-eval-last-sexp, and, if a string is passed to eval-overlay, do not format it with %S but use directly:

 (eros--make-result-overlay (if (stringp value) value (format "%S" value)) ...

Happy to submit a PR if you would like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant