@@ -597,10 +597,12 @@ Current buffer must be a loaddef-style file."
(unless found
(progn
(setq found 'new)
- ;; No later sections in the file. Put before the last page.
- (goto-char (point-max))
- (search-backward "\f" nil t)))
-
+ ;; No later sections in the file. Put first in file.
+ (goto-char (point-min))
+ (when
+ (search-forward "\f" nil t)
+ (goto-char (match-beginning 0)))))
+
(elinstall-generate-add-to-path path-element type)))
;;This never belongs in the no-autoloads section.