From: Philip Kaludercic Date: Thu, 13 Oct 2022 08:43:36 +0000 (+0200) Subject: Handle ;;;###theme-autoload comments in etc/themes X-Git-Tag: emacs-29.0.90~1616^2~604 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5fc064f14c0e76bf15b7528ef6ef3771ad169aba;p=emacs.git Handle ;;;###theme-autoload comments in etc/themes * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--emacs-batch): Extract the autoloads and have them loaded along with loaddefs.el. * etc/NEWS: Mention the new feature. (Bug#57639) --- diff --git a/etc/NEWS b/etc/NEWS index 62004c10a6c..041fe0bdbd8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2846,6 +2846,11 @@ Previously, ';;;###' specs inside a top-level form (i.e., something like '(when ... ;;;### ...)' would be ignored. They are now parsed as normal. +--- +** Themes have special autoload cookies. +All build-in themes are scraped for ;;;###theme-autoload cookies that +are loaded along with the regular auto-loaded code. + +++ ** 'buffer-modified-p' has been extended. This function was previously documented to return only nil or t. This diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el index d2654fb2064..a1c4f91579e 100644 --- a/lisp/emacs-lisp/loaddefs-gen.el +++ b/lisp/emacs-lisp/loaddefs-gen.el @@ -736,7 +736,14 @@ rules for built-in packages and excluded files." ;; updated. (file-newer-than-file-p (expand-file-name "emacs-lisp/loaddefs-gen.el" lisp-directory) - output-file)))) + output-file))) + (let ((lisp-mode-autoload-regexp + "^;;;###\\(\\(noexist\\)-\\)?\\(theme-autoload\\)")) + (loaddefs-generate + (expand-file-name "../etc/themes/" lisp-directory) + (expand-file-name "theme-loaddefs.el" lisp-directory)))) + +;;;###autoload (load "theme-loaddefs.el") (provide 'loaddefs-gen)