[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 81b5131: * lisp/ielm.el (ielm-eval-input): Use cl-p
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] master 81b5131: * lisp/ielm.el (ielm-eval-input): Use cl-print. |
Date: |
Mon, 15 Jan 2018 17:04:14 -0500 (EST) |
branch: master
commit 81b5131e11fa96d32a1718c6e2ebf40994d7d281
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>
* lisp/ielm.el (ielm-eval-input): Use cl-print.
---
lisp/ielm.el | 23 +++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)
diff --git a/lisp/ielm.el b/lisp/ielm.el
index fb285e8..259e1b9 100644
--- a/lisp/ielm.el
+++ b/lisp/ielm.el
@@ -436,15 +436,26 @@ nonempty, then flushes the buffer."
(goto-char pmark)
(unless error-type
- (condition-case nil
+ (condition-case err
;; Self-referential objects cause loops in the printer, so
;; trap quits here. May as well do errors, too
(unless for-effect
- (setq output (concat output (pp-to-string result)
- (let ((str (eval-expression-print-format
result)))
- (if str (propertize str 'font-lock-face
'shadow))))))
- (error (setq error-type "IELM Error")
- (setq result "Error during pretty-printing (bug in pp)"))
+ (let* ((ielmbuf (current-buffer))
+ (aux (let ((str (eval-expression-print-format result)))
+ (if str (propertize str 'font-lock-face 'shadow)))))
+ (setq output (with-temp-buffer
+ (let ((tmpbuf (current-buffer)))
+ ;; Use print settings (e.g. print-circle,
+ ;; print-gensym, etc...) from the
+ ;; right buffer!
+ (with-current-buffer ielmbuf
+ (cl-prin1 result tmpbuf))
+ (pp-buffer)
+ (concat (buffer-string) aux))))))
+ (error
+ (setq error-type "IELM Error")
+ (setq result (format "Error during pretty-printing (bug in pp): %S"
+ err)))
(quit (setq error-type "IELM Error")
(setq result "Quit during pretty-printing"))))
(if error-type
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 81b5131: * lisp/ielm.el (ielm-eval-input): Use cl-print.,
Stefan Monnier <=