]> git.eshelyaron.com Git - emacs.git/commit
cl-print.el: Reduce code duplication
authorStefan Monnier <monnier@iro.umontreal.ca>
Sun, 9 Jul 2023 00:19:02 +0000 (20:19 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sun, 9 Jul 2023 00:19:02 +0000 (20:19 -0400)
commit9c282faf26eb517532508d466270b7b97d436c70
tree2cf4039e1da49e7c6781e25130fa0d4d78082a2d
parentafa4fa17232a806907e975c9532bdf12bb3e6c4c
cl-print.el: Reduce code duplication

While at it, fix a bug in `cl-print-object-contents` for strings,
where we forgot to pass `stream` to `princ` at one place and simplify
a `substring` call using a negative offset.

* lisp/emacs-lisp/cl-print.el (cl-print--cons-tail)
(cl-print--vector-contents, cl-print--struct-contents)
(cl-print--string-props): New functions, extracted from
`cl-print-object-contents`.
(cl-print-object, cl-print-object-contents): Use them.
lisp/emacs-lisp/cl-print.el