diff options
author | Gemini Lasswell <gazally@runbox.com> | 2018-05-29 11:41:09 -0700 |
---|---|---|
committer | Gemini Lasswell <gazally@runbox.com> | 2018-06-07 08:27:43 -0700 |
commit | c6ef3c8321e4907a250eb0906274f6f59d5bfe0d (patch) | |
tree | b841c43da3cb7fd786504f6175e53b03857b8646 /test/lisp/emacs-lisp/cl-print-tests.el | |
parent | 26b52ac40e78cb7ac3df3bf87e514ad137f0ce10 (diff) | |
download | emacs-c6ef3c8321e4907a250eb0906274f6f59d5bfe0d.tar.gz |
Make cl-print respect print-quoted (bug#31649)
* lisp/emacs-lisp/cl-print.el (cl-print-object) <cons>: Observe
print-quoted when printing quote and its relatives. Add printing of
'function' as #'.
Diffstat (limited to 'test/lisp/emacs-lisp/cl-print-tests.el')
-rw-r--r-- | test/lisp/emacs-lisp/cl-print-tests.el | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/cl-print-tests.el b/test/lisp/emacs-lisp/cl-print-tests.el index bfce4a16cec..404d323d0c1 100644 --- a/test/lisp/emacs-lisp/cl-print-tests.el +++ b/test/lisp/emacs-lisp/cl-print-tests.el @@ -72,6 +72,16 @@ (should (equal "#s(cl-print-tests-struct :a (a (b (c ...))) :b nil :c nil :d nil :e nil)" (cl-prin1-to-string deep-struct))))) +(ert-deftest cl-print-tests-5 () + "CL printing observes `print-quoted'." + (let ((quoted-stuff '('a #'b `(,c ,@d)))) + (let ((print-quoted t)) + (should (equal "('a #'b `(,c ,@d))" + (cl-prin1-to-string quoted-stuff)))) + (let ((print-quoted nil)) + (should (equal "((quote a) (function b) (\\` ((\\, c) (\\,@ d))))" + (cl-prin1-to-string quoted-stuff)))))) + (ert-deftest cl-print-circle () (let ((x '(#1=(a . #1#) #1#))) (let ((print-circle nil)) |