emacs-diffs
[Top][All Lists]
Advanced

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

scratch/faster-loaddefs e5f141a2a1 7/7: Re-fix doc string output


From: Lars Ingebrigtsen
Subject: scratch/faster-loaddefs e5f141a2a1 7/7: Re-fix doc string output
Date: Sat, 28 May 2022 12:31:22 -0400 (EDT)

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

    Re-fix doc string output
---
 lisp/emacs-lisp/loaddefs-gen.el | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el
index 9c7618ceb7..3bbf793e1c 100644
--- a/lisp/emacs-lisp/loaddefs-gen.el
+++ b/lisp/emacs-lisp/loaddefs-gen.el
@@ -187,12 +187,19 @@ If PACKAGE-ONLY, only return the package info."
     (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 ")
+    (when (memq (car autoload)
+                '( defun autoload defvar defconst
+                   defvar-local defsubst defcustom defmacro))
       (forward-char 1)
       (ignore-errors
         (forward-sexp 3)
         (skip-chars-forward " "))
       (when (looking-at-p "\"")
+        (let* ((start (point))
+               (doc (read (current-buffer))))
+          (delete-region start (point))
+          (prin1 doc (current-buffer) t)
+          (goto-char start))
         (save-excursion
           (forward-char 1)
           (insert "\\\n"))
@@ -201,12 +208,6 @@ 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]