diff options
| author | Stefan Monnier | 2018-01-15 17:04:05 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2018-01-15 17:04:05 -0500 |
| commit | 81b5131e11fa96d32a1718c6e2ebf40994d7d281 (patch) | |
| tree | 2b5cc6312c21d289a5e2ffc92c5539abfee79327 | |
| parent | 400b72cb6e118b86d2e83cbfb45b829b231ec4f9 (diff) | |
| download | emacs-81b5131e11fa96d32a1718c6e2ebf40994d7d281.tar.gz emacs-81b5131e11fa96d32a1718c6e2ebf40994d7d281.zip | |
* lisp/ielm.el (ielm-eval-input): Use cl-print.
| -rw-r--r-- | lisp/ielm.el | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/lisp/ielm.el b/lisp/ielm.el index fb285e80f6e..259e1b9f79f 100644 --- a/lisp/ielm.el +++ b/lisp/ielm.el | |||
| @@ -436,15 +436,26 @@ nonempty, then flushes the buffer." | |||
| 436 | 436 | ||
| 437 | (goto-char pmark) | 437 | (goto-char pmark) |
| 438 | (unless error-type | 438 | (unless error-type |
| 439 | (condition-case nil | 439 | (condition-case err |
| 440 | ;; Self-referential objects cause loops in the printer, so | 440 | ;; Self-referential objects cause loops in the printer, so |
| 441 | ;; trap quits here. May as well do errors, too | 441 | ;; trap quits here. May as well do errors, too |
| 442 | (unless for-effect | 442 | (unless for-effect |
| 443 | (setq output (concat output (pp-to-string result) | 443 | (let* ((ielmbuf (current-buffer)) |
| 444 | (let ((str (eval-expression-print-format result))) | 444 | (aux (let ((str (eval-expression-print-format result))) |
| 445 | (if str (propertize str 'font-lock-face 'shadow)))))) | 445 | (if str (propertize str 'font-lock-face 'shadow))))) |
| 446 | (error (setq error-type "IELM Error") | 446 | (setq output (with-temp-buffer |
| 447 | (setq result "Error during pretty-printing (bug in pp)")) | 447 | (let ((tmpbuf (current-buffer))) |
| 448 | ;; Use print settings (e.g. print-circle, | ||
| 449 | ;; print-gensym, etc...) from the | ||
| 450 | ;; right buffer! | ||
| 451 | (with-current-buffer ielmbuf | ||
| 452 | (cl-prin1 result tmpbuf)) | ||
| 453 | (pp-buffer) | ||
| 454 | (concat (buffer-string) aux)))))) | ||
| 455 | (error | ||
| 456 | (setq error-type "IELM Error") | ||
| 457 | (setq result (format "Error during pretty-printing (bug in pp): %S" | ||
| 458 | err))) | ||
| 448 | (quit (setq error-type "IELM Error") | 459 | (quit (setq error-type "IELM Error") |
| 449 | (setq result "Quit during pretty-printing")))) | 460 | (setq result "Quit during pretty-printing")))) |
| 450 | (if error-type | 461 | (if error-type |