From: Lars Ingebrigtsen Date: Thu, 4 Aug 2022 14:41:39 +0000 (+0200) Subject: Minor cleanups in autoload.el/loaddefs-gen.el X-Git-Tag: emacs-29.0.90~1447^2~448 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f038695085d872124cbb87f2a0382d572014c540;p=emacs.git Minor cleanups in autoload.el/loaddefs-gen.el * lisp/subr.el (package--builtin-versions): Adjust comments. * lisp/emacs-lisp/loaddefs-gen.el (no-update-autoloads): Moved here from autoload.el. * lisp/emacs-lisp/loaddefs-gen.el: Removed now that it's no longer used. * lisp/emacs-lisp/package.el (package-autoload-ensure-default-file): Don't warn about soon-to-be obsolete functon. --- diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index eed88b6faf4..6ad8e81363a 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el @@ -267,12 +267,6 @@ if `autoload-timestamps' is non-nil, otherwise a fixed fake time is inserted)." (hack-local-variables)) (current-buffer))) -(defalias 'autoload-insert-section-header - #'loaddefs-generate--insert-section-header) - -(defvar no-update-autoloads nil - "File local variable to prevent scanning this file for autoload cookies.") - (defalias 'autoload-file-load-name #'loaddefs-generate--file-load-name) (defun generate-file-autoloads (file) diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el index 1bb58c102c2..52ec5ef6809 100644 --- a/lisp/emacs-lisp/loaddefs-gen.el +++ b/lisp/emacs-lisp/loaddefs-gen.el @@ -50,6 +50,9 @@ prefix, that will not be registered. But all other prefixes will be included.") (put 'autoload-compute-prefixes 'safe-local-variable #'booleanp) +(defvar no-update-autoloads nil + "File local variable to prevent scanning this file for autoload cookies.") + (defvar autoload-ignored-definitions '("define-obsolete-function-alias" "define-obsolete-variable-alias" @@ -493,27 +496,6 @@ If COMPILE, don't include a \"don't compile\" cookie." :inhibit-provide (not feature)) (buffer-string)))) -(defun loaddefs-generate--insert-section-header (outbuf autoloads - load-name file time) - "Insert into buffer OUTBUF the section-header line for FILE. -The header line lists the file name, its \"load name\", its autoloads, -and the time the FILE was last updated (the time is inserted only -if `autoload-timestamps' is non-nil, otherwise a fixed fake time is inserted)." - (insert "\f\n;;;### ") - (prin1 `(autoloads ,autoloads ,load-name ,file ,time) - outbuf) - (terpri outbuf) - ;; Break that line at spaces, to avoid very long lines. - ;; Make each sub-line into a comment. - (with-current-buffer outbuf - (save-excursion - (forward-line -1) - (while (not (eolp)) - (move-to-column 64) - (skip-chars-forward "^ \n") - (or (eolp) - (insert "\n" ";;;;;; ")))))) - ;;;###autoload (defun loaddefs-generate (dir output-file &optional excluded-files extra-data include-package-version diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 482de52f856..d2959f7728c 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1024,7 +1024,9 @@ untar into a directory named DIR; otherwise, signal an error." (unless (file-exists-p file) (require 'autoload) (let ((coding-system-for-write 'utf-8-emacs-unix)) - (write-region (autoload-rubric file "package" nil) nil file nil 'silent))) + (with-suppressed-warnings ((obsolete autoload-rubric)) + (write-region (autoload-rubric file "package" nil) + nil file nil 'silent)))) file) (defvar autoload-timestamps) diff --git a/lisp/subr.el b/lisp/subr.el index 1b59db0604c..2603b5ad251 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -6638,7 +6638,7 @@ Also, \"-GIT\", \"-CVS\" and \"-NNN\" are treated as snapshot versions." (version-list-= (version-to-list v1) (version-to-list v2))) (defvar package--builtin-versions - ;; Mostly populated by loaddefs.el via autoload-builtin-package-versions. + ;; Mostly populated by loaddefs.el. (purecopy `((emacs . ,(version-to-list emacs-version)))) "Alist giving the version of each versioned builtin package. I.e. each element of the list is of the form (NAME . VERSION) where