From 9fb0aaa1ce4ed0050d2e13552f078a563c8a20ed Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 4 Oct 2022 13:04:16 +0200 Subject: [PATCH] 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). --- lisp/emacs-lisp/loaddefs-gen.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el index 095d6b14e63..964d23c770e 100644 --- a/lisp/emacs-lisp/loaddefs-gen.el +++ b/lisp/emacs-lisp/loaddefs-gen.el @@ -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;;;") -- 2.39.2