Make loaddefs-generate more resilient

* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Don't bug
out when there's an existing loaddefs file that's not formatted
properly (bug#58280).
This commit is contained in:
Lars Ingebrigtsen 2022-10-04 13:04:16 +02:00
parent 535eec3bca
commit 9fb0aaa1ce

View file

@ -632,7 +632,7 @@ instead of just updating them with the new/changed autoloads."
;; It's a new file; put the data at the end.
(progn
(goto-char (point-max))
(search-backward "\f\n"))
(search-backward "\f\n" nil t))
;; Delete the old version of the section.
(delete-region (match-beginning 0)
(and (search-forward "\n\f\n;;;")