diff options
| author | Gemini Lasswell | 2018-05-29 11:41:09 -0700 |
|---|---|---|
| committer | Gemini Lasswell | 2018-06-07 08:27:43 -0700 |
| commit | c6ef3c8321e4907a250eb0906274f6f59d5bfe0d (patch) | |
| tree | b841c43da3cb7fd786504f6175e53b03857b8646 /lisp | |
| parent | 26b52ac40e78cb7ac3df3bf87e514ad137f0ce10 (diff) | |
| download | emacs-c6ef3c8321e4907a250eb0906274f6f59d5bfe0d.tar.gz emacs-c6ef3c8321e4907a250eb0906274f6f59d5bfe0d.zip | |
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 'lisp')
| -rw-r--r-- | lisp/emacs-lisp/cl-print.el | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/cl-print.el b/lisp/emacs-lisp/cl-print.el index 780b9fb3fe9..66561ce2644 100644 --- a/lisp/emacs-lisp/cl-print.el +++ b/lisp/emacs-lisp/cl-print.el | |||
| @@ -61,11 +61,16 @@ call other entry points instead, such as `cl-prin1'." | |||
| 61 | (princ "..." stream) | 61 | (princ "..." stream) |
| 62 | (let ((car (pop object)) | 62 | (let ((car (pop object)) |
| 63 | (count 1)) | 63 | (count 1)) |
| 64 | (if (and (memq car '(\, quote \` \,@ \,.)) | 64 | (if (and print-quoted |
| 65 | (memq car '(\, quote function \` \,@ \,.)) | ||
| 65 | (consp object) | 66 | (consp object) |
| 66 | (null (cdr object))) | 67 | (null (cdr object))) |
| 67 | (progn | 68 | (progn |
| 68 | (princ (if (eq car 'quote) '\' car) stream) | 69 | (princ (cond |
| 70 | ((eq car 'quote) '\') | ||
| 71 | ((eq car 'function) "#'") | ||
| 72 | (t car)) | ||
| 73 | stream) | ||
| 69 | (cl-print-object (car object) stream)) | 74 | (cl-print-object (car object) stream)) |
| 70 | (princ "(" stream) | 75 | (princ "(" stream) |
| 71 | (cl-print-object car stream) | 76 | (cl-print-object car stream) |