emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scratch/faster-loaddefs 62138656da 5/7: Make output even more similar


From: Lars Ingebrigtsen
Subject: scratch/faster-loaddefs 62138656da 5/7: Make output even more similar
Date: Sat, 28 May 2022 12:31:22 -0400 (EDT)

branch: scratch/faster-loaddefs
commit 62138656da9bdccc6073f27abf3f7fd996c14f64
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make output even more similar
---
 lisp/emacs-lisp/loaddefs-gen.el | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el
index a5e38c5823..2c50fa994f 100644
--- a/lisp/emacs-lisp/loaddefs-gen.el
+++ b/lisp/emacs-lisp/loaddefs-gen.el
@@ -187,8 +187,11 @@ If PACKAGE-ONLY, only return the package info."
     (autoload--make-defs-autoload prefs load-name)))
 
 (defun loaddefs-gen--prettify-autoload (autoload)
+  ;; FIXME: All this is just to emulate the current look -- it should
+  ;; probably all go.
   (with-temp-buffer
-    (prin1 autoload (current-buffer) t)
+    (prin1 autoload (current-buffer) '(t (escape-newlines . t)
+                                         (escape-control-characters . t)))
     (goto-char (point-min))
     (when (looking-at-p "(autoload \\|(defvar \\|(defconst \\|(defvar-local ")
       (forward-char 1)
@@ -204,6 +207,12 @@ If PACKAGE-ONLY, only return the package info."
                             (forward-sexp 1)
                             (point)))
         (goto-char (point-min))
+        (while (search-forward "\\n" nil t)
+          (replace-match "\n" t t))
+        (goto-char (point-min))
+        (while (search-forward "\\11" nil t)
+          (replace-match "\t" t t))
+        (goto-char (point-min))
         (while (search-forward "\n(" nil t)
           (replace-match "\n\\(" t t))
         (widen)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]