elisp: Get rid of newline hack in printer
authorVasilij Schneidermann <mail@vasilij.de>
Tue, 19 Feb 2019 19:50:14 +0000 (20:50 +0100)
committerVasilij Schneidermann <mail@vasilij.de>
Tue, 19 Feb 2019 19:53:38 +0000 (20:53 +0100)
elisp/printer.el

index f00efa7..4829352 100644 (file)
@@ -12,8 +12,8 @@
       (number-to-string (mal-value form)))
      ((eq type 'string)
       (if print-readably
-          ;; HACK prin1-to-string does only quotes and backslashes
-          (replace-regexp-in-string "\n" "\\\\n" (prin1-to-string value))
+          (let ((print-escape-newlines t))
+            (prin1-to-string value))
         value))
      ((or (eq type 'symbol) (eq type 'keyword))
       (symbol-name value))